0
$\begingroup$

Rosanswers logo

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/

SUMMARY
========

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

NODES
  /
    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]
ROS_MASTER_URI=http://localhost:11311

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/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", 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/

SUMMARY
========

PARAMETERS
 * /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

NODES
  /
    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 with pid [13344]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 8b042242-4d14-11e5-b9ce-94dbc9b65860
process[rosout-1]: started with pid [13357]
started core service [/rosout]
process[gazebo-2]: started with pid [13381]
process[gazebo_gui-3]: started with pid [13387]
process[tf_footprint_base-4]: started with pid [13397]
Gazebo multi-robot simulator, version 2.2.3
Copyright (C) 2012-2014 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 2.2.3
Copyright (C) 2012-2014 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

process[spawn_model-5]: started with pid [13417]
process[robot_state_publisher-6]: started with pid [13418]
[ERROR] [1440718633.930278102]: Could not find parameter robot_description on parameter server
robot_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.
Msg Waiting for master.[ INFO] [1440718633.959184914]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1440718633.959634053]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Msg Waiting for master
process[pr2_mechanism_diagnostics-7]: started with pid [13469]
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 192.168.1.66
[robot_state_publisher-6] process has died [pid 13418, exit code -6, cmd /opt/ros/indigo/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/roque/.ros/log/8b042242-4d14-11e5-b9ce-94dbc9b65860/robot_state_publisher-6.log].
log file: /home/roque/.ros/log/8b042242-4d14-11e5-b9ce-94dbc9b65860/robot_state_publisher-6*.log
process[fake_joint_calibration-8]: started with pid [13497]
spawn_model script started
Error: you must specify incoming format as either urdf or sdf format xml
[ INFO] [1440718634.279034660, 0.022000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1440718634.325453185, 0.067000000]: Physics dynamic reconfigure ready.
[spawn_model-5] process has finished cleanly
log file: /home/roque/.ros/log/8b042242-4d14-11e5-b9ce-94dbc9b65860/spawn_model-5*.log

Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 192.168.1.66
Error [Param.cc:181] Unable to set value [1,0471975511965976] for key[horizontal_fov]
Error [Param.cc:181] Unable to set value [0,100000001] for key[near]

And nothing appears on gazebo world.

Now, I need majorly rviz working for simulation purposes, so any help is well appreciated!

Thank you all in advance!

EDIT:

These are the launch files and URDF contentes:

-> gazebo.launch

<launch>
  <include
    file="$(find gazebo_ros)/launch/empty_world.launch" />
  <node
    name="tf_footprint_base"
    pkg="tf"
    type="static_transform_publisher"
    args="0 0 0 0 0 0 base_link base_footprint 40" />
  <node
    name="spawn_model"
    pkg="gazebo_ros"
    type="spawn_model"
    args="-file $(find CamPanTilt)/robots/CamPanTilt.URDF -urdf -model CamPanTilt"
    output="screen" />
  <include
    file="$(find pr2_controller_manager)/controller_manager.launch" />
  <node
    name="fake_joint_calibration"
    pkg="rostopic"
    type="rostopic"
    args="pub /calibrated std_msgs/Bool true" />
</launch>

-> display.launch

<launch>
  <arg
    name="model" />
  <arg
    name="gui"
    default="False" />
  <param
    name="robot_description"
    textfile="$(find CamPanTilt)/robots/CamPanTilt.URDF" />
  <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 CamPanTilt)/urdf.rviz" />
</launch>

--> robots/CamPanTilt.URDF

<robot
  name="CamPanTilt">
  <link
    name="base_link">
    <inertial>
      <origin
        xyz="-0.011104 0.0057497 0.011464"
        rpy="0 0 0" />
      <mass
        value="0.0061463" />
      <inertia
        ixx="3.347E-07"
        ixy="5.501E-13"
        ixz="1.9147E-08"
        iyy="5.4671E-07"
        iyz="-1.1272E-11"
        izz="3.4466E-07" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.50196 0.50196 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>
  <link
    name="PanServoArm">
    <inertial>
      <origin
        xyz="-0.0058063 0.0056894 0.02697"
        rpy="0 0 0" />
      <mass
        value="0.00021197" />
      <inertia
        ixx="5.8256E-09"
        ixy="-5.658E-09"
        ixz="-3.2766E-12"
        iyy="6.6501E-09"
        iyz="-3.524E-12"
        izz="1.2197E-08" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/PanServoArm.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/PanServoArm.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="PanJoint"
    type="revolute">
    <origin
      xyz="0 0 0"
      rpy="6.383E-32 0 0" />
    <parent
      link="base_link" />
    <child
      link="PanServoArm" />
    <axis
      xyz="0 0 -1" />
    <limit
      lower="0"
      upper="31415"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="PanSupport">
    <inertial>
      <origin
        xyz="-0.0069033 0.0068547 0.038914"
        rpy="0 0 0" />
      <mass
        value="0.0058343" />
      <inertia
        ixx="2.6339E-06"
        ixy="-1.0947E-06"
        ixz="-7.1828E-08"
        iyy="2.7282E-06"
        iyz="6.8799E-08"
        izz="3.5062E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/PanSupport.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.79216 0.81961 0.93333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/PanSupport.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="PanSupFix"
    type="fixed">
    <origin
      xyz="0 0 0"
      rpy="6.383E-32 0 0" />
    <parent
      link="PanServoArm" />
    <child
      link="PanSupport" />
    <axis
      xyz="0 0 0" />
  </joint>
  <link
    name="TiltServo">
    <inertial>
      <origin
        xyz="0.018413 -0.017395 0.049947"
        rpy="0 0 0" />
      <mass
        value="0.0061463" />
      <inertia
        ixx="4.4132E-07"
        ixy="-1.0093E-07"
        ixz="-1.3827E-08"
        iyy="4.5005E-07"
        iyz="1.3245E-08"
        izz="3.347E-07" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/TiltServo.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.50196 0.50196 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/TiltServo.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="TiltServoFix"
    type="fixed">
    <origin
      xyz="0 0 0"
      rpy="6.383E-32 0 0" />
    <parent
      link="PanSupport" />
    <child
      link="TiltServo" />
    <axis
      xyz="0 0 0" />
  </joint>
  <link
    name="TiltServoArm">
    <inertial>
      <origin
        xyz="0.00727193208331956 -0.00661008759575177 0.0553159239373915"
        rpy="0 0 0" />
      <mass
        value="0.000211974678865187" />
      <inertia
        ixx="1.18936328320485E-08"
        ixy="3.21238646824262E-10"
        ixz="-1.37168032015685E-09"
        iyy="1.18564651740535E-08"
        iyz="-1.43083188057239E-09"
        izz="9.22418783119774E-10" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/TiltServoArm.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 1 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/TiltServoArm.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="TiltServoJoint"
    type="revolute">
    <origin
      xyz="0 0 0"
      rpy="6.383E-32 0 0" />
    <parent
      link="TiltServo" />
    <child
      link="TiltServoArm" />
    <axis
      xyz="-0.72217 0.69172 0" />
    <limit
      lower="0"
      upper="31415"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="CamSupport">
    <inertial>
      <origin
        xyz="-0.00450560234040073 0.0107871985689981 0.0566128074113866"
        rpy="0 0 0" />
      <mass
        value="0.00260511521134874" />
      <inertia
        ixx="5.15087239188273E-07"
        ixy="-2.67129141058185E-07"
        ixz="-1.23582295811577E-08"
        iyy="5.44255965139437E-07"
        iyz="1.69577402247203E-09"
        izz="6.3599454959973E-07" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/CamSupport.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/CamSupport.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="CamSupFix"
    type="fixed">
    <origin
      xyz="0 0 0"
      rpy="6.383E-32 0 0" />
    <parent
      link="TiltServoArm" />
    <child
      link="CamSupport" />
    <axis
      xyz="0 0 0" />
  </joint>
  <link
    name="Camera">
    <inertial>
      <origin
        xyz="-0.00916985047453746 0.00637398344600984 0.055902485696986"
        rpy="0 0 0" />
      <mass
        value="0.0265197113865597" />
      <inertia
        ixx="2.95103284926697E-06"
        ixy="-1.33061480481582E-07"
        ixz="-1.68306584859954E-08"
        iyy="2.99131498753602E-06"
        iyz="1.89986232020431E-08"
        izz="2.83617764622404E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/Camera.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="1 0 0 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://CamPanTilt/meshes/Camera.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="CamEncl"
    type="fixed">
    <origin
      xyz="0 0 0"
      rpy="6.383E-32 0 0" />
    <parent
      link="CamSupport" />
    <child
      link="Camera" />
    <axis
      xyz="0 0 0" />
  </joint>
</robot>

All STL's are on the right place.

Update: gazebo shows the robot, but display.launch does not. Also, I always get that error saying that robot_publisher process died


Originally posted by Roque on ROS Answers with karma: 21 on 2015-08-27

Post score: 1


Original comments

Comment by gvdhoorn on 2015-08-28:
Without access to your urdf/xacro files it's going to be difficult to help you.

Also:

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

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

Comment by yasagitov on 2015-08-28:
execute roscd CamPanTilt && find and post result here

Comment by Roque on 2015-08-31:
. ./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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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" />


Originally posted by yasagitov with karma: 223 on 2015-08-28

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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