Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/state_estimation_nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ If any of your sensors produce data with timestamps that are older than the most
^^^^^^^^^^^^^^^
If ``smooth_lagged_data`` is set to *true*, this parameter specifies the number of seconds for which the filter will retain its state and measurement history. This value should be at least as large as the time delta between your lagged measurements and the current time.

~max_future_queue_size
^^^^^^^^^^^^^^^
This parameter specifies the number of total data samples, arriving between filter runs, the filter will retain. This is to ensure excessive memory is not used as would happen if incoming data is badly time stamped or the filter ``frequency`` is badly set.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "arriving between execution cycles" instead of "arriving between filter runs"? Also, could we not control this by limiting the queue sizes on the actual sensor inputs, e.g., use the existing <input name>_queue_size parameters? With this option, if you have one extremely high frequency sensor and one very low frequency sensor, it seems possible that the wrong setting here will result in one sensor getting completely ignored.


~[sensor]_nodelay
^^^^^^^^^^^^^^^^^

Expand Down
40 changes: 31 additions & 9 deletions include/robot_localization/ros_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,25 @@ class RosFilter : public rclcpp::Node
std::vector<bool> & updateVector, Eigen::VectorXd & measurement,
Eigen::MatrixXd & measurementCovariance);

//! @brief Validates incoming measurement ordering and produces errors if
//! validation does not pass.
//! @param[in] topicName - The name of the topic over which this message was
//! received
//! @param[in] stamp - The timestamp associated with this message.
//! @return true if the measrement is newer than all known measurements.
//!
bool validateMeasurementOrdering(const std::string& topicName,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how some of these other methods retained camelCase variable names, but we should try to stick to ROS 2 standards and use snake_case, e.g., topic_name.

const builtin_interfaces::msg::Time& stamp);

//! @brief Validates incoming measurements are within a reasonable timeframe.
//! @param[in] topicName - The name of the topic over which this message was
//! received
//! @param[in] stamp - The timestamp associated with this message.
//! @return true if the measrement is newer than all known measurements.
//!
bool validateMeasurementTime(const std::string& topicName,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

const builtin_interfaces::msg::Time& stamp);

//! @brief Whether or not we print diagnostic messages to the /diagnostics
//! topic
//!
Expand Down Expand Up @@ -545,14 +564,17 @@ class RosFilter : public rclcpp::Node
//!
double gravitational_acceleration_;

//! @brief The depth of the history we track for smoothing/delayed measurement
//! processing
//! @brief The depth of the history we track for smoothing/delayed
//! measurement processing
//!
//! This is the guaranteed minimum buffer size for which previous states and
//! measurements are kept.
//!
rclcpp::Duration history_length_;

//! @brief This is the maximum measurement queque length.
uint64_t max_future_queue_size_;

//! @brief tf frame name for the robot's body frame
//!
std::string base_link_frame_id_;
Expand Down Expand Up @@ -622,8 +644,8 @@ class RosFilter : public rclcpp::Node
//! @brief This object accumulates static diagnostics, e.g., diagnostics
//! relating to the configuration parameters.
//!
//! The values are treated as static and always reported (i.e., this object is
//! never cleared)
//! The values are treated as static and always reported (i.e., this object
//! is never cleared)
//!
std::map<std::string, std::string> static_diagnostics_;

Expand All @@ -646,8 +668,8 @@ class RosFilter : public rclcpp::Node
//! stores the initial measurements. Note that this is different from using
//! differential mode, as in differential mode, pose data is converted to
//! twist data, resulting in boundless error growth for the variables being
//! fused. With relative measurements, the vehicle will start with a 0 heading
//! and position, but the measurements are still fused absolutely.
//! fused. With relative measurements, the vehicle will start with a 0
//! heading and position, but the measurements are still fused absolutely.
std::map<std::string, tf2::Transform> initial_measurements_;

//! @brief If including acceleration for each IMU input, whether or not we
Expand Down Expand Up @@ -688,9 +710,9 @@ class RosFilter : public rclcpp::Node
//!
std::map<std::string, Eigen::MatrixXd> previous_measurement_covariances_;

//! @brief By default, the filter predicts and corrects up to the time of the
//! latest measurement. If this is set to true, the filter does the same, but
//! then also predicts up to the current time step.
//! @brief By default, the filter predicts and corrects up to the time of
//! the latest measurement. If this is set to true, the filter does the
//! same, but then also predicts up to the current time step.
//!
bool predict_to_current_time_;

Expand Down
1 change: 1 addition & 0 deletions src/navsat_transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ NavSatTransform::NavSatTransform(const rclcpp::NodeOptions & options)
yaw_offset_(0.0),
zero_altitude_(false)
{

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

tf_buffer_ = std::make_unique<tf2_ros::Buffer>(this->get_clock());
tf_listener_ = std::make_unique<tf2_ros::TransformListener>(*tf_buffer_);

Expand Down
Loading