Robotics StackExchange | Archived questions

Error with gazebo_ros_controller_manager plugin - Gazebo-1.5 groovy

Hello,

I have a robot model consists of a box with four wheels. The caja.urdf file is:

<robot name="caja" 

       xmlns:xi="http://www.w3.org/2001/XInclude"
       xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"
       xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
       xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
       xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
       xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
       xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
       xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
       xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering"
       xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable"
       xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
       xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics">


    <!--<xacro: property name ="radius" value =".5"/>
    <xacro: property name ="length" value =".02"/>
    <xacro: property name ="pi" value ="3.1415"/>-->


  <link name="base">

    <inertial>
      <mass value="45.0" />
      <origin xyz="0 0 0.07" />
      <inertia  ixx="3.737" ixy="0.008"  ixz="-0.144"  iyy="8.311"  iyz="-0.004"  izz="8.893" />
    </inertial>

    <visual>
     <origin rpy="0 0 0" xyz="0 0 0.07"/>
     <geometry>
        <box size=".5 .6 .3"/>
     </geometry>
    </visual>

    <collision>
       <origin xyz="0 0 0" rpy="0 0 0 " />
       <geometry>
        <box size=".5 .6 .3"/>
      </geometry>
    </collision>     
  </link>

  <gazebo reference="base">
    <material>Gazebo/Red</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>

  <link name="right_front_wheel">
        <inertial>
      <mass value="25.0" />
      <inertia  ixx="1" ixy="0"  ixz="0"  iyy="1"  iyz="0"  izz="1" />
    </inertial>

   <visual>
            <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </visual>

   <collision>-->

<geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </collision> 

  </link>

  <gazebo reference="right_front_wheel">
    <material>Gazebo/Black</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>


  <joint name="joint_front_right_wheel" type="continuous">
    <parent link="base"/>
    <child link="right_front_wheel"/>
        <axis xyz = "0 1 0"/>
        <origin xyz="0.275 -0.3 -0.08" rpy="1.57075 0 1.57075"/>
        <limit effort = "100" velocity = "100"/>
  </joint> 

 <transmission name="joint_frw_trans" type="pr2_mechanism_model/SimpleTransmission">
     <joint name="joint_front_right_wheel" />
     <actuator name="joint_frw_motor">
    <mechanicalReduction>1</mechanicalReduction>
        </actuator>
    <motorTorqueConstant>200</motorTorqueConstant>
  </transmission>



 <link name="left_front_wheel">
        <inertial>
      <mass value="25.0" />
      <inertia  ixx="1" ixy="0"  ixz="0"  iyy="1"  iyz="0"  izz="1" />
    </inertial>

   <visual>

  <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </visual>

   <collision>
 <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </collision> 

  </link>
  <gazebo reference="left_front_wheel">
    <material>Gazebo/Black</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>

  <joint name="joint_front_left_wheel" type="continuous">
    <parent link="base"/>
    <child link="left_front_wheel"/>
        <axis xyz = "0 1 0"/>
        <origin xyz="-0.275 -0.3 -0.08" rpy="1.57075 0 1.57075"/>
        <limit effort = "100" velocity = "100"/>
    </joint> 

 <transmission name="joint_flw_trans" type="pr2_mechanism_model/SimpleTransmission">
     <actuator name="joint_flw_motor" />
     <joint name="joint_front_left_wheel" />
     <mechanicalReduction>1</mechanicalReduction>
     <motorTorqueConstant>200</motorTorqueConstant>
  </transmission>


  <link name="right_back_wheel">
        <inertial>
      <mass value="25.0" />
      <inertia  ixx="1" ixy="0"  ixz="0"  iyy="1"  iyz="0"  izz="1" />
    </inertial>

   <visual>-->

    <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </visual>

   <collision>

  <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </collision> 

  </link>

  <gazebo reference="right_back_wheel">
    <material>Gazebo/Black</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>

  <joint name="joint_back_right_wheel" type="continuous">
    <parent link="base"/>
    <child link="right_back_wheel"/>
        <axis xyz = "0 1 0"/>
        <origin xyz="-0.275 0.3 -0.08" rpy="1.57075 0 1.57075"/>
        <limit effort = "100" velocity = "100"/>
  </joint> 

 <transmission name="joint_brw_trans" type="pr2_mechanism_model/SimpleTransmission">
     <actuator name="joint_brw_motor" />
     <joint name="joint_back_right_wheel" />
     <mechanicalReduction>1</mechanicalReduction>
     <motorTorqueConstant>1</motorTorqueConstant>
  </transmission>



 <link name="left_back_wheel">
        <inertial>
      <mass value="25.0" />
      <inertia  ixx="1" ixy="0"  ixz="0"  iyy="1"  iyz="0"  izz="1" />
    </inertial>

   <visual>-->
     <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </visual>

   <collision>-->
       <geometry>
        <cylinder radius=".07" length = ".05"/>
      </geometry>
    </collision> 

  </link>

  <gazebo reference="left_back_wheel">
    <material>Gazebo/Black</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>

  <joint name="joint_back_left_wheel" type="continuous">
    <parent link="base"/>
    <child link="left_back_wheel"/>
        <axis xyz = "0 1 0"/>
        <origin xyz="0.275 0.3 -0.08" rpy="1.57075 0 1.57075"/>
        <limit effort = "100" velocity = "100"/>
 </joint> 

  <transmission name="joint_blw_trans" type="pr2_mechanism_model/SimpleTransmission">
     <actuator name="joint_blw_motor" />
     <joint name="joint_back_left_wheel" />
     <mechanicalReduction>1</mechanicalReduction>
     <motorTorqueConstant>200</motorTorqueConstant>
  </transmission>
</robot>

I want to simulate this robot with gazebo using a launch file (prueba.launch):

<?xml version="1.0"?>
<launch>

  <!-- start gazebo with an simple world -->
<arg name="world" default="empty.world"/>
<node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/$(arg world)" respawn="false" output="screen"/>

 <!-- start controller manager -->
<include file="$(find pr2_controller_manager)/controller_manager.launch"/>

  <!-- spawn a robot -->
  <param name="robot_description" textfile="$(find gazebo_worlds)/objects/caja.urdf" />
  <node name="spawn_object" pkg="gazebo" type="spawn_model" args="-urdf -param robot_description -x 0.0 -y 0.0 -z 0.5 -model caja" respawn="false" output="screen" />


  <!-- start gui -->
  <arg name="gui" default="true"/>
  <group if="$(arg gui)">
    <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>
  </group>


  <!-- GUARDIAN CONTROLLER -->
<rosparam file="$(find guardian_controller)/guardian_controller.yaml" command="load"/>

<param name="pr2_controller_manager/joint_state_publish_rate" value="100.0" />

   <node name="guardian_controller" pkg="pr2_controller_manager" type="spawner" args="guardian_controller" respawn="false" output="screen"/> 

</launch>

Using this code when I launch prueba.launc, the robot is represented in gazebo with no problem.

The problem arises when I try to use a controller for my robot in simulation. For this puropose a pr2-simulator plugin is added in the urdf file in this way:

<gazebo>
<plugin name="gazebo_ros_controller_manager" filename="libgazebo_ros_controller_manager.so">
</plugin>
</gazebo>

Then terminal shows a problem with the controller and the gazebo simulator does not load neither the empty world and the robot model:

started roslaunch server http://ita606:57995/

SUMMARY
========

PARAMETERS
 * /pr2_controller_manager/joint_state_publish_rate
 * /pr2_controller_manager/mechanism_statistics_publish_rate
 * /robot_description
 * /robot_state_publisher/publish_frequency
 * /robot_state_publisher/tf_prefix
 * /rosdistro
 * /rosversion

NODES
  /
    gazebo (gazebo/gazebo)
    gazebo_gui (gazebo/gui)
    pr2_mechanism_diagnostics (pr2_mechanism_diagnostics/pr2_mechanism_diagnostics)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    spawn_object (gazebo/spawn_model)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[gazebo-1]: started with pid [13467]
process[robot_state_publisher-2]: started with pid [13473]
process[pr2_mechanism_diagnostics-3]: started with pid [13491]
process[spawn_object-4]: started with pid [13511]
process[gazebo_gui-5]: started with pid [13512]
[robot_state_publisher-2] process has died [pid 13473, exit code -11, cmd /opt/ros/groovy/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/tseco/.ros/log/7fd804d0-1173-11e3-9efd-3cd92b6f7a37/robot_state_publisher-2.log].
log file: /home/tseco/.ros/log/7fd804d0-1173-11e3-9efd-3cd92b6f7a37/robot_state_publisher-2*.log
Gazebo multi-robot simulator, version 1.5.0
Copyright (C) 2013 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

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

Warning [parser.cc:361] Converting a deprecated SDF source[/opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/worlds/empty.world].
Set SDF value
  Version[1.2] to Version[1.3]
  Please use the gzsdf tool to update your SDF files.
    $ gzsdf convert [sdf_file]
Msg Waiting for master
[ INFO] [1378200772.159484512]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 193.144.225.131
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 193.144.225.131
loading model xml from ros parameter
[INFO] [WallTime: 1378200772.218070] [0.000000] waiting for service /gazebo/spawn_urdf_model
Error [Events.hh:141] Events::ConnectWorldUpdateStart is deprecated in v 1.5.0. Please use Events::ConnectWorldUpdateBegin
Error [Events.hh:141] Events::ConnectWorldUpdateStart is deprecated in v 1.5.0. Please use Events::ConnectWorldUpdateBegin
Error [Events.hh:141] Events::ConnectWorldUpdateStart is deprecated in v 1.5.0. Please use Events::ConnectWorldUpdateBegin
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No existe el archivo o el directorio
QFileSystemWatcher: failed to add paths: /home/tseco/.gazebo/models
[ INFO] [1378200773.257542440]: joint trajectory plugin missing <updateRate>, defaults to 0.0 (as fast as possible)
Error [Events.hh:141] Events::ConnectWorldUpdateStart is deprecated in v 1.5.0. Please use Events::ConnectWorldUpdateBegin
Warning [parser.cc:377] SDF has no <sdf> element in file[data-string]
Dbg extension [<plugin name="gazebo_ros_controller_manager" filename="libgazebo_ros_controller_manager.so" />] not converted.
Dbg [base] has no parent joint
Warning [parser.cc:314] parse from urdf.
spawn status:  SpawnModel: successfully spawned model
Error [Events.hh:141] Events::ConnectWorldUpdateStart is deprecated in v 1.5.0. Please use Events::ConnectWorldUpdateBegin
Dbg plugin model name: caja
[ INFO] [1378200773.335260535, 0.001000000]: starting gazebo_ros_controller_manager plugin in ns: 
[ INFO] [1378200773.335519555, 0.001000000]: Callback thread id=0x7fd45812dfc0
[spawn_object-4] process has finished cleanly
log file: /home/tseco/.ros/log/7fd804d0-1173-11e3-9efd-3cd92b6f7a37/spawn_object-4*.log
Segmentation fault (core dumped)
[gazebo-1] process has died [pid 13467, exit code 139, cmd /opt/ros/groovy/stacks/simulator_gazebo/gazebo/scripts/gazebo /opt/ros/groovy/stacks/simulator_gazebo/gazebo_worlds/worlds/empty.world __name:=gazebo __log:=/home/tseco/.ros/log/7fd804d0-1173-11e3-9efd-3cd92b6f7a37/gazebo-1.log].
log file: /home/tseco/.ros/log/7fd804d0-1173-11e3-9efd-3cd92b6f7a37/gazebo-1*.log

Any suggestions?

Thanks in advance.

Asked by tseco on 2013-09-03 04:36:47 UTC

Comments

Answers

Can you post a backtrace from your segfault?

I'd also recommend upgrading to Gazebo 1.9 and ROS hydro. There is much better Gazebo + ros integration now: http://gazebosim.org/wiki/Tutorials#ROS_Integration

Asked by nkoenig on 2013-09-15 18:33:52 UTC

Comments