Description

Classes | |
| class | chrono::ros::ChROSDriverInputsHandler |
| Handler for interfacing a ChDriver to ROS via bidirectional IPC communication. More... | |
Functions | |
| chrono::ros::ChROSDriverInputsHandler::ChROSDriverInputsHandler (std::shared_ptr< chrono::vehicle::ChDriver > driver, const std::string &topic_name) | |
| Constructor with default update rate. More... | |
| chrono::ros::ChROSDriverInputsHandler::ChROSDriverInputsHandler (double update_rate, std::shared_ptr< chrono::vehicle::ChDriver > driver, const std::string &topic_name) | |
| Constructor with custom update rate. More... | |
| virtual bool | chrono::ros::ChROSDriverInputsHandler::Initialize (std::shared_ptr< ChROSInterface > interface) override |
| Initialize handler (called once at startup in main process) In IPC mode, this does nothing. More... | |
| virtual ipc::MessageType | chrono::ros::ChROSDriverInputsHandler::GetMessageType () const override |
| Get the message type of this handler. | |
| void | chrono::ros::ChROSDriverInputsHandler::ApplyInputs (double steering, double throttle, double braking) |
| Apply driver inputs received from subprocess via IPC This method is called internally by HandleIncomingMessage() More... | |
| virtual void | chrono::ros::ChROSDriverInputsHandler::HandleIncomingMessage (const ipc::Message &msg) override |
| Handle incoming IPC message from subprocess ROS subscriber Called by ChROSManager when IPC message of type DRIVER_INPUTS arrives. More... | |
| virtual bool | chrono::ros::ChROSDriverInputsHandler::SupportsIncomingMessages () const override |
| Indicates this handler receives messages from subprocess. More... | |
| virtual std::vector< uint8_t > | chrono::ros::ChROSDriverInputsHandler::GetSerializedData (double time) override |
| Send topic name to subprocess once to trigger subscriber creation First call: Returns topic name as bytes for subprocess setup Subsequent calls: Returns empty vector (no data to publish) More... | |
Function Documentation
◆ ApplyInputs()
| void chrono::ros::ChROSDriverInputsHandler::ApplyInputs | ( | double | steering, |
| double | throttle, | ||
| double | braking | ||
| ) |
Apply driver inputs received from subprocess via IPC This method is called internally by HandleIncomingMessage()
- Parameters
-
steering Steering value from ROS message throttle Throttle value from ROS message
braking Braking value from ROS message
◆ ChROSDriverInputsHandler() [1/2]
| chrono::ros::ChROSDriverInputsHandler::ChROSDriverInputsHandler | ( | double | update_rate, |
| std::shared_ptr< chrono::vehicle::ChDriver > | driver, | ||
| const std::string & | topic_name | ||
| ) |
Constructor with custom update rate.
- Parameters
-
update_rate Rate at which to apply received inputs to driver (Hz) driver Chrono vehicle driver to update with ROS commands
topic_name ROS topic to subscribe to for driver inputs
◆ ChROSDriverInputsHandler() [2/2]
| chrono::ros::ChROSDriverInputsHandler::ChROSDriverInputsHandler | ( | std::shared_ptr< chrono::vehicle::ChDriver > | driver, |
| const std::string & | topic_name | ||
| ) |
Constructor with default update rate.
- Parameters
-
driver Chrono vehicle driver to update with ROS commands topic_name ROS topic to subscribe to for driver inputs
◆ GetSerializedData()
|
overrideprotectedvirtual |
Send topic name to subprocess once to trigger subscriber creation First call: Returns topic name as bytes for subprocess setup Subsequent calls: Returns empty vector (no data to publish)
- Parameters
-
time Current simulation time (unused for subscribers)
- Returns
- Topic name bytes on first call, empty afterwards
Reimplemented from chrono::ros::ChROSHandler.
◆ HandleIncomingMessage()
|
overridevirtual |
Handle incoming IPC message from subprocess ROS subscriber Called by ChROSManager when IPC message of type DRIVER_INPUTS arrives.
Extracts DriverInputsData from message payload and applies to driver.
- Parameters
-
msg IPC message containing DriverInputsData payload
Reimplemented from chrono::ros::ChROSHandler.
◆ Initialize()
|
overridevirtual |
Initialize handler (called once at startup in main process) In IPC mode, this does nothing.
Subprocess will create the actual ROS subscriber.
Implements chrono::ros::ChROSHandler.
◆ SupportsIncomingMessages()
|
inlineoverridevirtual |
Indicates this handler receives messages from subprocess.
- Returns
- true (this is a bidirectional subscriber)
Reimplemented from chrono::ros::ChROSHandler.