Ask Your Question
0

xacro: in-order processing became default in ROS MeLodic.

asked 2020-03-29 08:43:35 -0500

Heho gravatar image

updated 2020-04-01 01:40:47 -0500

mgruhler gravatar image

I have exported an urdf file from solidwork and change it into xacro file ,but I meet some troubles when i launched it. The original urdf file(display.launch) can be launched normally. When I launch my xacro file, it can't works.

The problem is within the used launch file (robot.launch):

<launch>
  <arg name="model" default="$(find xacro)/xacro --inorder '$(find myarm)/urdf/xacro/total.xacro'" />
  <arg  name="gui"  default="True" />

  <param name="robot_description" command="$(arg model)" />

  <param name="use_gui"   value="$(arg gui)" />

  <node  name="joint_state_publisher"  pkg="joint_state_publisher"  type="joint_state_publisher" />

  <node  name="robot_state_publisher"  pkg="robot_state_publisher"   type="state_publisher" />

  <node  name="rviz"  pkg="rviz"   type="rviz"   args="-d $(find model)/urdf.rviz" />
</launch>

The log is following.

[roslaunch][INFO] 2020-03-30 21:00:25,178: starting in server mode
[roslaunch.parent][INFO] 2020-03-30 21:00:25,178: starting roslaunch parent run
[roslaunch][INFO] 2020-03-30 21:00:25,178: loading roscore config file /opt/ros/melodic/etc/ros/roscore.xml
[roslaunch][INFO] 2020-03-30 21:00:25,487: Added core node of type [rosout/rosout] in namespace [/]
[roslaunch.config][INFO] 2020-03-30 21:00:25,487: loading config file /home/heho/catkin_ws/src/myarm/launch/robot.launch
[roslaunch][INFO] 2020-03-30 21:00:25,675: Added node of type [joint_state_publisher/joint_state_publisher] in namespace [/]
[roslaunch][INFO] 2020-03-30 21:00:25,675: Added node of type [robot_state_publisher/state_publisher] in namespace [/]
[roslaunch][ERROR] 2020-03-30 21:00:25,675: Resource not found: model
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/heho/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
[roslaunch][ERROR] 2020-03-30 21:00:25,675: The traceback for the exception was written to the log file
[roslaunch][ERROR] 2020-03-30 21:00:25,679: Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 330, in main
    p.start()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 289, in start
    self._start_infrastructure()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 238, in _start_infrastructure
    self._load_config()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 144, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/config.py", line 460, in load_config_default
    loader.load(f, config, argv=args, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 761, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 733, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 671, in _recurse_load
    n = self._node_tag(tag, context, ros_config, default_machine, verbose=verbose)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 96, in call
    return f(*args, **kwds)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 390, in _node_tag
    'launch-prefix ...
(more)
edit retag flag offensive close merge delete

Comments

If this is really a copy&paste from the console output, you completely messed up your ROS Path. Then, there is something seriously wrong... Please double check the console output again and make sure to c'n'p without any stray whitespace characters or something renaming melodic to meLodtc...

Also, have you tried to run the command that has been provided?

Last but not least, urdf and xacro are different formats, after all. It might also help if you showed the file producing the error....

mgruhler gravatar image mgruhler  ( 2020-03-30 01:41:07 -0500 )edit

Sorry, the log was upload on windows OS(Graph to text). I am sure that nothing wrong with my ROS path... Now I have updated the consult output from the log file and my xacro file.

Heho gravatar image Heho  ( 2020-03-30 09:33:05 -0500 )edit

Now you got rid of the command that you should run, okay...

The path looks better now.

So, how do you launch it? Judging from the console output, this seems to be rather a problem of the launch file then the xacro. There is no mention of the xacros in any of the logs.

It would be beneficial if you could provide a (not) working example with that we can reproduce the problem. If you cannot share the full source code, start by trimming away unnecessary stuff from the xacro and launch files until you identify what causes the problem. If you can then share the files this would help debugging a lot...

mgruhler gravatar image mgruhler  ( 2020-03-31 07:21:39 -0500 )edit

I have upload the whole package to GitHub(same link)."display.launch" can run normally while "robot.launch " can't work.

Heho gravatar image Heho  ( 2020-03-31 08:48:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-04-01 01:43:02 -0500

mgruhler gravatar image

The problem is only within your robot.launch (I've updated your question).

<node name="rviz" pkg="rviz" type="rviz" args="-d $(find model)/urdf.rviz" />

should be $(find myarm).

edit flag offensive delete link more

Comments

It works!Thanks a lot!

Heho gravatar image Heho  ( 2020-04-01 07:25:07 -0500 )edit

Great. Could you mark the answer as correct by clicking the checkmark? Thanks.

mgruhler gravatar image mgruhler  ( 2020-04-02 07:47:47 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-03-29 08:43:35 -0500

Seen: 2,161 times

Last updated: Apr 01 '20