cd ~/ros2_ws/src
git clone https://github.com/ivogeorg/warehouse_project.git
cd ~/ros2_ws
colcon build
source install/setup.bash
- (personal note) The
odom
frame in the real warehouse lab isrobot_odom
, while theodom
topic is unchanged. Make sure that incartographer_slam/config/cartographer.lua
the following lines are correct:published_frame = "robot_odom", odom_frame = "robot_odom",
ros2 launch cartographer_slam cartographer.launch.py
rviz2 -d ~/ros2_ws/src/warehouse_project/cartographer_slam/rviz/config.rviz
- Move around the robot with the joystick.
ros2 launch map_server map_server.launch.py map_file:=warehouse_map_real.yaml
- In the
map_server
test, the originally created map will be used, not the one that might have been accumulated during thecartographer_slam
test. - In the cartographer phase, the
map
topic andmap
frame are published byoccupancy_grid_node
. - In the map server phase, the
map
topic is published bymap_server
. No TF frames are published bymap_server
.
ros2 launch localization_server localization.launch.py map_file:=warehouse_map_real.yaml
- In Rviz2, set a 2D Pose Estimate
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap cmd_vel:=/robot/cmd_vel
map_server
publishes themap
topic.amcl
subscribes tomap
.amcl
publishes themap
TF frame, after an initial pose (2D Pose Estimate) is specified.
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap cmd_vel:=/robot/cmd_vel
- In Rviz2, set a 2D Pose Estimate
ros2 launch path_planner_server pathplanner.launch.py
- In Rviz2, set a 2D Goal Pose
Parameter | Location | Check | Simulator | Real robot | Documentation | Notes |
---|---|---|---|---|---|---|
cmd_vel |
ROS2 topic | ros2 topic list | grep cmd_vel |
/diffbot_base_controller/cmd_vel_unstamped |
|||
odom |
ROS2 topic | ros2 topic list | grep odom , ros2 topic echo /odom |
odom |
odom |
||
odom |
TF frame | Rviz2, ros2 run tf2_tools view_frames |
odom |
robot_odom |
||
Robot base link/frame | TF frame | Rviz2, ros2 run tf2_tools view_frames |
robot_base_footprint |
robot_base_footprint |
||
Map topic | ROS2 topic | Rviz2, ros2 topic list | grep map , ros2 topic info map -v |
map (cartographer_occupancy_grid_node ) |
|||
Map frame | TF frame | Rviz2, ros2 run tf2_tools view_frames |
map (cartographer_occupancy_grid_node ) |
Assuming the publisher of the map topic |
||
Occupancy grid node | Package under cartographer_ros , launch file |
sudo find / -name "cartographer_ros" |
cartographer_occupancy_grid_node |
|||
map_frame |
Param in cartographer.lua |
File | "map" |
"map" |
||
tracking_frame |
Param in cartographer.lua |
File | "robot_base_footprint" |
"robot_base_footprint" |
||
published_frame |
Param in cartographer.lua |
File | "odom" |
"robot_odom" |
||
odom_frame |
Param in cartographer.lua |
File | "odom" |
"robot_odom" |
||
'use_sim_time' |
Local variable and param in launch and deleted in config files (see here) | Files: map, loc, path | True |
False |
||
base_frame_id |
Param in amcl_config.yaml |
File | "robot_base_footprint" |
"robot_base_footprint" |
||
global_frame_id |
Param in amcl_config.yaml |
File | "map" |
"map" |
||
odom_frame_id |
Param in amcl_config.yaml |
File | "odom" |
"robot_odom" |
||
global_frame |
Param under global_costmap section of planner_server.yaml |
File | map |
map |
||
robot_base_frame |
Param under global_costmap section of planner_server.yaml |
File | robot_base_footprint |
robot_base_footprint |
||
vel_cmd topic |
ROS2 topic | Rviz2, ros2 topic list | grep cmd_vel |
/diffbot_base_controller/cmd_vel_unstamped |
cmd_vel |
||
robot_description topic |
ROS2 topic | Rviz2, ros2 topic list | grep robot_description |
Confusing, sometimes it's /robot_description , sometimes /rb1_robot/robot_description , and neither has a publisher when checking with ros2 topic info /topic_name -v |
/rb1_robot/robot_description |
||
odom_topic |
Param under ros__parameters section in controller.yaml |
File | "odom" |
"odom" |
||
global_frame |
Param under local_costmap section in controller.yaml |
File | map |
map |
||
robot_base_frame |
Param under local_costmap section in controller.yaml |
File | robot_base_footprint |
robot_base_footprint |
||
cmd_vel remapping |
Node argument in pathplanner.launch.py |
/diffbot_base_controller/cmd_vel_unstamped |
None | |||
local_frame |
Param under ros__parameters section in behavior.yaml |
File | odom |
robot_odom |
||
global_frame |
Param under ros__parameters section in behavior.yaml |
File | map |
map |
||
robot_base_frame |
Param under ros__parameters section in behavior.yaml |
File | robot_base_footprint |
robot_base_footprint |
||
global_frame |
Param under ros__parameters section in behavior.yaml |
File | map |
map |
||
robot_base_frame |
Param under ros__parameters section in behavior.yaml |
File | robot_base_footprint |
robot_base_footprint |
||
odom_topic |
Param under ros__parameters section in behavior.yaml |
File | /odom |
/odom |
- A ROS parameter.
- Specified in config files as
ros__parameters: use_sim_time: True
- Specified in
parameters
for node launch descriptions. Question: Does the launch descriptionparameters
value override the config file value? - List parameters with
ros2 param list
. Shown by node. - Check as follows
ros2 param get /position_controller use_sim_time
whereposition_controller
is a node anduse_sime_time
is a parameter of the node.
Conclusion: Config files take precedence over launch description parameter specifications. If specified in the config file, changing the value in the node launch description has no effect. Conversely, if the parameter is not specified in the config file, it is set to the launch description value.