Class Pose2D
Defined in File pose_2d.hpp
Inheritance Relationships
Base Type
public fuse_core::AsyncSensorModel
Class Documentation
-
class Pose2D : public fuse_core::AsyncSensorModel
An adapter-type sensor that produces absolute or relative pose constraints from information published by another node.
This sensor subscribes to a geometry_msgs::msg::PoseWithCovarianceStamped topic and converts each received message into an absolute or relative pose constraint. If the
differential
parameter is set to false (the default), the measurement will be treated as an absolute constraint. If it is set to true, consecutive measurements will be used to generate relative pose constraints.Parameters:
device_id (uuid string, default: 00000000-0000-0000-0000-000000000000) The device/robot ID to publish
device_name (string) Used to generate the device/robot ID if the device_id is not provided
queue_size (int, default: 10) The subscriber queue size for the pose messages
topic (string) The topic to which to subscribe for the pose messages (required if
subscribe
is true)differential (bool, default: false) Whether we should fuse measurements absolutely, or to create relative pose constraints using consecutive measurements.
Subscribes:
topic
(geometry_msgs::msg::PoseWithCovarianceStamped) Absolute pose information at a given timestamp
Public Types
-
using ParameterType = parameters::Pose2DParams
Public Functions
-
Pose2D()
Default constructor.
-
virtual ~Pose2D() = default
Destructor.
-
void initialize(fuse_core::node_interfaces::NodeInterfaces<ALL_FUSE_CORE_NODE_INTERFACES> interfaces, const std::string &name, fuse_core::TransactionCallback transaction_callback) override
Shadowing extension to the AsyncSensorModel::initialize call.
-
void process(const geometry_msgs::msg::PoseWithCovarianceStamped &msg)
Callback for pose messages.
- Parameters:
msg – [in] - The pose message to process
Protected Types
-
using PoseThrottledCallback = fuse_core::ThrottledMessageCallback<geometry_msgs::msg::PoseWithCovarianceStamped>
Protected Functions
-
void onInit() override
Perform any required initialization for the sensor model.
This could include things like reading from the parameter server or subscribing to topics. The class’s node handles will be properly initialized before SensorModel::onInit() is called. Spinning of the callback queue will not begin until after the call to SensorModel::onInit() completes.
-
void onStart() override
Subscribe to the input topic to start sending transactions to the optimizer.
-
void onStop() override
Unsubscribe from the input topic to stop sending transactions to the optimizer.
-
void processDifferential(const geometry_msgs::msg::PoseWithCovarianceStamped &pose, const bool validate, fuse_core::Transaction &transaction)
Process a pose message in differential mode.
- Parameters:
pose – [in] - The pose message to process in differential mode
validate – [in] - Whether to validate the pose or not
transaction – [out] - The generated variables and constraints are added to this transaction
Protected Attributes
-
fuse_core::UUID device_id_
The UUID of this device.
-
fuse_core::node_interfaces::NodeInterfaces<fuse_core::node_interfaces::Base, fuse_core::node_interfaces::Clock, fuse_core::node_interfaces::Logging, fuse_core::node_interfaces::Parameters, fuse_core::node_interfaces::Topics, fuse_core::node_interfaces::Waitables> interfaces_
Shadows AsyncSensorModel interfaces_.
-
rclcpp::Clock::SharedPtr clock_
The sensor model’s clock, for timestamping and logging.
-
rclcpp::Logger logger_
The sensor model’s logger.
-
ParameterType params_
-
geometry_msgs::msg::PoseWithCovarianceStamped::UniquePtr previous_pose_msg_
-
std::unique_ptr<tf2_ros::Buffer> tf_buffer_
-
std::unique_ptr<tf2_ros::TransformListener> tf_listener_
-
rclcpp::Subscription<geometry_msgs::msg::PoseWithCovarianceStamped>::SharedPtr sub_
-
PoseThrottledCallback throttled_callback_