A localization method implementing a simplified AMCL (Adaptive Monte Carlo Localization) approach.
More...
#include <AMCLLocalizer.hpp>
|
| | AMCLLocalizer () |
| | Default constructor.
|
| | AMCLLocalizer () |
| | Default constructor.
|
| nav_msgs::msg::Odometry | get_pose () |
| | Gets the current estimated pose as an Odometry message.
|
| nav_msgs::msg::Odometry | get_pose () |
| | Gets the current estimated pose as an Odometry message.
|
| tf2::Transform | getEstimatedPose () const |
| | Gets the current estimated pose as a transform.
|
| tf2::Transform | getEstimatedPose () const |
| | Gets the current estimated pose as a transform.
|
| virtual void | on_initialize () override |
| | Initializes the localization method.
|
| virtual void | on_initialize () override |
| | Initializes the localization method.
|
| void | update (NavState &nav_state) override |
| | General update of the localization state.
|
| void | update (NavState &nav_state) override |
| | General update of the localization state.
|
| void | update_rt (NavState &nav_state) override |
| | Real-time update of the localization state.
|
| void | update_rt (NavState &nav_state) override |
| | Real-time update of the localization state.
|
| | ~AMCLLocalizer () |
| | Destructor.
|
| | ~AMCLLocalizer () |
| | Destructor.
|
|
| void | correct (NavState &nav_state) |
| | Applies the sensor model to update particle weights.
|
| void | correct (NavState &nav_state) |
| | Applies the sensor model to update particle weights.
|
| void | init_pose_callback (geometry_msgs::msg::PoseWithCovarianceStamped::UniquePtr msg) |
| | Callback for receiving the initial pose.
|
| void | initializeParticles () |
| | Initializes the set of particles.
|
| void | initializeParticles () |
| | Initializes the set of particles.
|
| void | odom_callback (nav_msgs::msg::Odometry::UniquePtr msg) |
| | Callback for receiving odometry updates.
|
| void | odom_callback (nav_msgs::msg::Odometry::UniquePtr msg) |
| | Callback for receiving odometry updates.
|
| void | predict (NavState &nav_state) |
| | Applies the motion model to update particle poses.
|
| void | predict (NavState &nav_state) |
| | Applies the motion model to update particle poses.
|
| void | publishEstimatedPose (const tf2::Transform &est_pose) |
| | Publishes the estimated pose with covariance.
|
| void | publishEstimatedPose (const tf2::Transform &est_pose) |
| | Publishes the estimated pose with covariance.
|
| void | publishParticles () |
| | Publishes the current set of particles.
|
| void | publishParticles () |
| | Publishes the current set of particles.
|
| void | publishTF (const tf2::Transform &map2bf) |
| | Publishes a TF transform between map and base footprint.
|
| void | publishTF (const tf2::Transform &map2bf) |
| | Publishes a TF transform between map and base footprint.
|
| void | reseed () |
| | Re-initializes the particle cloud if necessary.
|
| void | reseed () |
| | Re-initializes the particle cloud if necessary.
|
| void | update_odom_from_tf () |
| | Update odom from TFs instead of a odom topic.
|
|
| bool | compute_odom_from_tf_ {false} |
| | Whether to use TFs to compute odom.
|
| rclcpp::Publisher< geometry_msgs::msg::PoseWithCovarianceStamped >::SharedPtr | estimate_pub_ |
| | Publisher for the estimated robot pose with covariance.
|
| rclcpp::Subscription< geometry_msgs::msg::PoseWithCovarianceStamped >::SharedPtr | init_pose_sub_ |
| | Subscriber for the initial pose.
|
| bool | initialized_odom_ = false |
| | Flag indicating if the odometry has been initialized.
|
| rclcpp::Time | last_input_time_ |
| | Timestamp of the last input message (odometry or initial pose).
|
| tf2::Transform | last_odom_ {tf2::Transform::getIdentity()} |
| | Previous odometry transform (used to compute deltas).
|
| rclcpp::Time | last_reseed_ |
| | Timestamp of the last reseed event.
|
| double | min_noise_xy_ {0.05} |
| | Minimum translation noise threshold.
|
| double | min_noise_yaw_ {0.05} |
| | Minimum yaw noise threshold.
|
| double | noise_rotation_ {0.01} |
| | Rotational noise standard deviation.
|
| double | noise_translation_ {0.01} |
| | Translational noise standard deviation.
|
| double | noise_translation_to_rotation_ {0.01} |
| | Coupling noise between translation and rotation.
|
| tf2::Transform | odom_ {tf2::Transform::getIdentity()} |
| | Last odometry transform received.
|
| rclcpp::Subscription< nav_msgs::msg::Odometry >::SharedPtr | odom_sub_ |
| | Subscriber for odometry messages.
|
| std::vector< Particle > | particles_ |
| | List of particles representing the belief distribution.
|
| rclcpp::Publisher< geometry_msgs::msg::PoseArray >::SharedPtr | particles_pub_ |
| | Publisher for visualization of the particle cloud.
|
| nav_msgs::msg::Odometry | pose_ |
| | Current estimated odometry-based pose.
|
| double | reseed_time_ |
| | Time interval (in seconds) after which the particles should be reseeded.
|
| std::mt19937 | rng_ |
| | Random number generator used for sampling noise.
|
| std::default_random_engine | rng_ |
| | Random number generator used for sampling noise.
|
| std::unique_ptr< tf2_ros::TransformBroadcaster > | tf_broadcaster_ |
| | TF broadcaster to publish map to base_footprint transform.
|
A localization method implementing a simplified AMCL (Adaptive Monte Carlo Localization) approach.
◆ AMCLLocalizer() [1/2]
◆ ~AMCLLocalizer() [1/2]
◆ AMCLLocalizer() [2/2]
◆ ~AMCLLocalizer() [2/2]
◆ correct() [1/2]
| void correct |
( |
NavState & | nav_state | ) |
|
|
protected |
Applies the sensor model to update particle weights.
- Parameters
-
| nav_state | The current navigation state. |
◆ correct() [2/2]
| void correct |
( |
NavState & | nav_state | ) |
|
|
protected |
Applies the sensor model to update particle weights.
- Parameters
-
| nav_state | The current navigation state. |
◆ get_pose() [1/2]
| nav_msgs::msg::Odometry get_pose |
( |
| ) |
|
Gets the current estimated pose as an Odometry message.
- Returns
- A nav_msgs::msg::Odometry message containing the estimated pose.
◆ get_pose() [2/2]
| nav_msgs::msg::Odometry get_pose |
( |
| ) |
|
Gets the current estimated pose as an Odometry message.
- Returns
- A nav_msgs::msg::Odometry message containing the estimated pose.
◆ getEstimatedPose() [1/2]
| tf2::Transform getEstimatedPose |
( |
| ) |
const |
Gets the current estimated pose as a transform.
- Returns
- The transform from map to base footprint frame.
◆ getEstimatedPose() [2/2]
| tf2::Transform getEstimatedPose |
( |
| ) |
const |
Gets the current estimated pose as a transform.
- Returns
- The transform from map to base footprint frame.
◆ init_pose_callback()
| void init_pose_callback |
( |
geometry_msgs::msg::PoseWithCovarianceStamped::UniquePtr | msg | ) |
|
|
protected |
Callback for receiving the initial pose.
- Parameters
-
| msg | The incoming initial pose with covariance. |
◆ initializeParticles() [1/2]
| void initializeParticles |
( |
| ) |
|
|
protected |
Initializes the set of particles.
◆ initializeParticles() [2/2]
| void initializeParticles |
( |
| ) |
|
|
protected |
Initializes the set of particles.
◆ odom_callback() [1/2]
| void odom_callback |
( |
nav_msgs::msg::Odometry::UniquePtr | msg | ) |
|
|
protected |
Callback for receiving odometry updates.
- Parameters
-
| msg | The incoming odometry message. |
◆ odom_callback() [2/2]
| void odom_callback |
( |
nav_msgs::msg::Odometry::UniquePtr | msg | ) |
|
|
protected |
Callback for receiving odometry updates.
- Parameters
-
| msg | The incoming odometry message. |
◆ on_initialize() [1/2]
Initializes the localization method.
Sets up publishers, subscribers, and prepares the particle filter.
- Exceptions
-
| std::runtime_error | on initialization error. |
◆ on_initialize() [2/2]
| virtual void on_initialize |
( |
| ) |
|
|
overridevirtual |
Initializes the localization method.
Sets up publishers, subscribers, and prepares the particle filter.
- Exceptions
-
| std::runtime_error | if initialization fails. |
◆ predict() [1/2]
| void predict |
( |
NavState & | nav_state | ) |
|
|
protected |
Applies the motion model to update particle poses.
- Parameters
-
| nav_state | The current navigation state. |
◆ predict() [2/2]
| void predict |
( |
NavState & | nav_state | ) |
|
|
protected |
Applies the motion model to update particle poses.
- Parameters
-
| nav_state | The current navigation state. |
◆ publishEstimatedPose() [1/2]
| void publishEstimatedPose |
( |
const tf2::Transform & | est_pose | ) |
|
|
protected |
Publishes the estimated pose with covariance.
- Parameters
-
| est_pose | The estimated transform to be published. |
◆ publishEstimatedPose() [2/2]
| void publishEstimatedPose |
( |
const tf2::Transform & | est_pose | ) |
|
|
protected |
Publishes the estimated pose with covariance.
- Parameters
-
| est_pose | The estimated transform to be published. |
◆ publishParticles() [1/2]
| void publishParticles |
( |
| ) |
|
|
protected |
Publishes the current set of particles.
◆ publishParticles() [2/2]
| void publishParticles |
( |
| ) |
|
|
protected |
Publishes the current set of particles.
◆ publishTF() [1/2]
| void publishTF |
( |
const tf2::Transform & | map2bf | ) |
|
|
protected |
Publishes a TF transform between map and base footprint.
- Parameters
-
| map2bf | The transform to be published. |
◆ publishTF() [2/2]
| void publishTF |
( |
const tf2::Transform & | map2bf | ) |
|
|
protected |
Publishes a TF transform between map and base footprint.
- Parameters
-
| map2bf | The transform to be published. |
◆ reseed() [1/2]
Re-initializes the particle cloud if necessary.
◆ reseed() [2/2]
Re-initializes the particle cloud if necessary.
◆ update() [1/2]
| void update |
( |
NavState & | nav_state | ) |
|
|
override |
General update of the localization state.
May include operations not suitable for real-time execution.
- Parameters
-
| nav_state | The current navigation state (read/write). |
◆ update() [2/2]
| void update |
( |
NavState & | nav_state | ) |
|
|
override |
General update of the localization state.
May include operations not suitable for real-time execution.
- Parameters
-
| nav_state | The current navigation state (read/write). |
◆ update_odom_from_tf()
| void update_odom_from_tf |
( |
| ) |
|
|
protected |
Update odom from TFs instead of a odom topic.
◆ update_rt() [1/2]
| void update_rt |
( |
NavState & | nav_state | ) |
|
|
override |
Real-time update of the localization state.
Used for time-critical update operations.
- Parameters
-
| nav_state | The current navigation state (read/write). |
◆ update_rt() [2/2]
| void update_rt |
( |
NavState & | nav_state | ) |
|
|
override |
Real-time update of the localization state.
Used for time-critical update operations.
- Parameters
-
| nav_state | The current navigation state (read/write). |
◆ compute_odom_from_tf_
| bool compute_odom_from_tf_ {false} |
|
protected |
Whether to use TFs to compute odom.
◆ estimate_pub_
| rclcpp::Publisher< geometry_msgs::msg::PoseWithCovarianceStamped >::SharedPtr estimate_pub_ |
|
protected |
Publisher for the estimated robot pose with covariance.
◆ init_pose_sub_
| rclcpp::Subscription<geometry_msgs::msg::PoseWithCovarianceStamped>::SharedPtr init_pose_sub_ |
|
protected |
Subscriber for the initial pose.
◆ initialized_odom_
| bool initialized_odom_ = false |
|
protected |
Flag indicating if the odometry has been initialized.
◆ last_input_time_
| rclcpp::Time last_input_time_ |
|
protected |
Timestamp of the last input message (odometry or initial pose).
◆ last_odom_
| tf2::Transform last_odom_ {tf2::Transform::getIdentity()} |
|
protected |
Previous odometry transform (used to compute deltas).
◆ last_reseed_
| rclcpp::Time last_reseed_ |
|
protected |
Timestamp of the last reseed event.
◆ min_noise_xy_
| double min_noise_xy_ {0.05} |
|
protected |
Minimum translation noise threshold.
◆ min_noise_yaw_
| double min_noise_yaw_ {0.05} |
|
protected |
Minimum yaw noise threshold.
◆ noise_rotation_
| double noise_rotation_ {0.01} |
|
protected |
Rotational noise standard deviation.
◆ noise_translation_
| double noise_translation_ {0.01} |
|
protected |
Translational noise standard deviation.
◆ noise_translation_to_rotation_
| double noise_translation_to_rotation_ {0.01} |
|
protected |
Coupling noise between translation and rotation.
◆ odom_
| tf2::Transform odom_ {tf2::Transform::getIdentity()} |
|
protected |
Last odometry transform received.
◆ odom_sub_
| rclcpp::Subscription< nav_msgs::msg::Odometry >::SharedPtr odom_sub_ |
|
protected |
Subscriber for odometry messages.
◆ particles_
List of particles representing the belief distribution.
◆ particles_pub_
| rclcpp::Publisher< geometry_msgs::msg::PoseArray >::SharedPtr particles_pub_ |
|
protected |
Publisher for visualization of the particle cloud.
◆ pose_
| nav_msgs::msg::Odometry pose_ |
|
protected |
Current estimated odometry-based pose.
◆ reseed_time_
Time interval (in seconds) after which the particles should be reseeded.
◆ rng_ [1/2]
Random number generator used for sampling noise.
◆ rng_ [2/2]
| std::default_random_engine rng_ |
|
protected |
Random number generator used for sampling noise.
◆ tf_broadcaster_
| std::unique_ptr< tf2_ros::TransformBroadcaster > tf_broadcaster_ |
|
protected |
TF broadcaster to publish map to base_footprint transform.
The documentation for this class was generated from the following files:
- localizers/easynav_costmap_localizer/include/easynav_costmap_localizer/AMCLLocalizer.hpp
- localizers/easynav_simple_localizer/include/easynav_simple_localizer/AMCLLocalizer.hpp
- localizers/easynav_costmap_localizer/src/easynav_costmap_localizer/AMCLLocalizer.cpp
- localizers/easynav_simple_localizer/src/easynav_simple_localizer/AMCLLocalizer.cpp