Skip to content
Snippets Groups Projects

STATIC TRANSFORMATIONS

A static transformations is needed so that RViz knows the relation between the robots's frame and the LiDAR sensor's frame. It states the translation and rotation between the two.

terminal 1:

ros2 run tf2_ros static_transform_publisher "0" "0" "0" "0" "0" "0" "map" "scan"

terminal 2:

ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_link

terminal 3:

ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link laser

terminal 4:

ros2 launch rf2o_laser_odometry rf2o_laser_odometry.launch.py

static transforms

PYTHON LAUNCH METHOD

terminal 5:

ros2 run slam_toolbox sync_slam_toolbox_node \
in command line after add:
--ros-args -p odom_frame:=odom --ros-args -p base_frame:=base_link --ros-args -p map_frame:=map --ros-args -p scan_topic:=/scan --ros-args -p map_update_interval:=1.0 --ros-args -p 	max_laser_range:=5.0 --ros-args -p minimum_travel_distance:=0.1 --ros-args -p use_scan_matching:=true --ros-args -p minimum_travel_heading:=1.57 --ros-args -p do_loop_closing:=true 

RVIZ

add Map by topic /map
change fixed frame --> /map 
	then map is fixed and lidar can move with out the frame moving 

riviz settings
ros2 param get /slam_toolbox