Ask Your Question

URDF to Xacro from Solidworks Problems

asked 2015-08-27 18:43:36 -0600

Roque gravatar image

updated 2015-08-28 06:26:58 -0600

Hello folks!

First time here, mind me if I do anything wrong :)

First, my setup is: ROS Indigo on Linux Mint 17.1 (Ubuntu 14.04 based).

I am trying to import a robot I built on Solidworks and exported to URDF with the plugin provided here. Now things start to get tricky:

I can't run none launch files provided, with the following error (display.launch):

roque@mint-machine:~/ROS/catkin_workspace/src/CamPanTilt/launch$ roslaunch display.launch 
... logging to /home/roque/.ros/log/7db1f390-4d13-11e5-9277-94dbc9b65860/roslaunch-mint-machine-11086.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://mint-machine:35559/


 * /robot_description: 
 * /rosdistro: indigo
 * /rosversion: 1.11.10
 * /use_gui: False

    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    robot_state_publisher (robot_state_publisher/state_publisher)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [11098]

setting /run_id to 7db1f390-4d13-11e5-9277-94dbc9b65860
process[rosout-1]: started with pid [11113]
started core service [/rosout]
process[joint_state_publisher-2]: started with pid [11130]
process[robot_state_publisher-3]: started with pid [11131]
[ERROR] [1440718181.920790719]: Error document empty.
state_publisher: /usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = const urdf::Link; typename boost::detail::sp_member_access<T>::type = const urdf::Link*]: Assertion `px != 0' failed.
process[rviz-4]: started with pid [11145]
[robot_state_publisher-3] process has died [pid 11131, exit code -6, cmd /opt/ros/indigo/lib/robot_state_publisher/state_publisher __name:=robot_state_publisher __log:=/home/roque/.ros/log/7db1f390-4d13-11e5-9277-94dbc9b65860/robot_state_publisher-3.log].
log file: /home/roque/.ros/log/7db1f390-4d13-11e5-9277-94dbc9b65860/robot_state_publisher-3*.log
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher", line 343, in <module>
    jsp = JointStatePublisher()
  File "/opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher", line 26, in __init__
    robot = xml.dom.minidom.parseString(description).getElementsByTagName('robot')[0]
  File "/usr/lib/python2.7/xml/dom/", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0
[joint_state_publisher-2] process has died [pid 11130, exit code 1, cmd /opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/roque/.ros/log/7db1f390-4d13-11e5-9277-94dbc9b65860/joint_state_publisher-2.log].
log file: /home/roque/.ros/log/7db1f390-4d13-11e5-9277-94dbc9b65860/joint_state_publisher-2*.log

For gazebo, all i get is:

roque@mint-machine:~/ROS/catkin_workspace/src/CamPanTilt/launch$ roslaunch gazebo.launch 
... logging to /home/roque/.ros/log/8b042242-4d14-11e5-b9ce-94dbc9b65860/roslaunch-mint-machine-13332.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://mint-machine:43321/


 * /pr2_controller_manager/joint_state_publish_rate: 100.0
 * /pr2_controller_manager/mechanism_statistics_publish_rate: 1.0
 * /robot_state_publisher/publish_frequency: 50.0
 * /robot_state_publisher/tf_prefix: 
 * /rosdistro: indigo
 * /rosversion: 1.11.10
 * /use_sim_time: True

    fake_joint_calibration (rostopic/rostopic)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    pr2_mechanism_diagnostics (pr2_mechanism_diagnostics/pr2_mechanism_diagnostics)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    spawn_model (gazebo_ros/spawn_model)
    tf_footprint_base (tf/static_transform_publisher)

auto-starting new master
process[master]: started ...
edit retag flag offensive close merge delete


Without access to your urdf/xacro files it's going to be difficult to help you.


Now, I need majorly rviz working for simulation purposes, [..]

Just to clarify: RViz is not a simulator. It only visualises data.

gvdhoorn gravatar image gvdhoorn  ( 2015-08-28 00:50:36 -0600 )edit

execute roscd CamPanTilt && find and post result here

yasagitov gravatar image yasagitov  ( 2015-08-28 07:59:02 -0600 )edit

. ./robots ./robots/CamPanTilt.URDF ./launch ./launch/gazebo.launch ./launch/display.launch ./meshes ./meshes/PanServoArm.STL ./meshes/CamSupport.STL ./meshes/TiltServo.STL ./meshes/PanSupport.STL ./meshes/Camera.STL ./meshes/TiltServoArm.STL ./meshes/base_link.STL ./manifest.xml ./textures

Roque gravatar image Roque  ( 2015-08-31 09:50:05 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2015-08-28 02:59:00 -0600

yasagitov gravatar image

For my case, SW urdf exporter made a few errors in launch files.

To fix i changed in gazebo.launch file:

  • file="$(find gazebo_worlds)/launch/empty_world.launch" /> replace with file="$(find gazebo_ros)/launch/empty_world.launch" />

  • <node name="spawn_model" pkg="gazebo" type="spawn_model" args="-file $(find ROBOTNAME)/robots/ROBOTNAME.URDF-urdf -model ROBOTNAME" output="screen" /> replace with <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-file $(find ROBOTNAME)/robots/ROBOTNAME.URDF -urdf -model ROBOTNAME" output="screen" />

edit flag offensive delete link more

answered 2015-08-28 01:19:34 -0600

Akif gravatar image

It seem like your launch file can not find the urdf file or file is invalid. Maybe you should provide more details like contents of display.launch, path of your URDF file etc.

edit flag offensive delete link more

answered 2015-08-31 08:58:16 -0600

Roque gravatar image

updated 2015-08-31 09:47:18 -0600

Still crashes, look:

[robot_state_publisher-3] process has died [pid 5561, exit code -11, cmd /opt/ros/indigo/lib/robot_state_publisher/state_publisher __name:=robot_state_publisher __log:=/home/roque/.ros/log/f93dc3d8-4fe6-11e5-b089-10bf4814ba8b/robot_state_publisher-3.log].
log file: /home/roque/.ros/log/f93dc3d8-4fe6-11e5-b089-10bf4814ba8b/robot_state_publisher-3*.log

Also, got this warning:

[ WARN] [1441030207.883059642]: TF to MSG: Quaternion Not Properly Normalized

This appears right before the state_publisher death.

edit flag offensive delete link more


Now upload /home/roque/.ros/log/f93dc3d8-4fe6-11e5-b089-10bf4814ba8b/robot_state_publisher-3.log to and post link here

yasagitov gravatar image yasagitov  ( 2015-09-01 01:41:40 -0600 )edit

Or alternatively upload ROS package somewhere so i can try to launch it on my setup.

yasagitov gravatar image yasagitov  ( 2015-09-01 01:43:51 -0600 )edit

Content of the log file:


Also, here is the package:!uN0AGLIB!YeDaDU4PhH...

Roque gravatar image Roque  ( 2015-09-01 08:39:55 -0600 )edit

In gazebo.launch add line<param name="robot_description" textfile="$(find CamPanTilt)/robots/CamPanTilt.URDF"/>

yasagitov gravatar image yasagitov  ( 2015-09-01 09:09:38 -0600 )edit

answered 2015-08-28 06:41:48 -0600

gvdhoorn gravatar image

updated 2015-08-28 07:16:26 -0600

<axis xyz="0 0 0"/>

This is just one example (there are more in your file), but it seems the exporter could not derive the axes properly from your SolidWorks model.

Set a 1 in the location that corresponds to the axes for the joints, and things should start working.

Edit: Nope, fixed joints don't need the axis element at all.

Edit 2: do things also crash when you run roslaunch urdf_tutorial display.launch model:=/path/to/your/pkg/robots/CamPanTilt.URDF? Make sure you have the urdf_tutorial package installed.

edit flag offensive delete link more



Those axes were set to None on the plugin, because they were fixed joints. Though, I changed them for the proper axis reference and still got the same problem on rviz and gazebo. For some reason, robot state publisher is dying all the time!

Roque gravatar image Roque  ( 2015-08-28 06:50:38 -0600 )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



Asked: 2015-08-27 18:43:36 -0600

Seen: 1,145 times

Last updated: Aug 31 '15