A ROS node that simply forwards odometry information.
This version was migrated by Juan Francisco Rascon Crespo to ROS2 Humble distro from the original fake_localization package developed by Ioan A. Sucan which is described in ROS Wiki and whose source code is available in this GitHub repository and in ROS Noetic distro (ROS1).
The fake_localization package provides a single node, fake_localization, which substitutes for a localization system, providing a subset of the ROS API used by amcl.
This node is most frequently used during simulation as a method to provide localization based on perfect odometry in a computationally inexpensive manner.
Specifically, fake_localization converts odometry data into pose, particle cloud, and transform data of the form published by amcl.
The node fake_localization is also available as a composable node, fake_localization::FakeLocalization, which can be launched dynamically inside a ROS container and use intra-process communication.
fake_localization substitutes for a localization system, providing a subset of the ROS API used by amcl.
odom(nav_msgs::msg::Odometrymessage type)- The position of the robot as published by a simulator.
initialpose(geometry_msgs::msg::PoseWithCovarianceStampedmessage type)- Allows for setting the pose of
fake_localizationusing tools likerviz2to give a custom offset from the ground truth source being published.
- Allows for setting the pose of
amcl_pose(geometry_msgs::msg::PoseWithCovarianceStamped` message type)- Just passes through the pose reported by a simulator.
particlecloud(geometry_msgs::msg::PoseArraymessage type)- A particle cloud used to visualize the robot's pose in
rviz2.
- A particle cloud used to visualize the robot's pose in
odom_topic(string, default:"odom")- The name of the topic of the robot's odometry to be subscribed.
odom_frame_id(string, default:"odom")- The name of the odometric frame of the robot.
global_frame_id(string, default:map)- The frame in which to publish the
global_frame_id -> odometry_frame_idtransform overtf. New in 1.1.3
- The frame in which to publish the
base_frame_id(string, default:base_link)- The base frame of the robot. New in 1.1.3
delta_x(double, default: 0.0)- The x offset between the origin of the simulator coordinate frame and the map coordinate frame published by
fake_localization.
- The x offset between the origin of the simulator coordinate frame and the map coordinate frame published by
delta_y(double, default: 0.0)- The y offset between the origin of the simulator coordinate frame and the map coordinate frame published by
fake_localization.
- The y offset between the origin of the simulator coordinate frame and the map coordinate frame published by
delta_yaw(double, default: 0.0)- The yaw offset between the origin of the simulator coordinate frame and the map coordinate frame published by
fake_localization.
- The yaw offset between the origin of the simulator coordinate frame and the map coordinate frame published by
transform_tolerance(double, default: 0.1)- The default
tflag in seconds.
- The default
<global_fr> -> <odom_fr> passed on from the simulator over tf.
Please, do read the comments in the file fake_localization_ros.cpp, which are quite didactics and helpful to understand how this node works internally.