Multirosbots AMCL in Rviz

Hi I am trying to bring two rosbots in a prebuilt map. Can you please help with the error messages.

husarion@husarion:~$ roslaunch tutorial_pkg pathplanning_amcl.launch
… logging to /home/husarion/.ros/log/6ad3ffdc-f1ad-11e9-9be5-409f384f007f/roslaunch-husarion-27504.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.1.2:42086/

SUMMARY

PARAMETERS

  • /rosbot2/amcl/base_frame_id: /rosbot2/base_link
  • /rosbot2/amcl/global_frame_id: /map
  • /rosbot2/amcl/initial_pose_a: -0.024
  • /rosbot2/amcl/initial_pose_x: 1.668
  • /rosbot2/amcl/initial_pose_y: -0.062
  • /rosbot2/amcl/max_particles: 10000
  • /rosbot2/amcl/min_particles: 500
  • /rosbot2/amcl/odom_frame_id: /rosbot2/odom
  • /rosbot2/amcl/odom_model_type: diff
  • /rosbot2/amcl/update_min_a: 0.1
  • /rosbot2/amcl/update_min_d: 0.1
  • /rosbot2/amcl/use_map_topic: True
  • /rosbot2/move_base/TrajectoryPlannerROS/acc_lim_Y: 2.5
  • /rosbot2/move_base/TrajectoryPlannerROS/acc_lim_theta: 0.25
  • /rosbot2/move_base/TrajectoryPlannerROS/acc_lim_x: 2.5
  • /rosbot2/move_base/TrajectoryPlannerROS/holonomic_robot: False
  • /rosbot2/move_base/TrajectoryPlannerROS/max_vel_theta: 0.35
  • /rosbot2/move_base/TrajectoryPlannerROS/max_vel_x: 0.2
  • /rosbot2/move_base/TrajectoryPlannerROS/meter_scoring: True
  • /rosbot2/move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.25
  • /rosbot2/move_base/TrajectoryPlannerROS/min_vel_theta: -0.35
  • /rosbot2/move_base/TrajectoryPlannerROS/min_vel_x: 0.1
  • /rosbot2/move_base/TrajectoryPlannerROS/xy_goal_tolerance: 0.15
  • /rosbot2/move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 0.25
  • /rosbot2/move_base/controller_frequency: 10.0
  • /rosbot2/move_base/global_costmap/always_send_full_costmap: True
  • /rosbot2/move_base/global_costmap/footprint: [[0.12, 0.14], [0…
  • /rosbot2/move_base/global_costmap/global_frame: map
  • /rosbot2/move_base/global_costmap/height: 15
  • /rosbot2/move_base/global_costmap/inflation_radius: 1.0
  • /rosbot2/move_base/global_costmap/laser_scan_sensor/clearing: True
  • /rosbot2/move_base/global_costmap/laser_scan_sensor/data_type: LaserScan
  • /rosbot2/move_base/global_costmap/laser_scan_sensor/marking: True
  • /rosbot2/move_base/global_costmap/laser_scan_sensor/sensor_frame: laser_frame
  • /rosbot2/move_base/global_costmap/laser_scan_sensor/topic: scan
  • /rosbot2/move_base/global_costmap/map_topic: /map
  • /rosbot2/move_base/global_costmap/observation_sources: laser_scan_sensor
  • /rosbot2/move_base/global_costmap/obstacle_range: 3.0
  • /rosbot2/move_base/global_costmap/origin_x: -7.5
  • /rosbot2/move_base/global_costmap/origin_y: -7.5
  • /rosbot2/move_base/global_costmap/publish_frequency: 5.0
  • /rosbot2/move_base/global_costmap/raytrace_range: 4.5
  • /rosbot2/move_base/global_costmap/resolution: 0.05
  • /rosbot2/move_base/global_costmap/robot_base_frame: base_link
  • /rosbot2/move_base/global_costmap/rolling_window: True
  • /rosbot2/move_base/global_costmap/static_map: True
  • /rosbot2/move_base/global_costmap/subscribe_to_updates: True
  • /rosbot2/move_base/global_costmap/transform_tolerance: 0.5
  • /rosbot2/move_base/global_costmap/update_frequency: 5.0
  • /rosbot2/move_base/global_costmap/width: 15
  • /rosbot2/move_base/local_costmap/always_send_full_costmap: True
  • /rosbot2/move_base/local_costmap/footprint: [[0.12, 0.14], [0…
  • /rosbot2/move_base/local_costmap/global_frame: map
  • /rosbot2/move_base/local_costmap/height: 3
  • /rosbot2/move_base/local_costmap/inflation_radius: 0.5
  • /rosbot2/move_base/local_costmap/laser_scan_sensor/clearing: True
  • /rosbot2/move_base/local_costmap/laser_scan_sensor/data_type: LaserScan
  • /rosbot2/move_base/local_costmap/laser_scan_sensor/marking: True
  • /rosbot2/move_base/local_costmap/laser_scan_sensor/sensor_frame: laser_frame
  • /rosbot2/move_base/local_costmap/laser_scan_sensor/topic: scan
  • /rosbot2/move_base/local_costmap/map_topic: /map
  • /rosbot2/move_base/local_costmap/observation_sources: laser_scan_sensor
  • /rosbot2/move_base/local_costmap/obstacle_range: 3.0
  • /rosbot2/move_base/local_costmap/origin_x: -1.5
  • /rosbot2/move_base/local_costmap/origin_y: -1.5
  • /rosbot2/move_base/local_costmap/publish_frequency: 5
  • /rosbot2/move_base/local_costmap/raytrace_range: 4.5
  • /rosbot2/move_base/local_costmap/resolution: 0.05
  • /rosbot2/move_base/local_costmap/robot_base_frame: base_link
  • /rosbot2/move_base/local_costmap/rolling_window: True
  • /rosbot2/move_base/local_costmap/static_map: False
  • /rosbot2/move_base/local_costmap/subscribe_to_updates: True
  • /rosbot2/move_base/local_costmap/transform_tolerance: 0.5
  • /rosbot2/move_base/local_costmap/update_frequency: 5
  • /rosbot2/move_base/local_costmap/width: 3
  • /rosbot2/rplidar/angle_compensate: True
  • /rosbot2/rplidar/serial_baudrate: 115200
  • /rosbot2/tf_prefix: rosbot2
  • /rosdistro: kinetic
  • /rosversion: 1.12.14

NODES
/rosbot2/
amcl (amcl/amcl)
drive_controller (tutorial_pkg/drive_controller_node)
laser_broadcaster (tf/static_transform_publisher)
move_base (move_base/move_base)
rplidar (rplidar_ros/rplidarNode)
rviz (rviz/rviz)
teleop_twist_keyboard (teleop_twist_keyboard/teleop_twist_keyboard.py)

ROS_MASTER_URI=http://192.168.1.4:11311

process[rosbot2/rplidar-1]: started with pid [27611]
process[rosbot2/drive_controller-2]: started with pid [27612]
process[rosbot2/laser_broadcaster-3]: started with pid [27618]
process[rosbot2/teleop_twist_keyboard-4]: started with pid [27620]
process[rosbot2/rviz-5]: started with pid [27626]
process[rosbot2/amcl-6]: started with pid [27630]
process[rosbot2/move_base-7]: started with pid [27634]
libEGL warning: DRI2: failed to authenticate
[ INFO] [1571408104.311278607]: Subscribed to map topic.

Reading from the keyboard and Publishing to Twist!

Moving around:
u i o
j k l
m , .

For Holonomic mode (strafing), hold down the shift key:

U I O
J K L
M < >

t : up (+z)
b : down (-z)

anything else : stop

q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%

CTRL-C to quit

currently: speed 0.5 turn 1.0
[ INFO] [1571408105.816788951]: Received a 416 X 288 map @ 0.100 m/pix

                                                                  [ INFO] [1571408105.970904182]: Initializing likelihood field model; this can take some time on large maps...
                         [ INFO] [1571408106.014401897]: Done initializing likelihood field model.
                       [ WARN] [1571408108.732951167]: Timed out waiting for transform from rosbot2/base_link to rosbot2/map to become available before running costmap, tf error: canTransform: target_frame rosbot2/map does not exist. canTransform: source_frame rosbot2/base_link does not exist.. canTransform returned after 0.100619 timeout was 0.1.
                                                 [ WARN] [1571408113.788446694]: Timed out waiting for transform from rosbot2/base_link to rosbot2/map to become available before running costmap, tf error: canTransform: target_frame rosbot2/map does not exist. canTransform: source_frame rosbot2/base_link does not exist.. canTransform returned after 0.100169 timeout was 0.1.
[ WARN] [1571408118.826121969]: Timed out waiting for transform from rosbot2/base_link to rosbot2/map to become available before running costmap, tf error: canTransform: target_frame rosbot2/map does not exist. canTransform: source_frame rosbot2/base_link does not exist.. canTransform returned after 0.100416 timeout was 0.1.
                          [ WARN] [1571408120.816749883]: MessageFilter [target=/rosbot2/odom ]: Dropped 100.00% of messages so far. Please turn the [ros.amcl.message_notifier] rosconsole logger to DEBUG for more information.
[ WARN] [1571408120.817168425]: No laser scan received (and thus no pose updates have been published) for 1571408120.817035 seconds.  Verify that data is being published on the /rosbot2/scan topic.
                                               [ WARN] [1571408123.863272535]: Timed out waiting for transform from rosbot2/base_link to rosbot2/map to become available before running costmap, tf error: canTransform: target_frame rosbot2/map does not exist. canTransform: source_frame rosbot2/base_link does not exist.. canTransform returned after 0.100714 timeout was 0.1.

[ WARN] [1571408128.905659393]: Timed out waiting for transform from rosbot2/base_link to rosbot2/map to become available before running costmap, tf error: canTransform: target_frame rosbot2/map does not exist. canTransform: source_frame rosbot2/base_link does not exist… canTransform returned after 0.10082 timeout was 0.1.
[ WARN] [1571408133.961744379]: Timed out waiting for transform from rosbot2/base_link to rosbot2/map to become available before running costmap, tf error: canTransform: target_frame rosbot2/map does not exist. canTransform: source_frame rosbot2/base_link does not exist… canTransform returned after 0.100744 timeout was 0.1.
[ WARN] [1571408135.816823982]: No laser scan received (and thus no pose updates have been published) for 1571408135.816703 seconds. Verify that data is being published on the /rosbot2/scan topic.

And this is the launch files for the map and the two rosbots
#map launh file

</node>

#launch file for the rosbots

<group ns="rosbot2"> 
    <param name="tf_prefix" value="rosbot2" />        

<arg name="use_rosbot" default="true"/>
<arg name="use_gazebo" default="false"/>

<include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/maze_world.launch"/>
<include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/rosbot.launch"/>

#<param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>

<node if="$(arg use_rosbot)" pkg="rplidar_ros" type="rplidarNode" name="rplidar">
    <param name="angle_compensate" type="bool" value="true"/>
    <param name="serial_baudrate" type="int" value="115200"/><!--model A2 (ROSbot 2.0) -->
<!--<param name="serial_baudrate" type="int" value="256000"/>--><!-- model A3 (ROSbot 2.0 PRO) -->
</node>

<node if="$(arg use_rosbot)" pkg="tutorial_pkg" type="drive_controller_node" name="drive_controller"/>

<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0 0 0.1 3.14 0 0 base_link laser_frame 100" >
    <remap from="/rosbot2/map" to="/map" />
</node>

<node pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" name="teleop_twist_keyboard" output="screen"/>

<node pkg="rviz" type="rviz" name="rviz"/>
<node pkg="amcl" type="amcl" name="amcl" output="screen">

    <param name="global_frame_id" value="/map"/>
  	    <remap from="static_map" to="/static_map" />
    <remap from="scan" to="/rosbot2/scan" />
    <remap from="/rosbot2/map" to="/map" />

    <param name="odom_frame_id" value="/rosbot2/odom"/>
    <param name="odom_model_type" value="diff"/>
    <param name="base_frame_id" value="/rosbot2/base_link"/>
    <param name="update_min_d" value="0.1"/>
    <param name="update_min_a" value="0.1"/>
    <param name="min_particles" value="500"/>
    <param name="max_particles" value="10000"/>
	    
    <param name="initial_pose_x" value="1.668"/>
    <param name="initial_pose_y" value="-0.062"/>
    <param name="initial_pose_a" value="-0.024"/>
    <param name="use_map_topic" value="true" />
</node>

<node pkg="move_base" type="move_base" name="move_base" output="screen">
   	    <param name="controller_frequency" value="10.0"/>
    <rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find tutorial_pkg)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find tutorial_pkg)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find tutorial_pkg)/config/trajectory_planner.yaml" command="load" />
    <remap from="/rosbot2/map" to="/map" />	
</node>
</group>    

Tried to roswtf to understand more about the error. Is this something related to the serial node?

husarion@husarion:~$ roswtf
Loaded plugin tf.tfwtf
No package or stack in context

Static checks summary:

No errors or warnings

Beginning tests of your ROS graph. These may take awhile…
analyzing graph…
… done analyzing graph
running graph rules…
… done running graph rules
running tf checks, this will take a second…
… tf checks complete

Online checks summary:

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

WARNING The following node subscriptions are unconnected:

  • /rosbot2/rviz:
    • /tf_static
    • /map_updates
    • /waypoints
  • /rosbot2/move_base:
    • /rosbot2/move_base_simple/goal
    • /tf_static
  • /rosbot1/amcl:
    • /tf_static
    • /rosbot1/initialpose
  • /rosbot1/move_base:
    • /rosbot1/move_base_simple/goal
    • /tf_static
  • /rosbot2/amcl:
    • /tf_static
    • /rosbot2/initialpose
  • /rosbot1/rviz:
    • /move_base/local_costmap/costmap
    • /scan
    • /move_base/local_costmap/costmap_updates
    • /exploration_polygon_marker_array
    • /tf_static
    • /particlecloud
    • /map_updates
    • /move_base/global_costmap/footprint
    • /explore_server/explore_costmap/explore_boundary/frontiers
    • /exploration_polygon_marker
    • /move_base/TrajectoryPlannerROS/local_plan
    • /move_base/TrajectoryPlannerROS/global_plan
  • /serial_node:
    • /reset_odom
    • /cmd_vel

WARNING These nodes have died:

  • rosbot2/laser_broadcaster-3
  • rosbot2/drive_controller-2
  • rosbot2/amcl-6
  • rosbot2/rplidar-1
  • rosbot2/rviz-5
  • rosbot2/move_base-7

WARNING Received out-of-date/future transforms:

  • receiving transform from [/rosbot1/drive_controller] that differed from ROS time by 2.678503892s
  • receiving transform from [/serial_node] that differed from ROS time by 2.685469061s
  • receiving transform from [/rosbot1/laser_broadcaster] that differed from ROS time by 2.778536441s

Found 1 error(s).

ERROR TF multiple authority contention:

  • node [/rosbot1/laser_broadcaster] publishing transform [laser_frame] with parent [base_link] already published by node [/rosbot2/laser_broadcaster]
  • node [/rosbot2/laser_broadcaster] publishing transform [laser_frame] with parent [base_link] already published by node [/rosbot1/laser_broadcaster]
  • node [/rosbot1/drive_controller] publishing transform [base_link] with parent [odom] already published by node [/rosbot2/drive_controller]
  • node [/serial_node] publishing transform [base_link] with parent [odom] already published by node [/rosbot1/drive_controller]
  • node [/rosbot1/drive_controller] publishing transform [base_link] with parent [odom] already published by node [/serial_node]
  • node [/rosbot2/drive_controller] publishing transform [base_link] with parent [odom] already published by node [/rosbot1/drive_controller]
  • node [/serial_node] publishing transform [base_link] with parent [odom] already published by node [/rosbot2/drive_controller]
  • node [/rosbot2/drive_controller] publishing transform [base_link] with parent [odom] already published by node [/serial_node]

Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr

Hello thiaga,

By analysing your launch file, I can see some issues for node static_transform_publisher:

<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0 0 0.1 3.14 0 0 base_link laser_frame 100" >
    <remap from="/rosbot2/map" to="/map" />
</node>

The remap entry does nothing here, as static_transform_publisher is not subscribing /map nor /rosbot2/map topics, it is only publishing to /tf. In the args there is definition of frame names: base_link laser_frame, this should be rosbot2/base_link rosbot2/laser_frame. The tf frame names are not affected by setting namespace for node, thus you need to explicitly set frame names.

For further analysis of problems, it would be useful to provide screenshot of

rosrun rqt_graph rqt_graph

and

rosrun rqt_tf_tree rqt_tf_tree

Regards,
Łukasz