Interbotix / interbotix_ros_rovers

ROS Packages for Interbotix Rovers
BSD 3-Clause "New" or "Revised" License
31 stars 31 forks source link

[Bug]: Can't launch Gazebo simulation #17

Closed Dorteel closed 2 years ago

Dorteel commented 2 years ago

What happened?

Trying to follow the tutorials, but when loading gazebo with the command: roslaunch interbotix_xslocobot_gazebo xslocobot_gazebo.launch robot_model:=locobot_wx250s show_lidar:=true use_position_controllers:=true dof:=6 I get an error as the controller_spawner doesn't have a unique name.

Tried changing the name of the trajectory controller node to something else, but then the arm of the robot wouldn't load.

Do you have any suggestions?

Robot Model

locobot_wx250s

Operating System

Ubuntu 20.04

Steps To Reproduce

roslaunch interbotix_xslocobot_gazebo xslocobot_gazebo.launch robot_model:=locobot_wx250s show_lidar:=true use_position_controllers:=true dof:=6

Relevant log output

(base) user@dorteel:~$ roslaunch interbotix_xslocobot_gazebo xslocobot_gazebo.launch robot_model:=locobot_wx250s show_lidar:=true use_position_controllers:=true dof:=6
... logging to /home/user/.ros/log/8d0bf2d6-dc05-11ec-8729-61df804d5638/roslaunch-dorteel-18852.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.

RLException: roslaunch file contains multiple nodes named [/locobot/controller_spawner].
Please check all <node> 'name' attributes to make sure they are unique.
Also check that $(anon id) use different ids.
The traceback for the exception was written to the log file

Anything Else

Here is the output when the controller name is changed:

(base) user@dorteel:~$ roslaunch interbotix_xslocobot_gazebo xslocobot_gazebo.launch robot_model:=locobot_wx250s show_lidar:=true use_position_controllers:=true dof:=6
... logging to /home/user/.ros/log/8d0bf2d6-dc05-11ec-8729-61df804d5638/roslaunch-dorteel-19712.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.15.3.55:37123/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /locobot/arm_controller/constraints/elbow/goal: 0.2
 * /locobot/arm_controller/constraints/elbow/trajectory: 0.2
 * /locobot/arm_controller/constraints/forearm_roll/goal: 0.2
 * /locobot/arm_controller/constraints/forearm_roll/trajectory: 0.2
 * /locobot/arm_controller/constraints/goal_time: 0.2
 * /locobot/arm_controller/constraints/shoulder/goal: 0.2
 * /locobot/arm_controller/constraints/shoulder/trajectory: 0.2
 * /locobot/arm_controller/constraints/waist/goal: 0.2
 * /locobot/arm_controller/constraints/waist/trajectory: 0.2
 * /locobot/arm_controller/constraints/wrist_angle/goal: 0.2
 * /locobot/arm_controller/constraints/wrist_angle/trajectory: 0.2
 * /locobot/arm_controller/constraints/wrist_rotate/goal: 0.2
 * /locobot/arm_controller/constraints/wrist_rotate/trajectory: 0.2
 * /locobot/arm_controller/gains/elbow/d: 1.0
 * /locobot/arm_controller/gains/elbow/i: 10.0
 * /locobot/arm_controller/gains/elbow/p: 300.0
 * /locobot/arm_controller/gains/forearm_roll/d: 0
 * /locobot/arm_controller/gains/forearm_roll/i: 0
 * /locobot/arm_controller/gains/forearm_roll/p: 5.0
 * /locobot/arm_controller/gains/shoulder/d: 1.0
 * /locobot/arm_controller/gains/shoulder/i: 10.0
 * /locobot/arm_controller/gains/shoulder/p: 500.0
 * /locobot/arm_controller/gains/waist/d: 1.0
 * /locobot/arm_controller/gains/waist/i: 5.0
 * /locobot/arm_controller/gains/waist/p: 100.0
 * /locobot/arm_controller/gains/wrist_angle/d: 1.0
 * /locobot/arm_controller/gains/wrist_angle/i: 3.0
 * /locobot/arm_controller/gains/wrist_angle/p: 100.0
 * /locobot/arm_controller/gains/wrist_rotate/d: 0.1
 * /locobot/arm_controller/gains/wrist_rotate/i: 1.0
 * /locobot/arm_controller/gains/wrist_rotate/p: 100.0
 * /locobot/arm_controller/joints: ['waist', 'should...
 * /locobot/arm_controller/type: effort_controller...
 * /locobot/elbow_controller/joint: elbow
 * /locobot/elbow_controller/pid/d: 0.0
 * /locobot/elbow_controller/pid/i: 0.0
 * /locobot/elbow_controller/pid/p: 300.0
 * /locobot/elbow_controller/type: effort_controller...
 * /locobot/forearm_roll_controller/joint: forearm_roll
 * /locobot/forearm_roll_controller/pid/d: 0.0
 * /locobot/forearm_roll_controller/pid/i: 0.0
 * /locobot/forearm_roll_controller/pid/p: 50.0
 * /locobot/forearm_roll_controller/type: effort_controller...
 * /locobot/gripper_controller/gains/left_finger/d: 1.0
 * /locobot/gripper_controller/gains/left_finger/i: 0.0
 * /locobot/gripper_controller/gains/left_finger/p: 100.0
 * /locobot/gripper_controller/gains/right_finger/d: 1.0
 * /locobot/gripper_controller/gains/right_finger/i: 0.0
 * /locobot/gripper_controller/gains/right_finger/p: 100.0
 * /locobot/gripper_controller/joints: ['left_finger', '...
 * /locobot/gripper_controller/type: effort_controller...
 * /locobot/joint_state_controller/publish_rate: 100
 * /locobot/joint_state_controller/type: joint_state_contr...
 * /locobot/left_finger_controller/joint: left_finger
 * /locobot/left_finger_controller/pid/d: 5.0
 * /locobot/left_finger_controller/pid/i: 0.0
 * /locobot/left_finger_controller/pid/p: 50
 * /locobot/left_finger_controller/type: effort_controller...
 * /locobot/pan_controller/joint: pan
 * /locobot/pan_controller/pid/d: 0.1
 * /locobot/pan_controller/pid/i: 1.0
 * /locobot/pan_controller/pid/p: 30.0
 * /locobot/pan_controller/type: effort_controller...
 * /locobot/right_finger_controller/joint: right_finger
 * /locobot/right_finger_controller/pid/d: 5.0
 * /locobot/right_finger_controller/pid/i: 0.0
 * /locobot/right_finger_controller/pid/p: 50
 * /locobot/right_finger_controller/type: effort_controller...
 * /locobot/robot_description: <?xml version="1....
 * /locobot/shoulder_controller/joint: shoulder
 * /locobot/shoulder_controller/pid/d: 0.0
 * /locobot/shoulder_controller/pid/i: 0.0
 * /locobot/shoulder_controller/pid/p: 500
 * /locobot/shoulder_controller/type: effort_controller...
 * /locobot/tilt_controller/joint: tilt
 * /locobot/tilt_controller/pid/d: 0.1
 * /locobot/tilt_controller/pid/i: 1.0
 * /locobot/tilt_controller/pid/p: 30.0
 * /locobot/tilt_controller/type: effort_controller...
 * /locobot/waist_controller/joint: waist
 * /locobot/waist_controller/pid/d: 0.0
 * /locobot/waist_controller/pid/i: 0.0
 * /locobot/waist_controller/pid/p: 100
 * /locobot/waist_controller/type: effort_controller...
 * /locobot/wrist_angle_controller/joint: wrist_angle
 * /locobot/wrist_angle_controller/pid/d: 0.0
 * /locobot/wrist_angle_controller/pid/i: 0.0
 * /locobot/wrist_angle_controller/pid/p: 50.0
 * /locobot/wrist_angle_controller/type: effort_controller...
 * /locobot/wrist_rotate_controller/joint: wrist_rotate
 * /locobot/wrist_rotate_controller/pid/d: 0.0
 * /locobot/wrist_rotate_controller/pid/i: 0.0
 * /locobot/wrist_rotate_controller/pid/p: 30.0
 * /locobot/wrist_rotate_controller/type: effort_controller...
 * /rosdistro: noetic
 * /rosversion: 1.15.14
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
  /locobot/
    controller_spawner (controller_manager/controller_manager)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    trajectory_controllers_spawner (controller_manager/controller_manager)
    urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311/

process[gazebo-1]: started with pid [19758]
process[gazebo_gui-2]: started with pid [19762]
process[locobot/trajectory_controllers_spawner-3]: started with pid [19767]
process[locobot/controller_spawner-4]: started with pid [19769]
process[locobot/robot_state_publisher-5]: started with pid [19770]
process[locobot/urdf_spawner-6]: started with pid [19771]
[WARN] [1653469258.803111, 0.000000]: wait_for_service(/locobot/controller_manager/load_controller): failed to contact, will keep trying
[WARN] [1653469258.804255, 0.000000]: wait_for_service(/locobot/controller_manager/load_controller): failed to contact, will keep trying
[INFO] [1653469258.808949, 0.000000]: Loading model XML from ros parameter robot_description
[INFO] [1653469258.815890, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[WARN] [1653469258.817466, 0.000000]: wait_for_service(/gazebo/spawn_urdf_model): failed to contact, will keep trying
[ INFO] [1653469258.914673240]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1653469258.915529609]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1653469258.976724366]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1653469258.977493840]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1653469259.567949085]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1653469259.620626161]: Physics dynamic reconfigure ready.
[INFO] [1653469259.720779, 0.000000]: wait_for_service(/gazebo/spawn_urdf_model): finally were able to contact [rosrpc://10.15.3.55:56891]
[INFO] [1653469259.721584, 0.000000]: Calling service /gazebo/spawn_urdf_model
[INFO] [1653469260.137324, 0.000000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1653469260.513799563]: Camera Plugin: Using the 'robotNamespace' param: '/locobot/'
[ INFO] [1653469260.515324717]: Camera Plugin (ns = /locobot/)  <tf_prefix_>, set to ""
[ INFO] [1653469260.551556426]: Loading gazebo_ros_control plugin
[ INFO] [1653469260.551630582]: Starting gazebo_ros_control plugin in namespace: /locobot/
[ INFO] [1653469260.551846587]: gazebo_ros_control plugin is waiting for model URDF in parameter [/locobot/robot_description] on the ROS param server.
[ INFO] [1653469260.665846467]: Loaded gazebo_ros_control.
[ INFO] [1653469260.670646436]: Starting plugin DiffDrive(ns = /locobot//)
[ INFO] [1653469260.670695254]: DiffDrive(ns = /locobot//): <rosDebugLevel> = na
[ INFO] [1653469260.671042432]: DiffDrive(ns = /locobot//): <tf_prefix> = 
[ INFO] [1653469260.671551472]: DiffDrive(ns = /locobot//): Advertise joint_states
[ INFO] [1653469260.671902646]: DiffDrive(ns = /locobot//): Try to subscribe to mobile_base/commands/velocity
[ INFO] [1653469260.672706140]: DiffDrive(ns = /locobot//): Subscribe to mobile_base/commands/velocity
[ INFO] [1653469260.672888886]: DiffDrive(ns = /locobot//): Advertise odom on odom 
[locobot/urdf_spawner-6] process has finished cleanly
log file: /home/user/.ros/log/8d0bf2d6-dc05-11ec-8729-61df804d5638/locobot-urdf_spawner-6*.log
[INFO] [1653469260.909780, 0.000000]: wait_for_service(/locobot/controller_manager/load_controller): finally were able to contact [rosrpc://10.15.3.55:56891]
[INFO] [1653469260.911020, 0.000000]: wait_for_service(/locobot/controller_manager/load_controller): finally were able to contact [rosrpc://10.15.3.55:56891]
Loaded 'arm_controller'
Loaded 'joint_state_controller'
Loaded 'gripper_controller'
Loaded 'waist_controller'
Loaded 'pan_controller'
Loaded 'shoulder_controller'
Loaded 'tilt_controller'
[ERROR] [1653469261.037935207]: A controller named 'joint_state_controller' was already loaded inside the controller manager
Loaded 'elbow_controller'
Error when loading 'joint_state_controller'
Loaded 'forearm_roll_controller'

image

lukeschmitt-tr commented 2 years ago

I can't reproduce this on a fresh source install of the xslocobot packages on Noetic using your roslaunch command:

roslaunch console output ```sh ~ $ roslaunch interbotix_xslocobot_gazebo xslocobot_gazebo.launch robot_model:=locobot_wx250s show_lidar:=true use_position_controllers:=true dof:=6 ... logging to /home/interbotix/.ros/log/f53d995a-dc4a-11ec-b898-47855316a363/roslaunch-interbotix-728613.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://192.168.0.183:40927/ SUMMARY ======== PARAMETERS * /gazebo/enable_ros_network: True * /locobot/elbow_controller/joint: elbow * /locobot/elbow_controller/pid/d: 0.0 * /locobot/elbow_controller/pid/i: 0.0 * /locobot/elbow_controller/pid/p: 300.0 * /locobot/elbow_controller/type: effort_controller... * /locobot/forearm_roll_controller/joint: forearm_roll * /locobot/forearm_roll_controller/pid/d: 0.0 * /locobot/forearm_roll_controller/pid/i: 0.0 * /locobot/forearm_roll_controller/pid/p: 50.0 * /locobot/forearm_roll_controller/type: effort_controller... * /locobot/joint_state_controller/publish_rate: 100 * /locobot/joint_state_controller/type: joint_state_contr... * /locobot/left_finger_controller/joint: left_finger * /locobot/left_finger_controller/pid/d: 5.0 * /locobot/left_finger_controller/pid/i: 0.0 * /locobot/left_finger_controller/pid/p: 50 * /locobot/left_finger_controller/type: effort_controller... * /locobot/pan_controller/joint: pan * /locobot/pan_controller/pid/d: 0.1 * /locobot/pan_controller/pid/i: 1.0 * /locobot/pan_controller/pid/p: 30.0 * /locobot/pan_controller/type: effort_controller... * /locobot/right_finger_controller/joint: right_finger * /locobot/right_finger_controller/pid/d: 5.0 * /locobot/right_finger_controller/pid/i: 0.0 * /locobot/right_finger_controller/pid/p: 50 * /locobot/right_finger_controller/type: effort_controller... * /locobot/robot_description: , set to "" [INFO] [1653497506.182696, 0.000000]: Spawn status: SpawnModel: Successfully spawned entity [INFO] [1653497506.183571, 0.000000]: Waiting for service /gazebo/set_model_configuration [INFO] [1653497506.184924, 0.000000]: temporary hack to **fix** the -J joint position option (issue #93), sleeping for 1 second to avoid race condition. ../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available. [ INFO] [1653497506.510575137]: Camera Plugin: Using the 'robotNamespace' param: '/locobot/' [ INFO] [1653497506.512348619]: Camera Plugin (ns = /locobot/) , set to "" [ INFO] [1653497506.617619936]: Loading gazebo_ros_control plugin [ INFO] [1653497506.617692935]: Starting gazebo_ros_control plugin in namespace: /locobot/ [ INFO] [1653497506.618098583]: gazebo_ros_control plugin is waiting for model URDF in parameter [/locobot/robot_description] on the ROS param server. [ INFO] [1653497506.732092066]: Loaded gazebo_ros_control. [ INFO] [1653497506.737084493]: Starting plugin DiffDrive(ns = /locobot//) [ INFO] [1653497506.737135470]: DiffDrive(ns = /locobot//): = na [ INFO] [1653497506.737602178]: DiffDrive(ns = /locobot//): = [ INFO] [1653497506.738192399]: DiffDrive(ns = /locobot//): Advertise joint_states [ INFO] [1653497506.738600348]: DiffDrive(ns = /locobot//): Try to subscribe to mobile_base/commands/velocity [ INFO] [1653497506.739738894]: DiffDrive(ns = /locobot//): Subscribe to mobile_base/commands/velocity [ INFO] [1653497506.740115611]: DiffDrive(ns = /locobot//): Advertise odom on mobile_base/odom Loaded 'joint_state_controller' Loaded 'waist_controller' Loaded 'shoulder_controller' Loaded 'elbow_controller' Loaded 'forearm_roll_controller' Loaded 'wrist_angle_controller' Loaded 'wrist_rotate_controller' Loaded 'left_finger_controller' Loaded 'right_finger_controller' Loaded 'pan_controller' Loaded 'tilt_controller' [INFO] [1653497507.186574, 0.000000]: Calling service /gazebo/set_model_configuration [INFO] [1653497507.189253, 0.000000]: Set model configuration status: SetModelConfiguration: success [locobot/urdf_spawner-6] process has finished cleanly log file: /home/interbotix/.ros/log/f53d995a-dc4a-11ec-b898-47855316a363/locobot-urdf_spawner-6*.log Started ['joint_state_controller'] successfully Started ['waist_controller'] successfully Started ['shoulder_controller'] successfully Started ['elbow_controller'] successfully Started ['forearm_roll_controller'] successfully Started ['wrist_angle_controller'] successfully Started ['wrist_rotate_controller'] successfully Started ['left_finger_controller'] successfully Started ['right_finger_controller'] successfully Started ['pan_controller'] successfully Started ['tilt_controller'] successfully [locobot/controller_spawner-4] process has finished cleanly log file: /home/interbotix/.ros/log/f53d995a-dc4a-11ec-b898-47855316a363/locobot-controller_spawner-4*.log ```

In your roslaunch console output, it seems like both the position and trajectory controllers are trying to load since you have both the arm/gripper and the individual joint controller parameters. I was able to get your error if I try to launch both the trajectory and position controllers at the same time (setting both these args to true).

RLException ```sh ~ $ roslaunch interbotix_xslocobot_gazebo xslocobot_gazebo.launch robot_model:=locobot_wx250s show_lidar:=true dof:=6 use_position_controllers:=true use_trajectory_controllers:=true ... logging to /home/interbotix/.ros/log/7a4c6cf8-dc4a-11ec-b898-47855316a363/roslaunch-interbotix-728173.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. RLException: roslaunch file contains multiple nodes named [/locobot/controller_spawner]. Please check all 'name' attributes to make sure they are unique. Also check that $(anon id) use different ids. The traceback for the exception was written to the log file ```

This would try to load the controller_spawner node twice (here and here), leading to the RLException you're seeing.

Check to see if you're launching both sets of controllers.

lukeschmitt-tr commented 2 years ago

Do you have any further questions on this? Otherwise, this issue will be closed.

lukeschmitt-tr commented 2 years ago

Closing due to lack of activity. Feel free to reopen if necessary.