Setup: I am using Ubuntu 22.04 and ROS2 Iron, Two 3D Velodynes, a radar.
I am using a ros2 bag in which I recorded the autonomous vehicle launched topics (just to get the sensors data: GPS, odom, imu, lidar, radar, etc) these topics are provided here: https://pastebin.com/Z4jxWML0
Then I run my launch files to provide nav2 modules:
ISSUES
I am experiencing issues with transitioning the Navigation2 stack from simulation to a real-world environment on a ROS2-based autonomous vehicle project. The local and global costmaps are not appearing when using real data, unlike in the simulation where everything functions as expected.
Symptoms:
- Local and global costmaps do not appear when using real data, despite appearing normally in simulation.
- The transformation from odom to base_footprint is missing, which was apparently managed by a Gazebo plugin in the simulation.
- Only the base_footprint of the robot appears when manually adding a static transform from map to odom.
Troubleshooting Steps Taken:
Static Transforms: Implemented static transforms for map to odom and base_footprint to fill in missing transforms not managed by the Gazebo plugin in the real robot setup.
Configuration Adjustments (nav2_params.yaml): Modified observation sources in costmap configuration files to real robot topics.
Simulation Parameters: Ensured all sim_time parameters are set to False in all configuration files to avoid using simulation time. Topic Throttling:
Frequency Adjustment: Attempted to throttle real robot sensor data frequencies to match those in simulation to rule out issues related to message frequency and Quality of Service (QoS) compatibility.
TF2 Frames Review: Utilized tf2_tools to view frame relationships, and noted the absence of a transform from map to utm, which occurs naturally in simulation (due navsat node functionality).
Regarding the data and input topics for Navsat node:
Simulation topics: gps/fix, imu and odom
Simulation Configuration File: Simulation Navsat Config File
Tf2 tree in simulation:
Real Robot Topics: real_gps/fix, imu and odom
Real Robot Configuration File: Real Robot Navsat Config File
Real Robot tf2 Frames (without force static transform)
Real Robot Tf2 frames (forcing static transform from odom to base_footprint and from map to odom)
Despite these adjustments, the costmaps fail to appear, suggesting an underlying issue possibly related to the handling or transformation of real sensor data compared to simulated data.
Another peculiar fact that I have noticed, was that for the simulation, even if I comment out all the costmap layers and observation sources, I still get the costmap (local and global produced) as the rosgraph displays below:
However for the real robot that does not happens: The footprint appears just after using the static transforms aforementioned
Finally my terminal output displays:
[navsat_transform_node-5] [INFO] [1715706152.560756579] [navsat_transform]: Datum UTM coordinate is (23K, 337662.32, 7382515.82)
[navsat_transform_node-5] [INFO] [1715706152.647946686] [navsat_transform]: Datum (latitude, longitude, altitude) is (-23.66, -46.59, 0.00)
[navsat_transform_node-5] [INFO] [1715706152.648044421] [navsat_transform]: Datum UTM coordinate is (23K, 337662.33, 7382515.82)
[navsat_transform_node-5] [INFO] [1715706152.763398716] [navsat_transform]: Datum (latitude, longitude, altitude) is (-23.66, -46.59, 0.00)
[navsat_transform_node-5] [INFO] [1715706152.763495528] [navsat_transform]: Datum UTM coordinate is (23K, 337662.35, 7382515.84)
[navsat_transform_node-5] [INFO] [1715706152.911031377] [navsat_transform]: Datum (latitude, longitude, altitude) is (-23.66, -46.59, 0.00)
[navsat_transform_node-5] [INFO] [1715706152.911162837] [navsat_transform]: Datum UTM coordinate is (23K, 337662.37, 7382515.85)
Terminal split about loading the costmap server:
ypoint_follower-11] Waiting on external lifecycle transitions to activate
[waypoint_follower-11] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[navsat_transform_node-5] [WARN] [1715705945.673438182] [navsat_transform]: Parameter 'broadcast_utm_transform' has been deprecated. Please use 'broadcast_cartesian_transform' instead.
[lifecycle_manager-13] [INFO] [1715705945.690438919] [lifecycle_manager_navigation]: Creating and initializing lifecycle service clients
[bt_navigator-10] [INFO] [1715705945.693353608] [bt_navigator]:
[bt_navigator-10] bt_navigator lifecycle node launched.
[bt_navigator-10] Waiting on external lifecycle transitions to activate
[bt_navigator-10] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[waypoint_follower-11] [INFO] [1715705945.696551544] [waypoint_follower]: Creating
[planner_server-8] [INFO] [1715705945.707314098] [planner_server]:
[planner_server-8] planner_server lifecycle node launched.
[planner_server-8] Waiting on external lifecycle transitions to activate
[planner_server-8] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[ekf_node-4] [ERROR] [1715705945.713663272] [ekf_filter_node_map]: Warning: /imu is listed as an input topic, but all its update variables are false
[smoother_server-7] [INFO] [1715705945.715879221] [smoother_server]:
[smoother_server-7] smoother_server lifecycle node launched.
[smoother_server-7] Waiting on external lifecycle transitions to activate
[smoother_server-7] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[behavior_server-9] [INFO] [1715705945.732727322] [behavior_server]:
[behavior_server-9] behavior_server lifecycle node launched.
[behavior_server-9] Waiting on external lifecycle transitions to activate
[behavior_server-9] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[controller_server-6] [INFO] [1715705945.781287149] [controller_server]:
[controller_server-6] controller_server lifecycle node launched.
[controller_server-6] Waiting on external lifecycle transitions to activate
[controller_server-6] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[smoother_server-7] [INFO] [1715705945.853210743] [smoother_server]: Creating smoother server
[bt_navigator-10] [INFO] [1715705945.853220797] [bt_navigator]: Creating
[planner_server-8] [INFO] [1715705945.853245434] [planner_server]: Creating
[controller_server-6] [INFO] [1715705945.869668582] [controller_server]: Creating controller server
[planner_server-8] [INFO] [1715705945.873923819] [global_costmap.global_costmap]:
[planner_server-8] global_costmap lifecycle node launched.
[planner_server-8] Waiting on external lifecycle transitions to activate
[planner_server-8] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[controller_server-6] [INFO] [1715705945.887981981] [local_costmap.local_costmap]:
[controller_server-6] local_costmap lifecycle node launched.
[controller_server-6] Waiting on external lifecycle transitions to activate
[controller_server-6] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[planner_server-8] [INFO] [1715705945.889000442] [global_costmap.global_costmap]: Creating Costmap
[lifecycle_manager-13] [INFO] [1715705945.890103671] [lifecycle_manager_navigation]: Starting managed nodes bringup...
[lifecycle_manager-13] [INFO] [1715705945.890139528] [lifecycle_manager_navigation]: Configuring controller_server
[controller_server-6] [INFO] [1715705945.890181386] [local_costmap.local_costmap]: Creating Costmap
[controller_server-6] [INFO] [1715705946.390705429] [controller_server]: Configuring controller interface
[controller_server-6] [INFO] [1715705946.390727834] [controller_server]: getting progress checker plugins..
[controller_server-6] [INFO] [1715705946.391641374] [controller_server]: getting goal checker plugins..
[controller_server-6] [INFO] [1715705946.391748519] [controller_server]: Controller frequency set to 50.0000Hz
[controller_server-6] [INFO] [1715705946.391784022] [local_costmap.local_costmap]: Configuring
[controller_server-6] [INFO] [1715705946.399514949] [local_costmap.local_costmap]: Using plugin "voxel_layer"
[controller_server-6] [INFO] [1715705946.418999573] [local_costmap.local_costmap]: Subscribed to Topics: left/left_scan right/right_scan /scanner/cloud
[controller_server-6] [INFO] [1715705946.449567279] [local_costmap.local_costmap]: Initialized plugin "voxel_layer"
[controller_server-6] [INFO] [1715705946.449594160] [local_costmap.local_costmap]: Using plugin "inflation_layer"
[controller_server-6] [INFO] [1715705946.450367695] [local_costmap.local_costmap]: Initialized plugin "inflation_layer"
[controller_server-6] [INFO] [1715705946.463645169] [controller_server]: Created progress_checker : progress_checker of type nav2_controller::SimpleProgressChecker
[controller_server-6] [INFO] [1715705946.463922242] [controller_server]: Controller Server has progress_checker progress checkers available.
[controller_server-6] [WARN] [1715705946.464266130] [pluginlib.ClassLoader]: given plugin name 'libfront_cabin_goal_checker' should be 'front_cabin_goal_checker' for better portability
[controller_server-6] [INFO] [1715705946.465526861] [controller_server]: Created goal checker : front_cabin_goal_checker of type nav2_bringup/FrontCabinGoalChecker
[controller_server-6] [INFO] [1715705946.465560001] [controller_server]: Loaded xy_goal_tolerance: 1.500000
[controller_server-6] [INFO] [1715705946.465569450] [controller_server]: Loaded yaw_goal_tolerance: 0.250000
[controller_server-6] [INFO] [1715705946.465574471] [controller_server]: Loaded front_offset: 5.000000
[controller_server-6] [INFO] [1715705946.465580397] [controller_server]: Controller Server has front_cabin_goal_checker goal checkers available.
[controller_server-6] [INFO] [1715705946.475983109] [controller_server]: Created controller : FollowPath of type nav2_mppi_controller::MPPIController
[controller_server-6] [INFO] [1715705946.478360161] [controller_server]: Controller period is equal to model dt. Control sequence shifting is ON
[controller_server-6] [INFO] [1715705946.496015618] [controller_server]: Critic loaded : mppi::critics::PathFollowCritic
[controller_server-6] [INFO] [1715705946.496638923] [controller_server]: ObstaclesCritic instantiated with 1 power and 35.000000 / 1.000000 weights. Critic will collision check based on footprint cost.
[controller_server-6] [INFO] [1715705946.496664030] [controller_server]: Critic loaded : mppi::critics::ObstaclesCritic
[controller_server-6] [INFO] [1715705946.497411503] [controller_server]: ReferenceTrajectoryCritic instantiated with 2 power and 10.000000 weight
[controller_server-6] [INFO] [1715705946.497649139] [controller_server]: Critic loaded : mppi::critics::PathAlignCritic
[controller_server-6] [INFO] [1715705946.498421300] [controller_server]: PathAngleCritic instantiated with 2 power and 3.600000 weight. Mode set to: Consider Feasible Path Orientations
[controller_server-6] [INFO] [1715705946.498449098] [controller_server]: Critic loaded : mppi::critics::PathAngleCritic
[controller_server-6] [INFO] [1715705946.504617861] [controller_server]: Optimizer reset
[controller_server-6] [INFO] [1715705946.509008386] [MPPIController]: Configured MPPI Controller: FollowPath
[controller_server-6] [INFO] [1715705946.509033605] [controller_server]: Controller Server has FollowPath controllers available.
[lifecycle_manager-13] [INFO] [1715705946.518091827] [lifecycle_manager_navigation]: Configuring smoother_server
[smoother_server-7] [INFO] [1715705946.518253214] [smoother_server]: Configuring smoother server
[smoother_server-7] [INFO] [1715705946.533303127] [smoother_server]: Created smoother : simple_smoother of type nav2_smoother::SimpleSmoother
[smoother_server-7] [INFO] [1715705946.534196225] [smoother_server]: Smoother Server has simple_smoother smoothers available.
[lifecycle_manager-13] [INFO] [1715705946.539797209] [lifecycle_manager_navigation]: Configuring planner_server
[planner_server-8] [INFO] [1715705946.540002773] [planner_server]: Configuring
[planner_server-8] [INFO] [1715705946.540033696] [global_costmap.global_costmap]: Configuring
[planner_server-8] [INFO] [1715705946.547330081] [global_costmap.global_costmap]: Using plugin "obstacle_layer"
[planner_server-8] [INFO] [1715705946.553351765] [global_costmap.global_costmap]: Subscribed to Topics: left/left_scan right/right_scan /scanner/cloud
[planner_server-8] [INFO] [1715705946.564061955] [global_costmap.global_costmap]: Initialized plugin "obstacle_layer"
[planner_server-8] [INFO] [1715705946.564087934] [global_costmap.global_costmap]: Using plugin "inflation_layer"
[planner_server-8] [INFO] [1715705946.564900006] [global_costmap.global_costmap]: Initialized plugin "inflation_layer"
[planner_server-8] [INFO] [1715705946.616520457] [planner_server]: Created global planner plugin GridBased of type nav2_smac_planner/SmacPlannerHybrid
[planner_server-8] [INFO] [1715705946.616560637] [planner_server]: Configuring GridBased of type SmacPlannerHybrid
[planner_server-8] [INFO] [1715705946.639644114] [planner_server]: Configured plugin GridBased of type SmacPlannerHybrid with maximum iterations 1000000, max on approach iterations 1000, and allowing unknown traversal. Tolerance 2.00.Using motion model: Dubin.
Questions:
- Could the absence of certain transforms, such as map to utm, critically impact the functionality of the costmap generation?
- Are there additional configurations or ROS2 parameters that might need adjustment when transitioning from simulation to real environments?
- What diagnostic steps would you recommend to further isolate or resolve the issue with the missing costmaps?
- The urdf parsed for Robot Localization is the same as the one I used for simulation (contain the gazebo plugins: ackerman and other sensors related) should I remove the gazebo plugins and use a new urdf for the robot model?