Newbie question: I see my MoveIt! code working in RVIZ, but not Gazebo

asked 2020-03-23 15:21:18 -0500

not-bob gravatar image

updated 2020-03-23 16:22:55 -0500

I’m using code provided by Interbotix for their robots and have managed to get MoveIt! instructions to show in RVIZ. I’ve also built out an environment in Gazebo that contains the objects I want to interact with. My problem is that I don’t know enough about ROS to have Gazebo simulate the movements I want.

I started with the launch file, but it took me down a rabbit hole I couldn’t decipher, lots of sub-launch files calling other launch files…

I also ran the ‘roswtf’ utility and ‘rosnode list’ command and got the output below.

I suspect that what I’m seeing is that gazebo is not talking to my px150. But I’m at a loss for understanding how to unwind the launch files to make the necessary updates.

If anyone has some input on what documentation I need to understand to get this working, I would greatly apprecite it. Additionally, If there is something painfully obvious that I can do, please let me know that as well.

Thanks, :) Robert

==================

Version information

  • OS: Ubuntu 18.04.4 LTS
  • ROS: melodic
  • environment variables

ROS_ETC_DIR=/opt/ros/melodic/etc/ros

ROS_ROOT=/opt/ros/melodic/share/ros

ROS_MASTER_URI=http://localhost:11311

ROS_VERSION=1

ROS_PYTHON_VERSION=2

ROS_PACKAGE_PATH=/usr/local/code/qa-lab-test-auto/prototypes/arm_demo:/usr/local/code/qa-lab-test-auto/prototypes//arm_demo/src:/usr/local/code/qa-lab-test-auto/prototypes//arm_demo/src:/opt/ros/melodic/share

ROSLISP_PACKAGE_DIRECTORIES=/usr/local/code/qa-lab-test-auto/prototypes/arm_demo/devel/share/common-lisp:/usr/local/code/qa-lab-test-auto/prototypes//arm_demo/devel/share/common-lisp

ROS_DISTRO=melodic

==================

roswtf output

Loaded plugin tf.tfwtf
No package or stack in the current directory
================================================================================
Static checks summary:

No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take a while...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /px150_sonic_pays/move_group:
   * /tf
   * /tf_static
   * /px150_sonic_pays/collision_object
 * /px150_sonic_pays/moveit_interface_node:
   * /tf
   * /tf_static

 * /px150_sonic_pays/rviz_rwatkins_Dell_System_Inspiron_N7110_8069_6342640483161026941:
   * /tf
   * /tf_static
   * /px150_sonic_pays/recognized_object_array
 * /gazebo:
   * /gazebo/set_link_state
   * /gazebo/set_model_state

WARNING These nodes have died:
 * px150_sonic_pays/urdf_spawner-5
 * px150_sonic_pays/controller_spawner-4
 * px150_sonic_pays/arm_demo_sequence-10

==================

rosnode list output

/gazebo
/gazebo_gui
/px150_sonic_pays/joint_state_publisher
/px150_sonic_pays/move_group
/px150_sonic_pays/moveit_interface_node
/px150_sonic_pays/rviz_rwatkins_Dell_System_Inspiron_N7110_8069_6342640483161026941
/rosout

==================

launch file

<launch>
  <arg name="world_file" default="/usr/local/code/qa-lab-test-auto/prototypes/arm_demo/src/interbotix_moveit/worlds/pays.world"/>
  <arg name="robot_name"                  default=""/>
  <arg name="dof"                         default="5"/>
  <arg name="use_fake"                    default="false"/>
  <arg name="use_gazebo"                  default="false"/>
  <arg name="use_actual"                  default="false"/>
  <arg name="arm_operating_mode"          default="velocity"/>
  <arg name="use_cpp_interface"           default="false"/>
  <arg name="arm_demo_sequence"           default="true"/>
  <arg name="use_python_interface"        default="false"/>
  <arg name="use_pid_cntlrs"              default="false"/>

  <include file="$(find interbotix_moveit)/launch/interbotix_moveit.launch">
    <arg name="robot_name"                value="$(arg robot_name)"/>
    <arg name="dof"                       value="$(arg dof)"/>
    <arg name="use_fake"                  value="$(arg use_fake)"/>
    <arg name="use_gazebo"                value="$(arg use_gazebo)"/>
    <arg name="use_actual"                value="$(arg use_actual)"/>
    <arg name="arm_operating_mode"        value="$(arg arm_operating_mode)"/>
    <arg name ...
(more)
edit retag flag offensive close merge delete

Comments

Hi @not-bob,

Did the controllers launch correctly? interbotix_moveit.launch is launching gazebo.launch that is launching the proper controllers for the robot, however I do not see anything on your output that tells the controllers were load with no errors. Besides, it seems to me a bit weird the fact of using only the Joint State Publisher, since I think with Gazebo you really need the Robot State Publisher to allow Gazebo and ROS control to read from joint states.

Maybe this tutorial helps you in that endeavour.

Weasfas gravatar image Weasfas  ( 2020-03-24 07:41:07 -0500 )edit

Thanks @Weasfas ! I'll check out the tutorial and then the 'robot state publisher' link.

not-bob gravatar image not-bob  ( 2020-03-24 15:12:54 -0500 )edit

Hi @not-bob,

As @Weasfas said, the interbotix_moveit.launch file calls the gazebo.launch file which is responsible for launching the proper controllers (specifically of type effort_controllers/JointTrajectoryController) and publishing to the joint_states topic. The gazebo.launch file then calls the description.launch file (part of the interbotix_descriptions package) which launches the robot_state_publisher node.

If you want to incorporate a different world in Gazebo instead of the default 'empty_world.launch' file, you will have to modify the gazebo.launch file. However, assuming you are working with MoveIt, the arm should move in Gazebo from a direct command (like 'go' or 'execute') using the MoveIt Commander API, MoveIt Cpp interface, or the moveit_interface_node.

swiz23 gravatar image swiz23  ( 2020-03-26 18:46:49 -0500 )edit

Thanks @swiz23 for the additional details. I was able to successfully update the world file in Gazebo to incorporate the models of items I want the robot to interact with. Now, I just need to get to get through that tutorial and apply that learning to this robot.

not-bob gravatar image not-bob  ( 2020-03-29 22:25:49 -0500 )edit

@not-bob,

No prob! I took a look at the tutorial that was suggested by @Weasfas, and it's pretty informative. Truth is though that almost all of it is already incorporated for the px150 robot (along with the other 9 robotic arms offered by Trossen Robotics). You can see the files referenced there at https://github.com/Interbotix/interbo... (specfically the launch and config directories). However, you might have to make some manual edits if you don't want to use the JointTrajectoryControl ros control method or if you have an additional sensor (camera or otherwise) that you want to simulate.

swiz23 gravatar image swiz23  ( 2020-03-29 22:41:02 -0500 )edit