DFKI-NI / mir_robot

ROS support for the MiR Robots. This is a community project to use the MiR Robots with ROS. It is not affiliated with Mobile Industrial Robots.
BSD 3-Clause "New" or "Revised" License
231 stars 157 forks source link

General problems / missing details? #119

Closed lliendo closed 1 year ago

lliendo commented 1 year ago

Hi,

I'm trying to run the Gazebo simulator but there are things that are not running as expected.

SUMMARY
========

PARAMETERS
 * /mir_bridge/hostname: 192.168.12.20
 * /mir_bridge/tf_prefix: 
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.15
 * /tf_prefix: 
 * /tf_remove_state_publisher_frames/remove_frames: ['base_link', 'fr...

NODES
  /
    b_rep117_laser_filter (mir_driver/rep117_filter.py)
    f_rep117_laser_filter (mir_driver/rep117_filter.py)
    fake_mir_joint_publisher (mir_driver/fake_mir_joint_publisher.py)
    mir_bridge (mir_driver/mir_bridge.py)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    tf_remove_state_publisher_frames (mir_driver/tf_remove_child_frames.py)

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

setting /run_id to cc06cf6a-82ae-11ed-9454-3c58c2b35ab0
process[rosout-1]: started with pid [102]
started core service [/rosout]
process[robot_state_publisher-2]: started with pid [109]
process[tf_remove_state_publisher_frames-3]: started with pid [110]
process[mir_bridge-4]: started with pid [111]
process[b_rep117_laser_filter-5]: started with pid [112]
process[f_rep117_laser_filter-6]: started with pid [117]
process[fake_mir_joint_publisher-7]: started with pid [119]
[INFO] [1671792279.095902]: [/mir_bridge] trying to connect to 192.168.12.20:9090...
[WARN] [1671792279.998512]: [/mir_bridge] still waiting for connection to 192.168.12.20:9090...
[WARN] [1671792280.998691]: [/mir_bridge] still waiting for connection to 192.168.12.20:9090...
[WARN] [1671792281.998505]: [/mir_bridge] still waiting for connection to 192.168.12.20:9090...
[WARN] [1671792282.998397]: [/mir_bridge] still waiting for connection to 192.168.12.20:9090...
[WARN] [1671792283.998458]: [/mir_bridge] still waiting for connection to 192.168.12.20:9090...
[WARN] [1671792284.998649]: [/mir_bridge] still waiting for connection to 192.168.12.20:9090...

It seems that first I need to run: roslaunch rosbridge_server rosbridge_websocket.launch after doing apt-get install ros-noetic-rosbridge-server.

[INFO] [1671794925.991974]: [/mir_bridge] tf_static: sent 4 transforms: odict_keys(['/surface', '/imu_frame', '/us_1_frame', '/us_2_frame'])
[INFO] [1671794925.994877]: [/mir_bridge] tf_static: updated transform base_link->/surface.
[INFO] [1671794925.995985]: [/mir_bridge] tf_static: updated transform imu_link->/imu_frame.
[INFO] [1671794925.997328]: [/mir_bridge] tf_static: updated transform base_link->/us_1_frame.
[INFO] [1671794925.998473]: [/mir_bridge] tf_static: updated transform base_link->/us_2_frame.
[INFO] [1671794925.999635]: [/mir_bridge] tf_static: sent 4 transforms: odict_keys(['/surface', '/imu_frame', '/us_1_frame', '/us_2_frame'])
[INFO] [1671794926.002193]: [/mir_bridge] tf_static: updated transform base_link->/surface.
[INFO] [1671794926.003573]: [/mir_bridge] tf_static: updated transform imu_link->/imu_frame.
[INFO] [1671794926.005487]: [/mir_bridge] tf_static: updated transform base_link->/us_1_frame.
[INFO] [1671794926.007061]: [/mir_bridge] tf_static: updated transform base_link->/us_2_frame.
[INFO] [1671794926.009957]: [/mir_bridge] starting to stream messages on topic 'move_base/status'
[INFO] [1671794926.010236]: [/mir_bridge] tf_static: sent 4 transforms: odict_keys(['/surface', '/imu_frame', '/us_1_frame', '/us_2_frame'])
[INFO] [1671794926.015737]: [/mir_bridge] starting to stream messages on topic 'move_base/result'
[INFO] [1671794926.017013]: [/mir_bridge] tf_static: updated transform base_link->/surface.
[INFO] [1671794926.020797]: [/mir_bridge] tf_static: updated transform imu_link->/imu_frame.
[INFO] [1671794926.021548]: [/mir_bridge] starting to stream messages on topic 'move_base/feedback'
[INFO] [1671794926.022940]: [/mir_bridge] tf_static: updated transform base_link->/us_1_frame.
[INFO] [1671794926.024694]: [/mir_bridge] tf_static: updated transform base_link->/us_2_frame.
[INFO] [1671794926.025740]: [/mir_bridge] tf_static: sent 4 transforms: odict_keys(['/surface', '/imu_frame', '/us_1_frame', '/us_2_frame'])
[INFO] [1671794926.027885]: [/mir_bridge] tf_static: updated transform base_link->/surface.
[INFO] [1671794926.029071]: [/mir_bridge] tf_static: updated transform imu_link->/imu_frame.
[INFO] [1671794926.029998]: [/mir_bridge] tf_static: updated transform base_link->/us_1_frame.
[INFO] [1671794926.031169]: [/mir_bridge] tf_static: updated transform base_link->/us_2_frame.
[INFO] [1671794926.032269]: [/mir_bridge] tf_static: sent 4 transforms: odict_keys(['/surface', '/imu_frame', '/us_1_frame', '/us_2_frame'])
[INFO] [1671794926.034741]: [/mir_bridge] tf_static: updated transform base_link->/surface.
[INFO] [1671794926.035832]: [/mir_bridge] tf_static: updated transform imu_link->/imu_frame.
[INFO] [1671794926.037133]: [/mir_bridge] tf_static: updated transform base_link->/us_1_frame.
[INFO] [1671794926.038074]: [/mir_bridge] tf_static: updated transform base_link->/us_2_frame.
...

At this point even though my computer's load starts to increase for no reason I move on. I do not see any errors beside the INFO messages.

Now I proceed with the commands explained in "Gazebo demo (existing map)" of the README file.

The following steps take place in my environment (not in Docker, what I've shown so far is running on a noetic Docker image) in again a noetic environment. I was able to successfully build the project as explained. So in my environment after running source /opt/ros/noetic/setup.bash and source ~/catkin_ws/devel/setup.bash I launch: roslaunch mir_gazebo mir_maze_world.launch and rosservice call /gazebo/unpause_physics. Gazebo gets opened along with a UI where you are supposed to control the robot. Clicking on the UI to try to move the robot nothing happens, the robot is still in its original position in the Gazebo virtual environment.

The output for the roslaunch mir_gazebo mir_maze_world.launch is this:

SUMMARY
========

CLEAR PARAMETERS
 * /ekf_localization_node/

PARAMETERS
 * /ekf_localization_node/acceleration_gains: [0.8, 0.0, 0.0, 0...
 * /ekf_localization_node/acceleration_limits: [1.3, 0.0, 0.0, 0...
 * /ekf_localization_node/base_link_frame: base_footprint
 * /ekf_localization_node/control_config: [True, False, Fal...
 * /ekf_localization_node/control_timeout: 0.2
 * /ekf_localization_node/debug: False
 * /ekf_localization_node/debug_out_file: /path/to/debug/fi...
 * /ekf_localization_node/deceleration_gains: [1.0, 0.0, 0.0, 0...
 * /ekf_localization_node/deceleration_limits: [1.3, 0.0, 0.0, 0...
 * /ekf_localization_node/frequency: 40
 * /ekf_localization_node/imu0: imu_data
 * /ekf_localization_node/imu0_config: [False, False, Fa...
 * /ekf_localization_node/imu0_differential: False
 * /ekf_localization_node/imu0_nodelay: False
 * /ekf_localization_node/imu0_queue_size: 10
 * /ekf_localization_node/imu0_relative: True
 * /ekf_localization_node/imu0_remove_gravitational_acceleration: False
 * /ekf_localization_node/initial_estimate_covariance: [100.0, 0, 0, 0, ...
 * /ekf_localization_node/map_frame: map
 * /ekf_localization_node/odom0: odom
 * /ekf_localization_node/odom0_config: [False, False, Fa...
 * /ekf_localization_node/odom0_differential: False
 * /ekf_localization_node/odom0_nodelay: False
 * /ekf_localization_node/odom0_queue_size: 10
 * /ekf_localization_node/odom0_relative: False
 * /ekf_localization_node/odom_frame: odom
 * /ekf_localization_node/print_diagnostics: True
 * /ekf_localization_node/process_noise_covariance: [0.05, 0, 0, 0, 0...
 * /ekf_localization_node/publish_acceleration: False
 * /ekf_localization_node/publish_tf: True
 * /ekf_localization_node/sensor_timeout: 0.1
 * /ekf_localization_node/stamped_control: False
 * /ekf_localization_node/transform_time_offset: 0.0
 * /ekf_localization_node/transform_timeout: 0.0
 * /ekf_localization_node/two_d_mode: True
 * /ekf_localization_node/use_control: False
 * /ekf_localization_node/world_frame: odom
 * /gazebo/enable_ros_network: True
 * /joint_state_controller/publish_rate: 50
 * /joint_state_controller/type: joint_state_contr...
 * /joint_state_publisher/rate: 200.0
 * /joint_state_publisher/source_list: ['mir/joint_states']
 * /mobile_base_controller/angular/z/has_acceleration_limits: True
 * /mobile_base_controller/angular/z/has_velocity_limits: True
 * /mobile_base_controller/angular/z/max_acceleration: 2.5
 * /mobile_base_controller/angular/z/max_velocity: 1.5
 * /mobile_base_controller/base_frame_id: base_footprint
 * /mobile_base_controller/cmd_vel_timeout: 0.5
 * /mobile_base_controller/enable_odom_tf: False
 * /mobile_base_controller/left_wheel: left_wheel_joint
 * /mobile_base_controller/linear/x/has_acceleration_limits: True
 * /mobile_base_controller/linear/x/has_velocity_limits: True
 * /mobile_base_controller/linear/x/max_acceleration: 2.0
 * /mobile_base_controller/linear/x/max_velocity: 1.0
 * /mobile_base_controller/odom_frame_id: odom
 * /mobile_base_controller/pose_covariance_diagonal: [1e-05, 1e-05, 10...
 * /mobile_base_controller/publish_rate: 41.2
 * /mobile_base_controller/right_wheel: right_wheel_joint
 * /mobile_base_controller/twist_covariance_diagonal: [0.1, 0.1, 100000...
 * /mobile_base_controller/type: diff_drive_contro...
 * /mobile_base_controller/wheel_radius_multiplier: 1.0
 * /mobile_base_controller/wheel_separation_multiplier: 1.0
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.15
 * /rqt_robot_steering/default_topic: cmd_vel
 * /rqt_robot_steering/default_vw_max: 1.5
 * /rqt_robot_steering/default_vw_min: -1.5
 * /rqt_robot_steering/default_vx_max: 1.0
 * /rqt_robot_steering/default_vx_min: -1.0
 * /use_sim_time: True

NODES
  /
    b_rep117_laser_filter (mir_driver/rep117_filter.py)
    b_scan_relay (topic_tools/relay)
    controller_spawner (controller_manager/spawner)
    ekf_localization_node (robot_localization/ekf_localization_node)
    f_rep117_laser_filter (mir_driver/rep117_filter.py)
    f_scan_relay (topic_tools/relay)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    joint_state_publisher (joint_state_publisher/joint_state_publisher)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rqt_robot_steering (rqt_robot_steering/rqt_robot_steering)
    spawn_maze (gazebo_ros/spawn_model)
    spawn_urdf (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [65977]
process[gazebo_gui-2]: started with pid [65982]
process[spawn_urdf-3]: started with pid [65987]
process[controller_spawner-4]: started with pid [65988]
process[ekf_localization_node-5]: started with pid [65997]
process[joint_state_publisher-6]: started with pid [66007]
process[robot_state_publisher-7]: started with pid [66017]
process[rqt_robot_steering-8]: started with pid [66036]
process[b_scan_relay-9]: started with pid [66039]
process[f_scan_relay-10]: started with pid [66054]
process[b_rep117_laser_filter-11]: started with pid [66063]
process[f_rep117_laser_filter-12]: started with pid [66078]
process[spawn_maze-13]: started with pid [66104]
[ WARN] [1671795485.266056747]: Shutdown request received.
[ WARN] [1671795485.272054087]: Reason given for shutdown: [[/robot_state_publisher] Reason: new node registered with same name]
[robot_state_publisher-7] process has finished cleanly
log file: /home/lucas/.ros/log/f1597fdc-82b4-11ed-9fcc-3c58c2b35ab0/robot_state_publisher-7*.log
[INFO] [1671795486.220880, 0.000000]: Waiting for /clock to be available...
[INFO] [1671795486.535901, 0.000000]: Loading model XML from file /home/lucas/catkin_ws/src/mir_robot/mir_gazebo/sdf/maze/model.sdf
[INFO] [1671795486.541554, 0.000000]: Waiting for service /gazebo/spawn_sdf_model
[ INFO] [1671795487.270231022]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1671795487.272929625]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1671795487.386515341]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1671795487.389927086]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1671795488.937364222]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[INFO] [1671795488.962630, 0.000000]: Calling service /gazebo/spawn_sdf_model
[INFO] [1671795489.239285, 0.000000]: Spawn status: SpawnModel: Successfully spawned entity
[spawn_maze-13] process has finished cleanly
log file: /home/lucas/.ros/log/f1597fdc-82b4-11ed-9fcc-3c58c2b35ab0/spawn_maze-13*.log
[ INFO] [1671795490.348355294]: Physics dynamic reconfigure ready.
[spawn_urdf-3] process has finished cleanly
log file: /home/lucas/.ros/log/f1597fdc-82b4-11ed-9fcc-3c58c2b35ab0/spawn_urdf-3*.log

Note the:

[ WARN] [1671795485.266056747]: Shutdown request received.
[ WARN] [1671795485.272054087]: Reason given for shutdown: [[/robot_state_publisher] Reason: new node registered with same name]

messages. I don't know if that is correct/incorrect or expected behaviour. Besides that the robot is not moving in the console where I'm running the rosbridge_server process I get these errors:

2022-12-23 11:38:08+0000 [-] [ERROR] [1671795488.502394]: [Client 1] publish: Message type geometry_msgs/Twist does not have a field header
2022-12-23 11:40:27+0000 [-] [ERROR] [1671795627.972498]: [Client 1] publish: Message type geometry_msgs/Twist does not have a field header
2022-12-23 11:40:27+0000 [-] [ERROR] [1671795627.990643]: [Client 1] publish: Message type geometry_msgs/Twist does not have a field header
2022-12-23 11:40:28+0000 [-] [ERROR] [1671795628.091006]: [Client 1] publish: Message type geometry_msgs/Twist does not have a field header
2022-12-23 11:40:28+0000 [-] [ERROR] [1671795628.191302]: [Client 1] publish: Message type geometry_msgs/Twist does not have a field header
2022-12-23 11:40:28+0000 [-] [ERROR] [1671795628.291005]: [Client 1] publish: Message type geometry_msgs/Twist does not have a field header

At this stage it's clear that either I'm doing something wrong, or some steps from the documentation are missing, or both or something else is going on... Unfortunately I'm not that experienced with ROS so is not easy to spot what the issue could be. As previously stated I'm running roslaunch rosbridge_server rosbridge_websocket.launch and roslaunch mir_driver mir.launch in a docker noetic container (the docker container is launched with the --network host option so I can communicate with those services from my regular environment) and the Gazebo environment is run outside docker. Any help is much appreciated.

Thanks, Lucas.

mintar commented 1 year ago

Please only run the commands in the "Gazebo demo (existing map)" section of the README. You are trying to run commands from the mir_driver package in simulation, but that package is only for the real robot.

mintar commented 1 year ago

By the way, the README is very well tested, so if you feel that you have to deviate from it, chances are that you're doing something wrong. :)

mintar commented 1 year ago

And if you find that the instructions are unclear (such as in this case), feel free to improve them and send a pull request, or tell me what was unclear so I can improve it. Feedback from actual users is always very valuable!