Error when setting up Stretch simulation on Gazebo

First I want to say thanks for releasing simulation support for Stretch! I was trying to set it up, but have run into an error.

For some background, I have Gazebo 11 installed, and am running ROS Melodic. Gazebo seems to work fine. I followed the stretch_gazebo installation/setup instructions from the GitHub. I am running the simulation on my laptop, not on the Stretch.

When I run roslaunch stretch_gazebo gazebo.launch rviz:=true, there is a lot of text output (full text at end), but eventually an error:
[ERROR] [1624052991.338308953, 0.184000000]: GetModelState: model [robot] does not exist

When I run roslaunch stretch_gazebo teleop_joy.launch, it results in the following error:
ERROR: cannot launch node of type [joy/joy_node]: joy
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/hcilab/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ERROR: cannot launch node of type [teleop_twist_joy/teleop_node]: teleop_twist_joy
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/hcilab/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share

I was wondering if there is some file I need to copy over from the robot, or if you had any other ideas on how to solve it?

Thanks!!

Full output from roslaunch stretch_gazebo gazebo.launch rviz:=true:
… logging to /home/hcilab/.ros/log/1a31f266-d07f-11eb-a65e-d0577b4196c8/roslaunch-hcilab-HP-Pavilion-23706.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://10.134.71.251:38575/

SUMMARY

PARAMETERS

  • /gazebo/enable_ros_network: True
  • /robot_description: <?xml version="1…
  • /robot_state_publisher/publish_frequency: 30.0
  • /rosdistro: melodic
  • /rosversion: 1.14.10
  • /stretch_arm_controller/allow_partial_joints_goal: True
  • /stretch_arm_controller/constraints/action_monitor_rate: 10
  • /stretch_arm_controller/constraints/goal_time: 0.6
  • /stretch_arm_controller/constraints/joint_arm_l0/goal: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l0/trajectory: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l1/goal: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l1/trajectory: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l2/goal: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l2/trajectory: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l3/goal: 0.1
  • /stretch_arm_controller/constraints/joint_arm_l3/trajectory: 0.1
  • /stretch_arm_controller/constraints/joint_lift/goal: 0.1
  • /stretch_arm_controller/constraints/joint_lift/trajectory: 0.1
  • /stretch_arm_controller/constraints/joint_wrist_yaw/goal: 0.1
  • /stretch_arm_controller/constraints/joint_wrist_yaw/trajectory: 0.1
  • /stretch_arm_controller/constraints/state_publish_rate: 25
  • /stretch_arm_controller/constraints/stop_trajectory_duration: 0.5
  • /stretch_arm_controller/constraints/stopped_velocity_tolerance: 0.05
  • /stretch_arm_controller/joints: [‘joint_lift’, 'j…
  • /stretch_arm_controller/type: position_controll…
  • /stretch_diff_drive_controller/angular/z/has_acceleration_limits: True
  • /stretch_diff_drive_controller/angular/z/has_velocity_limits: True
  • /stretch_diff_drive_controller/angular/z/max_acceleration: 6.0
  • /stretch_diff_drive_controller/angular/z/max_velocity: 2.0
  • /stretch_diff_drive_controller/base_frame_id: base_link
  • /stretch_diff_drive_controller/left_wheel: [‘joint_left_wheel’]
  • /stretch_diff_drive_controller/linear/x/has_acceleration_limits: True
  • /stretch_diff_drive_controller/linear/x/has_velocity_limits: True
  • /stretch_diff_drive_controller/linear/x/max_acceleration: 1.0
  • /stretch_diff_drive_controller/linear/x/max_velocity: 0.5
  • /stretch_diff_drive_controller/pose_covariance_diagonal: [0.001, 0.001, 0…
  • /stretch_diff_drive_controller/publish_rate: 50
  • /stretch_diff_drive_controller/right_wheel: ['joint_right_whe…
  • /stretch_diff_drive_controller/twist_covariance_diagonal: [0.001, 0.001, 0…
  • /stretch_diff_drive_controller/type: diff_drive_contro…
  • /stretch_diff_drive_controller/wheel_radius: 0.05
  • /stretch_diff_drive_controller/wheel_separation: 0.315
  • /stretch_gripper_controller/allow_partial_joints_goal: True
  • /stretch_gripper_controller/constraints/action_monitor_rate: 10
  • /stretch_gripper_controller/constraints/goal_time: 0.6
  • /stretch_gripper_controller/constraints/joint_gripper_finger_left/goal: 0.1
  • /stretch_gripper_controller/constraints/joint_gripper_finger_left/trajectory: 0.1
  • /stretch_gripper_controller/constraints/joint_gripper_finger_right/goal: 0.1
  • /stretch_gripper_controller/constraints/joint_gripper_finger_right/trajectory: 0.1
  • /stretch_gripper_controller/constraints/state_publish_rate: 25
  • /stretch_gripper_controller/constraints/stop_trajectory_duration: 0.5
  • /stretch_gripper_controller/constraints/stopped_velocity_tolerance: 0.05
  • /stretch_gripper_controller/joints: ['joint_gripper_f…
  • /stretch_gripper_controller/type: position_controll…
  • /stretch_head_controller/allow_partial_joints_goal: True
  • /stretch_head_controller/constraints/action_monitor_rate: 10
  • /stretch_head_controller/constraints/goal_time: 0.6
  • /stretch_head_controller/constraints/joint_head_pan/goal: 0.1
  • /stretch_head_controller/constraints/joint_head_pan/trajectory: 0.1
  • /stretch_head_controller/constraints/joint_head_tilt/goal: 0.1
  • /stretch_head_controller/constraints/joint_head_tilt/trajectory: 0.1
  • /stretch_head_controller/constraints/state_publish_rate: 25
  • /stretch_head_controller/constraints/stop_trajectory_duration: 0.5
  • /stretch_head_controller/constraints/stopped_velocity_tolerance: 0.05
  • /stretch_head_controller/joints: [‘joint_head_pan’…
  • /stretch_head_controller/type: position_controll…
  • /stretch_joint_state_controller/publish_rate: 50
  • /stretch_joint_state_controller/type: joint_state_contr…
  • /use_sim_time: True

NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
publish_ground_truth_odom (stretch_gazebo/publish_ground_truth_odom.py)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
rviz (rviz/rviz)
stretch_controller_spawner (controller_manager/spawner)
urdf_spawner (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [23719]
ROS_MASTER_URI=http://10.134.71.251:11311

setting /run_id to 1a31f266-d07f-11eb-a65e-d0577b4196c8
process[rosout-1]: started with pid [23730]
started core service [/rosout]
process[gazebo-2]: started with pid [23736]
process[gazebo_gui-3]: started with pid [23742]
process[urdf_spawner-4]: started with pid [23747]
process[robot_state_publisher-5]: started with pid [23748]
process[rviz-6]: started with pid [23749]
process[stretch_controller_spawner-7]: started with pid [23750]
process[publish_ground_truth_odom-8]: started with pid [23751]
[ WARN] [1624052989.334175983]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
Gazebo multi-robot simulator, version 11.6.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Wrn] [GuiIface.cc:200] g/gui-plugin is really loading a SystemPlugin. To load a GUI plugin please use --gui-client-plugin
Gazebo multi-robot simulator, version 11.6.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[ INFO] [1624052990.132379183]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1624052990.134767420]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting…
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.134.71.251
[ INFO] [1624052990.324984826]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1624052990.326584208]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting…
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.134.71.251
[INFO] [1624052990.404672, 0.000000]: Loading model XML from ros parameter robot_description
[INFO] [1624052990.436098, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[Msg] Loading world file [/usr/share/gazebo-11/worlds/empty.world]
[ INFO] [1624052991.145260993]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1624052991.169385193, 0.020000000]: Physics dynamic reconfigure ready.
[ERROR] [1624052991.338308953, 0.184000000]: GetModelState: model [robot] does not exist
[INFO] [1624052991.342108, 0.187000]: Calling service /gazebo/spawn_urdf_model
[ INFO] [1624052991.756463276, 0.356000000]: set to: 0
[ INFO] [1624052991.756533694, 0.356000000]: set to: //
[ INFO] [1624052991.756562656, 0.356000000]: set to: //imu/data
[ INFO] [1624052991.756584952, 0.356000000]: set to: base_link
[ INFO] [1624052991.756623050, 0.356000000]: set to: 25
[ INFO] [1624052991.756648872, 0.356000000]: set to: 0.001
[ INFO] [1624052991.756684303, 0.356000000]: set to: 0 0 0
[ INFO] [1624052991.756748119, 0.356000000]: set to: 0 -0 0
[ INFO] [1624052991.985987860, 0.356000000]: Laser Plugin: Using the ‘robotNamespace’ param: ‘/’
[ INFO] [1624052991.986054966, 0.356000000]: Starting GazeboRosLaser Plugin (ns = /)
[ INFO] [1624052991.991643027, 0.356000000]: GPU Laser Plugin (ns = /) <tf_prefix_>, set to “”
[ INFO] [1624052991.992610624, 0.356000000]: LoadThread function completed
[ INFO] [1624052991.994848667, 0.356000000]: set to: 0
[ INFO] [1624052991.994921077, 0.356000000]: set to: //
[ INFO] [1624052991.994959935, 0.356000000]: set to: //realsense/imu/data
[ INFO] [1624052991.994987446, 0.356000000]: set to: camera_gyro_frame
[ INFO] [1624052991.995019149, 0.356000000]: set to: 50
[ INFO] [1624052991.995051266, 0.356000000]: set to: 0.001
[ INFO] [1624052991.995088867, 0.356000000]: set to: 0 0 0
[ INFO] [1624052991.995123939, 0.356000000]: set to: 0 -0 0
[ INFO] [1624052992.012926963, 0.356000000]: set to: 0
[ INFO] [1624052992.012978756, 0.356000000]: set to: //
[ INFO] [1624052992.013006449, 0.356000000]: set to: //wrist_imu/data
[ INFO] [1624052992.013030683, 0.356000000]: set to: link_wrist_yaw
[ INFO] [1624052992.013061621, 0.356000000]: set to: 25
[ INFO] [1624052992.013092763, 0.356000000]: set to: 0.001
[ INFO] [1624052992.013124927, 0.356000000]: set to: 0 0 0
[ INFO] [1624052992.013156273, 0.356000000]: set to: 0 -0 0
[INFO] [1624052992.022671, 0.356000]: Spawn status: SpawnModel: Successfully spawned entity
[urdf_spawner-4] process has finished cleanly
log file: /home/hcilab/.ros/log/1a31f266-d07f-11eb-a65e-d0577b4196c8/urdf_spawner-4*.log
[ INFO] [1624052993.405040038, 0.356000000]: Loading gazebo_ros_control plugin
[ INFO] [1624052993.405173509, 0.356000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1624052993.406018868, 0.356000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ERROR] [1624052993.529566328, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_right_wheel
[ERROR] [1624052993.530365407, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_left_wheel
[ERROR] [1624052993.531104215, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_lift
[ERROR] [1624052993.531882757, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_arm_l0
[ERROR] [1624052993.532639001, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_arm_l1
[ERROR] [1624052993.533419976, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_arm_l2
[ERROR] [1624052993.534131198, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_arm_l3
[ERROR] [1624052993.534882172, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_wrist_yaw
[ERROR] [1624052993.535583954, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_head_pan
[ERROR] [1624052993.536299604, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_head_tilt
[ERROR] [1624052993.537004609, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_gripper_finger_left
[ERROR] [1624052993.537689328, 0.356000000]: No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/joint_gripper_finger_right
[ INFO] [1624052993.541483431, 0.356000000]: Loaded gazebo_ros_control.
[ INFO] [1624052993.558406457, 0.356000000]: Realsense Gazebo ROS plugin loading.

RealSensePlugin: The realsense_camera plugin is attach to model robot
[ERROR] [1624052993.668150007, 0.390000000]: Could not load controller ‘stretch_joint_state_controller’ because controller type ‘joint_state_controller/JointStateController’ does not exist.
[ERROR] [1624052993.668210324, 0.390000000]: Use ‘rosservice call controller_manager/list_controller_types’ to get the available types
[ERROR] [1624052994.669199, 0.753000]: Failed to load stretch_joint_state_controller
[ERROR] [1624052994.673825215, 0.755000000]: Could not load controller ‘stretch_diff_drive_controller’ because controller type ‘diff_drive_controller/DiffDriveController’ does not exist.
[ERROR] [1624052994.673878564, 0.755000000]: Use ‘rosservice call controller_manager/list_controller_types’ to get the available types
[ERROR] [1624052995.675029, 1.129000]: Failed to load stretch_diff_drive_controller
[ERROR] [1624052995.679247011, 1.131000000]: Could not load controller ‘stretch_arm_controller’ because controller type ‘position_controllers/JointTrajectoryController’ does not exist.
[ERROR] [1624052995.679294957, 1.131000000]: Use ‘rosservice call controller_manager/list_controller_types’ to get the available types
[ERROR] [1624052996.680165, 1.540000]: Failed to load stretch_arm_controller
[ERROR] [1624052996.684071243, 1.541000000]: Could not load controller ‘stretch_head_controller’ because controller type ‘position_controllers/JointTrajectoryController’ does not exist.
[ERROR] [1624052996.684111195, 1.541000000]: Use ‘rosservice call controller_manager/list_controller_types’ to get the available types
[ERROR] [1624052997.685386, 1.931000]: Failed to load stretch_head_controller
[ERROR] [1624052997.689851462, 1.932000000]: Could not load controller ‘stretch_gripper_controller’ because controller type ‘position_controllers/JointTrajectoryController’ does not exist.
[ERROR] [1624052997.689895549, 1.932000000]: Use ‘rosservice call controller_manager/list_controller_types’ to get the available types
[ERROR] [1624052998.691185, 2.317000]: Failed to load stretch_gripper_controller
^C[publish_ground_truth_odom-8] killing on exit
[stretch_controller_spawner-7] killing on exit
[rviz-6] killing on exit
[robot_state_publisher-5] killing on exit
[gazebo_gui-3] killing on exit
[gazebo-2] killing on exit
[Wrn] [Publisher.cc:136] Queue limit reached for topic /gazebo/default/pose/local/info, deleting message. This warning is printed only once.
Traceback (most recent call last):
File “/home/hcilab/catkin_ws/src/stretch_ros/stretch_gazebo/scripts/publish_ground_truth_odom.py”, line 29, in
r.sleep()
File “/opt/ros/melodic/lib/python2.7/dist-packages/rospy/timer.py”, line 103, in sleep
sleep(self._remaining(curr_time))
File “/opt/ros/melodic/lib/python2.7/dist-packages/rospy/timer.py”, line 165, in sleep
raise rospy.exceptions.ROSInterruptException(“ROS shutdown request”)
rospy.exceptions.ROSInterruptException: ROS shutdown request
[gazebo_gui-3] escalating to SIGTERM
[gazebo-2] escalating to SIGTERM
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor…
… shutting down processing monitor complete
done

Full output from roslaunch stretch_gazebo teleop_joy.launch:
… logging to /home/hcilab/.ros/log/1a31f266-d07f-11eb-a65e-d0577b4196c8/roslaunch-hcilab-HP-Pavilion-24590.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://10.134.71.251:34283/

SUMMARY

PARAMETERS

  • /joy/autorepeat_rate: 20
  • /joy/dev: /dev/input/js0
  • /rosdistro: melodic
  • /rosversion: 1.14.10

NODES
/
joy (joy/joy_node)
teleop_twist_joy (teleop_twist_joy/teleop_node)

ROS_MASTER_URI=http://10.134.71.251:11311

ERROR: cannot launch node of type [joy/joy_node]: joy
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/hcilab/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ERROR: cannot launch node of type [teleop_twist_joy/teleop_node]: teleop_twist_joy
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/hcilab/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
No processes to monitor
shutting down processing monitor…
… shutting down processing monitor complete

Hi @lstegner, try installing the following two packages:

$ sudo apt install ros-melodic-joint-trajectory-controller
$ sudo apt install ros-melodic-diff-drive-controller

On my laptop, installing these two packages resolves the Could not load controller ... errors. Resolving those errors is enough to try out the MoveIt demo and send velocity commands to the simulated mobile base. These dependencies are already installed on the robot, but since they are missing from Stretch Gazebo’s package.xml, they aren’t installed by rosdep to our laptops. I’ll update the package.xml shortly.

I am still investigating the GetModelState: model [robot] does not exist error, however, it doesn’t seem affect the simulation. Let me know if you see any errors related to this issue.

1 Like

Hey @lstegner, sorry for the late response.

We are probably missing a few dependencies in package xmls. I didn’t notice them because those packages were already installed in my system before. I’ll open a new PR to update these dependencies. Until it is ready and merged you can apt install teleop_twist_joy package via:

sudo apt-get install ros-melodic-teleop-twist-joy

For control errors doing what @bshah said above would be enough.

GetModelState stems from the ground_turth_odom_publisher as gazebo is probably opening up slower than this script and it is unable to find the robot for a second. I’ll send a fix for this as well soon, but this shouldn’t affect any functionality.

1 Like

Update: PRs are in for Melodic and Noetic [melodic] Gazebo Dependency and GetModel Fixes by vatanaksoytezer ¡ Pull Request #26 ¡ hello-robot/stretch_ros ¡ GitHub and [noetic] Gazebo Dependency Fixes by vatanaksoytezer ¡ Pull Request #27 ¡ hello-robot/stretch_ros ¡ GitHub

2 Likes

Thank you @bshah and @tezer! Things are working fine now :slightly_smiling_face:
Since implementing those other fixes, the GetModelState: model [robot] does not exist error has also gone away.

2 Likes