0
$\begingroup$

Rosanswers logo

Hello,

I would like to have more URDF models (next to robot's one) displayed in RVIZ (for example ipa-kitchen,cup, table...). How to do it correctly? Models have often same named links (dummy_link)...

This is my current solution, but there are some errors in RVIZ as you can see...

This is my launch file: http://pastebin.com/igmvk7cq

Model looks good in RVIZ, but there are errors in robot model.

image description

As you can see, there are /world_tf/xx transforms and also xx ones. Why?

There is screenshot of rxgraph:

image description

Output of roswtf:

Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /gazebo:
   * /gazebo/set_model_state
   * /gazebo/set_link_state

WARNING These nodes have died:
 * world/spawn_urdf_world-2


Found 7 error(s).

ERROR Communication with [/rviz] raised an error: 
ERROR Communication with [/rosout] raised an error: 
ERROR Communication with [/rxconsole_1319534397534378303] raised an error: 
ERROR Communication with [/world/joint_state_publisher] raised an error: 
ERROR Communication with [/gazebo] raised an error: 
ERROR Communication with [/world/robot_state_publisher] raised an error: 
ERROR The following nodes should be connected but aren't:
 * /world/joint_state_publisher->/world/robot_state_publisher (/world/joint_states)
 * /gazebo->/rviz (/tf)
 * /gazebo->/world/robot_state_publisher (/clock)
 * /gazebo->/world/joint_state_publisher (/clock)
 * /rosout->/rxconsole_1319534397534378303 (/rosout_agg)
 * /gazebo->/rviz (/clock)
 * /gazebo->/gazebo (/clock)
 * /world/robot_state_publisher->/rviz (/tf)

Am I completely wrong with using join_state_publisher and robot_state_publisher (for fixed joints) or is there just some small mistake? Thanks a lot for any useful advice. Cheers :-)


Originally posted by ZdenekM on ROS Answers with karma: 704 on 2011-10-24

Post score: 3

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Model looks good in RVIZ, but there are errors in robot model.

In fact there is no error in the model. There is only status info that model has errors.

When rviz starts, it parses robot_description without tf_prefix therefore showing model error of not transformed links. When the tf_prefix is entered (either manually or via .vcg configuration) there is update of links transformations, but status is not cleared from the previous error state. The new correct info is added to previous one, but to global status is left as Error.

Simple patch to robot_model_display.cpp cures this out.

*** /opt/ros/fuerte/stacks/visualization/rviz/src/rviz/default_plugin/robot_model_display.cpp     2012-08-01 00:39:38.876030807 +0200
--- /opt/ros/fuerte/stacks/visualization/rviz/src/rviz/default_plugin/robot_model_display.cpp     2012-08-01 00:39:47.564200799 +0200
***************
*** 137,142 ****
--- 137,144 ----
  
  void RobotModelDisplay::setTFPrefix(const std::string& prefix)
  {
+   clearStatuses();
+ 
    tf_prefix_ = prefix;
  
    propertyChanged(tf_prefix_property_);

I'll try to issue a ticket for this.


Originally posted by Jakub with karma: 1821 on 2012-07-31

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by hersh on 2012-08-01:
Fixed in latest version of rviz. I just kicked off a new Fuerte release (visualization-1.8.14). It should be available in the next day or so. Thanks for the patch!

$\endgroup$
0
$\begingroup$

Rosanswers logo

I think the problem is that gazebo is in an entirely different namespace than the rest of your nodes (particularly robot_state_publisher). Try setting them all to use the same namespace and see if that helps.

EDIT: When I'm launching multiple objects at the same time, I like to use xacro to define the objects that I want to create. So instead of the urdf containing link names, I can parameterize all of the link names so that I can launch as many as I want simultaneously. For example, instead of using:

<link name="dummy_link" />

I would use:

<link name="${name}_dummy_link" />

so that to add a new object, I just need to pass it a unique "name" variable.

Xacro might be the solution you're looking for. If it isn't, I might be interpreting your problem incorrectly and I can amend my answer.

EDIT: For multiple objects, you will end up with separate tf trees. The way to get around this is to make sure that all objects share one (and only one) tf frame. (I use the "/world" frame).


Originally posted by DimitriProsser with karma: 11163 on 2011-10-24

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by tfoote on 2011-10-28:
This looks like it's enough for it's own question. Please promote it as such so others can find it too.

Comment by ZdenekM on 2011-10-26:
Another question - can be the xacro parametrized from launch file? It would be nice to define "name" parameter from it.

Comment by ZdenekM on 2011-10-26:
I tried version of launch file without namespaces, just tf_prefixes. It works better (there is no error and all looks ok), but just for one model. For two objects there are two separate tf trees and no transformation between them.

Comment by ZdenekM on 2011-10-26:
Yes, this is comfortable way how to do it. But if I want to put already made objects into simulation (things from cob packages and so on) it's not very practical to change their definition. And next - there are tf_prefixes which can be used for this and I'm curious about how to use it... :-)

Comment by ZdenekM on 2011-10-25:
Ok means that one model is Ok without namespaces :-) But what can I do to visualize more models in RVIZ?

Comment by ZdenekM on 2011-10-25:
Well, thanks for hint! I removed world namespace and it's ok. But what should I do to put more models into RVIZ? They usually have same names of links... For example dummy_link. Can I handle this with just tf prefixes?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.