Class CompassFilter
Defined in File message_filter.hpp
Inheritance Relationships
Base Type
public message_filters::SimpleFilter< compass_interfaces::msg::Azimuth >
Class Documentation
-
class CompassFilter : public message_filters::SimpleFilter<compass_interfaces::msg::Azimuth>
Message filter to convert between various compass representations.
Example usage:
message_filters::UniversalAzimuthSubscriber azimuthInput(...); message_filters::Subscriber<sensor_msgs::msg::NavSatFix> fixInput(...); auto converter = std::make_shared<compass_conversions::CompassConverter>(log, true); // converter->configFromParams(params); compass_conversions::CompassFilter filter(log, converter, azimuthInput, fixInput, compass_interfaces::msg::Azimuth::UNIT_RAD, compass_interfaces::msg::Azimuth::ORIENTATION_ENU, compass_interfaces::msg::Azimuth::REFERENCE_GEOGRAPHIC); filter.registerCallback([](const compass_interfaces::msg::AzimuthConstSharedPtr& msg) { ... // Handle the data });
See also
Public Types
-
using NodeClockInterface = rclcpp::node_interfaces::NodeClockInterface
-
using NodeGraphInterface = rclcpp::node_interfaces::NodeGraphInterface
-
using NodeLoggingInterface = rclcpp::node_interfaces::NodeLoggingInterface
-
using NodeParametersInterface = rclcpp::node_interfaces::NodeParametersInterface
-
using NodeTopicsInterface = rclcpp::node_interfaces::NodeTopicsInterface
-
using RequiredInterfaces = rclcpp::node_interfaces::NodeInterfaces<NodeClockInterface, NodeGraphInterface, NodeLoggingInterface, NodeParametersInterface, NodeTopicsInterface>
-
typedef message_filters::MessageEvent<compass_interfaces::msg::Azimuth const> AzimuthEventType
-
typedef message_filters::MessageEvent<sensor_msgs::msg::NavSatFix const> FixEventType
-
typedef message_filters::MessageEvent<std_msgs::msg::Int32 const> UTMZoneEventType
-
using Unit = compass_interfaces::msg::Azimuth::_unit_type
-
using Orientation = compass_interfaces::msg::Azimuth::_orientation_type
-
using Reference = compass_interfaces::msg::Azimuth::_reference_type
-
using Variance = compass_interfaces::msg::Azimuth::_variance_type
Public Functions
Construct azimuth filter that can convert all parameters.
- Template Parameters:
AzimuthInput – The type of the input filter.
FixInput – The type of the navsat fix filter.
UTMZoneInput – The type of the UTM Zone filter.
- Parameters:
node – [in] The node to use.
converter – [in] The azimuth converter instance. If nullptr, a default converter is constructed.
azimuthInput – [in] The message filter producing azimuth messages.
fixInput – [in] The message filter producing fix messages.
utmZoneInput – [in] The message filter producing UTM zone messages.
unit – [in] The output azimuth unit.
orientation – [in] The output azimuth orientation.
reference – [in] The output azimuth reference.
Construct azimuth filter that can convert all parameters.
- Template Parameters:
AzimuthInput – The type of the input filter.
FixInput – The type of the navsat fix filter.
- Parameters:
node – [in] The node to use.
converter – [in] The azimuth converter instance. If nullptr, a default converter is constructed.
azimuthInput – [in] The message filter producing azimuth messages.
fixInput – [in] The message filter producing fix messages.
unit – [in] The output azimuth unit.
orientation – [in] The output azimuth orientation.
reference – [in] The output azimuth reference.
Construct azimuth filter that can only convert units and orientation.
- Template Parameters:
AzimuthInput – The type of the input filter.
- Parameters:
node – [in] The node to use.
converter – [in] The azimuth converter instance. If nullptr, a default converter is constructed.
azimuthInput – [in] The message filter producing azimuth messages.
unit – [in] The output azimuth unit.
orientation – [in] The output azimuth orientation.
reference – [in] The output azimuth reference.
-
virtual ~CompassFilter()
-
template<class AzimuthInput>
inline void connectAzimuthInput(AzimuthInput &f)
-
template<class UTMZoneInput>
inline void connectUTMZoneInput(UTMZoneInput &f)
Protected Functions
-
virtual void cbAzimuth(const AzimuthEventType &azimuthEvent)
-
virtual void cbFix(const FixEventType &fixEvent)
-
virtual void cbUTMZone(const UTMZoneEventType &utmZoneEvent)
Protected Attributes
-
message_filters::Connection azimuthConnection
Connection to the azimuth input.
-
message_filters::Connection fixConnection
Connection to the navsat fix input.
-
message_filters::Connection utmZoneConnection
Connection to the UTM zone input.
-
std::shared_ptr<CompassConverter> converter
The compass converter instance.
-
bool fixReceived = {false}
Whether at least one navsat fix message has been received.
-
Orientation orientation
The target azimuth orientation.
-
RequiredInterfaces node
-
using NodeClockInterface = rclcpp::node_interfaces::NodeClockInterface