Why can't I set_model_state for the erratic robot? [closed]
When I use rosservice call /gazebo/set_model_state for erratic robots in gazebo, they will move to that position if the simulation is paused, but once it is started they snap back to their original position. This service call works with other robots (i.e. clearpath husky, guardian robotnik). I have also tried changing the environment variable ROBOT_INITIAL_POSE and editing the launch files to have the robots spawn in different places. Here is the launch file I have been using specifically:
<launch>
<group ns="robot1">
<param name="tf_prefix" value="robot1"/>
<!-- send the erratic robot XML to param server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_description)/urdf/erratic_laser.urdf.xacro'" />
<!-- push robot_description to factory and spawn robot in gazebo -->
<node name="spawn_robot1" pkg="gazebo" type="spawn_model"
args="-param robot_description
-urdf
-x 0.5
-y -0.5
-z 0.03
-model robot1"
respawn="false" output="screen" />
<!-- start robot state publisher -->
<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher1" output="screen" >
<param name="publish_frequency" type="double" value="50.0" />
</node>
</group>
<group ns="robot2">
<param name="tf_prefix" value="robot2"/>
<!-- send the erratic robot XML to param server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_description)/urdf/erratic.urdf.xacro'" />
<!-- push robot_description to factory and spawn robot in gazebo -->
<node name="spawn_robot2" pkg="gazebo" type="spawn_model"
args="-param robot_description
-urdf
-x -0.5
-y -0.5
-z 0.03
-model robot2"
respawn="false" output="screen" />
<!-- start robot state publisher -->
<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher2" output="screen" >
<param name="publish_frequency" type="double" value="50.0" />
</node>
</group>
</launch>
Here is the output of the terminal running Gazebo after roslaunch erratic_description two_erratic_mobile_bases.launch is ran in another terminal:
Dbg plugin parent sensor name: robot2
Dbg plugin model name: robot2
gzclient: /tmp/buildd/ros-fuerte-visualization-common-1.8.4/debian/ros-fuerte-visualization-common/opt/ros/fuerte/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/src/OgreNode.cpp:413: virtual void Ogre::Node::setPosition(const Ogre::Vector3&): Assertion !pos.isNaN() && "Invalid vector supplied as parameter"' failed.
/opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gui: line 2: 9615 Aborted (core dumped)
rospack find gazebo/gazebo/bin/gzclient -g
rospack find gazebo`/lib/libgazebo_ros_paths_plugin.so
[gazebo_gui-2] process has died [pid 9612, exit code 134, cmd /opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gui __name:=gazebo_gui __log:=/home/alan/.ros/log/1ded700e-70a4-11e2-8a9e-00264d8b9feb/gazebo_gui-2.log].
log file: /home/alan/.ros/log/1ded700e-70a4-11e2-8a9e-00264d8b9feb/gazebo_gui-2*.log
I am using ROS Fuerte, Gazebo version 1.0.2, and Ubuntu 12.04 (Precise). Thanks for your help!