Hi Lukasz,
Following your suggestion I created a localization.launch file as below.
>
<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 3.14 0 0 base_link laser_frame 100" />
<node pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" name="teleop_twist_keyboard" output="screen"/>
<node pkg="rviz" type="rviz" name="rviz"/>
<arg name="map_file" default="/home/husarion/ros_workspace/src/rosbot_slam/maps/19-07-10-Test-0_2-Teleop-Speed.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<remap from="scan" to="/scan"/>
<param name="odom_frame_id" value="odom"/>
<param name="odom_model_type" value="diff-corrected"/>
<param name="base_frame_id" value="base_link"/>
<param name="update_min_d" value="0.5"/>
<param name="update_min_a" value="1.0"/>
</node>
<node pkg="move_base" type="move_base" name="move_base" output="screen">
<param name="controller_frequency" value="10.0"/>
<rosparam file="$(find rosbot_slam)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find rosbot_slam)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find rosbot_slam)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find rosbot_slam)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find rosbot_slam)/config/trajectory_planner.yaml" command="load" />
</node>
</launch>
I strated ros serial node as follows
/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2
On starting the localization file using
roslaunch rosbot_slam localization.launch
I get the following error
… logging to /home/husarion/.ros/log/b7bce0a2-a798-11e9-8554-70f11c0553cc/roslaunch-husarion-UP-CHT01-2222.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://husarion-UP-CHT01:45301/
SUMMARY
PARAMETERS
- /amcl/base_frame_id: base_link
- /amcl/odom_frame_id: odom
- /amcl/odom_model_type: diff-corrected
- /amcl/update_min_a: 1.0
- /amcl/update_min_d: 0.5
- /move_base/TrajectoryPlannerROS/acc_lim_Y: 2.5
- /move_base/TrajectoryPlannerROS/acc_lim_theta: 0.25
- /move_base/TrajectoryPlannerROS/acc_lim_x: 2.5
- /move_base/TrajectoryPlannerROS/holonomic_robot: False
- /move_base/TrajectoryPlannerROS/max_vel_theta: 0.35
- /move_base/TrajectoryPlannerROS/max_vel_x: 0.2
- /move_base/TrajectoryPlannerROS/meter_scoring: True
- /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.25
- /move_base/TrajectoryPlannerROS/min_vel_theta: -0.35
- /move_base/TrajectoryPlannerROS/min_vel_x: 0.1
- /move_base/TrajectoryPlannerROS/xy_goal_tolerance: 0.15
- /move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 0.25
- /move_base/controller_frequency: 10.0
- /move_base/global_costmap/always_send_full_costmap: True
- /move_base/global_costmap/footprint: [[0.12, 0.14], [0…
- /move_base/global_costmap/global_frame: map
- /move_base/global_costmap/height: 15
- /move_base/global_costmap/inflation_radius: 2.5
- /move_base/global_costmap/laser_scan_sensor/clearing: True
- /move_base/global_costmap/laser_scan_sensor/data_type: LaserScan
- /move_base/global_costmap/laser_scan_sensor/marking: True
- /move_base/global_costmap/laser_scan_sensor/sensor_frame: laser_frame
- /move_base/global_costmap/laser_scan_sensor/topic: scan
- /move_base/global_costmap/map_topic: /map
- /move_base/global_costmap/observation_sources: laser_scan_sensor
- /move_base/global_costmap/obstacle_range: 6.0
- /move_base/global_costmap/origin_x: -7.5
- /move_base/global_costmap/origin_y: -7.5
- /move_base/global_costmap/publish_frequency: 2.5
- /move_base/global_costmap/raytrace_range: 8.5
- /move_base/global_costmap/resolution: 0.1
- /move_base/global_costmap/robot_base_frame: base_link
- /move_base/global_costmap/rolling_window: True
- /move_base/global_costmap/static_map: True
- /move_base/global_costmap/subscribe_to_updates: True
- /move_base/global_costmap/transform_tolerance: 0.5
- /move_base/global_costmap/update_frequency: 2.5
- /move_base/global_costmap/width: 15
- /move_base/local_costmap/always_send_full_costmap: True
- /move_base/local_costmap/footprint: [[0.12, 0.14], [0…
- /move_base/local_costmap/global_frame: map
- /move_base/local_costmap/height: 3
- /move_base/local_costmap/inflation_radius: 0.6
- /move_base/local_costmap/laser_scan_sensor/clearing: True
- /move_base/local_costmap/laser_scan_sensor/data_type: LaserScan
- /move_base/local_costmap/laser_scan_sensor/marking: True
- /move_base/local_costmap/laser_scan_sensor/sensor_frame: laser_frame
- /move_base/local_costmap/laser_scan_sensor/topic: scan
- /move_base/local_costmap/map_topic: /map
- /move_base/local_costmap/observation_sources: laser_scan_sensor
- /move_base/local_costmap/obstacle_range: 6.0
- /move_base/local_costmap/origin_x: -1.5
- /move_base/local_costmap/origin_y: -1.5
- /move_base/local_costmap/publish_frequency: 5
- /move_base/local_costmap/raytrace_range: 8.5
- /move_base/local_costmap/resolution: 0.1
- /move_base/local_costmap/robot_base_frame: base_link
- /move_base/local_costmap/rolling_window: True
- /move_base/local_costmap/static_map: False
- /move_base/local_costmap/subscribe_to_updates: True
- /move_base/local_costmap/transform_tolerance: 0.25
- /move_base/local_costmap/update_frequency: 5
- /move_base/local_costmap/width: 3
- /rosdistro: kinetic
- /rosversion: 1.12.14
- /rplidar/angle_compensate: True
- /rplidar/serial_baudrate: 256000
NODES
/
amcl (amcl/amcl)
drive_controller (tutorial_pkg/drive_controller_node)
laser_broadcaster (tf/static_transform_publisher)
map_server (map_server/map_server)
move_base (move_base/move_base)
rplidar (rplidar_ros/rplidarNode)
rviz (rviz/rviz)
teleop_twist_keyboard (teleop_twist_keyboard/teleop_twist_keyboard.py)
auto-starting new master
process[master]: started with pid [2233]
ROS_MASTER_URI=http://master:11311
setting /run_id to b7bce0a2-a798-11e9-8554-70f11c0553cc
process[rosout-1]: started with pid [2256]
started core service [/rosout]
process[rplidar-2]: started with pid [2274]
process[drive_controller-3]: started with pid [2275]
process[laser_broadcaster-4]: started with pid [2288]
process[teleop_twist_keyboard-5]: started with pid [2294]
process[rviz-6]: started with pid [2315]
process[map_server-7]: started with pid [2323]
process[amcl-8]: started with pid [2324]
process[move_base-9]: started with pid [2325]
[ERROR] [1563261000.516709656]: failed to open image file “/home/husarion/ros_workspace/src/rosbot_slam/test3.pgm”: Couldn’t open /home/husarion/ros_workspace/src/rosbot_slam/test3.pgm
[ INFO] [1563261000.965074495]: Requesting the map…
[ WARN] [1563261000.967836340]: Request for map failed; trying again…
[map_server-7] process has died [pid 2323, exit code 255, cmd /opt/ros/kinetic/lib/map_server/map_server /home/husarion/ros_workspace/src/rosbot_slam/maps/19-07-10-Test-0_2-Teleop-Speed.yaml __name:=map_server __log:=/home/husarion/.ros/log/b7bce0a2-a798-11e9-8554-70f11c0553cc/map_server-7.log].
log file: /home/husarion/.ros/log/b7bce0a2-a798-11e9-8554-70f11c0553cc/map_server-7*.log
[ WARN] [1563261001.471250906]: Request for map failed; trying again…
[ WARN] [1563261001.974270009]: Request for map failed; trying again…
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
[ WARN] [1563261002.479030375]: Request for map failed; trying again…
[ WARN] [1563261002.982331106]: Request for map failed; trying again…
[ WARN] [1563261003.486819555]: Request for map failed; trying again…
[ WARN] [1563261003.992947529]: Request for map failed; trying again…
[ WARN] [1563261004.496312584]: Request for map failed; trying again…
[ WARN] [1563261005.000102828]: Request for map failed; trying again…
[ WARN] [1563261005.505055637]: Request for map failed; trying again…
[ WARN] [1563261005.999323771]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist… canTransform returned after 0.100687 timeout was 0.1.
[ WARN] [1563261006.008851044]: Request for map failed; trying again…
[ WARN] [1563261006.513776422]: Request for map failed; trying again…