PR2 simulation keeps glitching/jumping in RVIZ when using /odom_combined as fixed frame
Hi, I'm relatively new to ROS. I'm trying to run the PR2 robot on ROS Kinect for Ubuntu 16.04. I'm using the MoveIt stack and launching the following nodes:
roslaunch gazebo_ros empty_world.launch
roslaunch pr2_gazebo pr2.launch
roslaunch pr2_moveit_config demo.launch
Which resulted in this: https://youtu.be/OnN2UppZ3r8
The glitching starts almost immediately as the robot starts jumping up and down with its torso. I saw that the the torso link was receiving mixed messages some sent by the robot_state_publisher. I commented out the robot_state_publisher node from the demo.launch:
<launch
<arg name="db" default="false" />
<arg name="debug" default="false" />
<include file="$(find pr2_moveit_config)/launch/planning_context.launch">
<arg name="load_robot_description" value="true"/>
</include>
<node pkg="tf" type="static_transform_publisher" name="virtual_joint_broadcaster_0" args="0 0 0 0 0 0 odom_combined base_footprint 100" />
<!-- <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="/use_gui" value="false"/>
<rosparam param="/source_list">[/move_group/fake_controller_joint_states]</rosparam>
</node>
-->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" />
<include file="$(find pr2_moveit_config)/launch/move_group.launch">
<arg name="allow_trajectory_execution" value="true"/>
<arg name="fake_execution" value="true"/>
<arg name="info" value="true"/>
<arg name="debug" value="$(arg debug)"/>
</include>
<include file="$(find pr2_moveit_config)/launch/moveit_rviz.launch">
<arg name="config" value="true"/>
<arg name="debug" value="$(arg debug)"/>
</include>
<include file="$(find pr2_moveit_config)/launch/default_warehouse_db.launch" if="$(arg db)"/>
</launch>
which stopped the torso jumping but would still glitch when I moved the base forward: https://youtu.be/k5mpx9RLZTw
The glitching stops when I change the global fixed frame to /base_link but then the octomap does not update properly as it doesn't perceive the robot as moving. The octomap did however work when using /odom_combined.
Any advice on how to approach this issue and for any more information needed to understand the problem please ask and I will happily provide it. Thank you
can you clarify why you start all three of those launch files?
I'm trying to create a teleoperation system for the pr2. I'm launching
1) a custom world I made (I edited it to the empty_world.launch file since I get the same behavior there as well)
2) the pr2 node to initialize the pr2 and place it in the world
3) the moveit node for the pr2 so that I can
control the pr2 arms from within RVIZ using the interactive markers. I also want the octomap to work so that the robot can map out the environment because later I will need that input later for an AI application
Just to clarify: you're starting launch files, which will start multiple nodes. If any of those launch files start the same nodes, especially things that publish
JointState
msgs or TF frames, the "glitching" that you describe can happen.It's not actually glitching, the visualisation ..
.. is just provided with conflicting information (from the human point of view, that is) and visualises what it receives.
Hence my question: how did you come up with that set of launch files.
I followed http://wiki.ros.org/pr2_simulator/Tut... for the first 2 nodes and I followed http://docs.ros.org/indigo/api/moveit... for the 3rd node
I guess I kind of assumed they would work together. When I launched just the empty world and pr2_moveit_config without pr2.launch it doesn't insert the pr2 into gazebo. Is there any way I can figure out how to allow these nodes to run without conflicting each other?