0
$\begingroup$

Rosanswers logo

Launch file

<launch>
        <arg name="model" />
        <command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" param name="robot_description" />
        <param name="use_gui" value="true" />
        <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 mastering_ros_robot_description_pkg)/urdf.rviz" required="true" />
</launch>

I don't know what's wrong. Every time that I try run appear the same error: RLException: Invalid roslaunch XML syntax: not well-formed (invalid token): line 3, column 9 The traceback for the exception was written to the log file

I checked the line, but there is nothing wrong.


Originally posted by Jose-Araujo on ROS Answers with karma: 5 on 2019-05-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Like the error says, you have invalid syntax in your launch file. The line

<command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" param name="robot_description" />

Should probably be

<param name="robot_description" command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" />

I found it on the Qbotics Labs GitHub repo.


Originally posted by jayess with karma: 6155 on 2019-05-16

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Jose-Araujo on 2019-05-16:
So, when I use:

<param name="robot_description" command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" />

Appear this erro:

RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: command [/home/jose/catkin_ws/src/xacro/xacro.py /home/jose/catkin_ws/src/mastering_ros_robot_description_pkg/urdf/seven_dof_arm.xacro] returned with code [2]. 
    
Param xml is <param command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" name="robot_description"/>
    The traceback for the exception was written to the log file

And when I use:

<command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" param name="robot_description" />

Appear this:

RLException: Invalid roslaunch XML syntax: not well-formed (invalid token): line 3, column 9.
The traceback for the exception was written to the log file

Comment by kump on 2019-05-17:
@Jose-Araujo The format @jayess suggested is definitely right. You are setting a parameter called robot_description to a rosparam server by processing the seven_dof_arm.xacro file. This file needs to have this xacro header

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="<your_robot>">

and needs to result in valid URDF file. That is if you use

rosrun xacro xacro path/to/seven_dof_arm.xacro > model.urdf

to convert the xacro file into URDF, and then

check_urdf model.urdf

to check validity of the URDF file.

It needs to say all is well formatted and print the structure tree into the terminal. So try those commands and see what it tells us.

Comment by Jose-Araujo on 2019-05-17:
It's running now. I find an error on xacro and changed what @kump and @jayess said. Thank you!

Comment by jayess on 2019-05-17:
@Jose-Araujo That's great. Could you please click on the check mark (✓) to the left of the question to mark it as correct?

$\endgroup$

Your Answer

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