Class Sender

Inheritance Relationships

Base Type

  • public rclcpp::Node

Class Documentation

class Sender : public rclcpp::Node

Abstract sender class to encode CAN frames. Needs to be extended for specific CAN messages.

Public Types

using FrameId = can_msgs::msg::Frame::_id_type
using FrameData = can_msgs::msg::Frame::_data_type
using Messages = std::unordered_map<FrameId, Message>
using DiagTask = diagnostic_updater::GenericFunctionDiagnosticTask<diagnostic_updater::DiagnosticStatusWrapper>
using DiagCompositeTask = diagnostic_updater::CompositeDiagnosticTask

Public Functions

explicit Sender(const std::string &node_name = "sender", const rclcpp::NodeOptions &options = rclcpp::NodeOptions())

Construct a new Sender object.

virtual ~Sender() = default

Destroy the Sender object.

void send_can()

Encode messages into CAN frames and send them.

Messages get_messages() const

Returns message definitions of configured CAN messages.

Protected Functions

void add_diag_task(const std::shared_ptr<diagnostic_updater::DiagnosticTask> &task)

Add diagnostic task to composite task for including it in the diagnostic updater.

Parameters:

task – Task to add

void force_diag_update()

Enforce diagnose update.

Protected Attributes

Messages messages_