Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
|
responsible for replicating behavior of control driver More...
#include <mock_controller_driver_node.hpp>
Public Member Functions | |
MockControllerDriver (const rclcpp::NodeOptions &) | |
MockControllerDriver constructor. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Callback for dynamic parameter updates. More... | |
void | publish_robot_status_callback () |
Timer callback, to publish robot status message. More... | |
bool | enable_robotic_srv (std::shared_ptr< rmw_request_id_t >, const std::shared_ptr< carma_driver_msgs::srv::SetEnableRobotic::Request > request, std::shared_ptr< carma_driver_msgs::srv::SetEnableRobotic::Response > response) |
Callback for the enable robotic service. Triggering this callback will modify the RobotEnabled message output by this driver. This service enables the robotic drive-by-wire controller. More... | |
void | vehicle_cmd_callback (const autoware_msgs::msg::VehicleCmd::UniquePtr msg) |
Callback for the vehicle command topic. This callback must be triggered at least once before the enable robotic service is called. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &prev_state) |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) |
Public Attributes | |
const std::string | robot_status_topic_ = "controller/robot_status" |
const std::string | vehicle_cmd_topic_ = "vehicle_cmd" |
const std::string | enable_robotic_srv_ = "controller/enable_robotic" |
bool | robot_active_ = false |
bool | robot_enabled_ = false |
Private Attributes | |
carma_ros2_utils::SubPtr< autoware_msgs::msg::VehicleCmd > | vehicle_cmd_sub_ |
carma_ros2_utils::PubPtr< carma_driver_msgs::msg::RobotEnabled > | robot_status_pub_ |
carma_ros2_utils::ServicePtr< carma_driver_msgs::srv::SetEnableRobotic > | enable_robotic_srvice_ |
rclcpp::TimerBase::SharedPtr | spin_timer_ |
responsible for replicating behavior of control driver
Definition at line 37 of file mock_controller_driver_node.hpp.
|
explicit |
MockControllerDriver constructor.
Definition at line 22 of file mock_controller_driver_node.cpp.
bool mock_controller_driver::MockControllerDriver::enable_robotic_srv | ( | std::shared_ptr< rmw_request_id_t > | , |
const std::shared_ptr< carma_driver_msgs::srv::SetEnableRobotic::Request > | request, | ||
std::shared_ptr< carma_driver_msgs::srv::SetEnableRobotic::Response > | response | ||
) |
Callback for the enable robotic service. Triggering this callback will modify the RobotEnabled message output by this driver. This service enables the robotic drive-by-wire controller.
request | The service request in message |
response | The service response out message |
Definition at line 65 of file mock_controller_driver_node.cpp.
References robot_active_, and robot_enabled_.
Referenced by handle_on_configure().
carma_ros2_utils::CallbackReturn mock_controller_driver::MockControllerDriver::handle_on_activate | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 48 of file mock_controller_driver_node.cpp.
References publish_robot_status_callback(), and spin_timer_.
carma_ros2_utils::CallbackReturn mock_controller_driver::MockControllerDriver::handle_on_configure | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 29 of file mock_controller_driver_node.cpp.
References enable_robotic_srv(), enable_robotic_srv_, enable_robotic_srvice_, robot_status_pub_, robot_status_topic_, vehicle_cmd_callback(), vehicle_cmd_sub_, and vehicle_cmd_topic_.
rcl_interfaces::msg::SetParametersResult mock_controller_driver::MockControllerDriver::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Callback for dynamic parameter updates.
void mock_controller_driver::MockControllerDriver::publish_robot_status_callback | ( | ) |
Timer callback, to publish robot status message.
Definition at line 81 of file mock_controller_driver_node.cpp.
References robot_active_, robot_enabled_, and robot_status_pub_.
Referenced by handle_on_activate().
void mock_controller_driver::MockControllerDriver::vehicle_cmd_callback | ( | const autoware_msgs::msg::VehicleCmd::UniquePtr | msg | ) |
Callback for the vehicle command topic. This callback must be triggered at least once before the enable robotic service is called.
msg | The vehicle command to receive |
Definition at line 60 of file mock_controller_driver_node.cpp.
References robot_enabled_.
Referenced by handle_on_configure().
const std::string mock_controller_driver::MockControllerDriver::enable_robotic_srv_ = "controller/enable_robotic" |
Definition at line 64 of file mock_controller_driver_node.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 49 of file mock_controller_driver_node.hpp.
Referenced by handle_on_configure().
bool mock_controller_driver::MockControllerDriver::robot_active_ = false |
Definition at line 67 of file mock_controller_driver_node.hpp.
Referenced by enable_robotic_srv(), and publish_robot_status_callback().
bool mock_controller_driver::MockControllerDriver::robot_enabled_ = false |
Definition at line 68 of file mock_controller_driver_node.hpp.
Referenced by enable_robotic_srv(), publish_robot_status_callback(), and vehicle_cmd_callback().
|
private |
Definition at line 45 of file mock_controller_driver_node.hpp.
Referenced by handle_on_configure(), and publish_robot_status_callback().
const std::string mock_controller_driver::MockControllerDriver::robot_status_topic_ = "controller/robot_status" |
Definition at line 58 of file mock_controller_driver_node.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 52 of file mock_controller_driver_node.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 42 of file mock_controller_driver_node.hpp.
Referenced by handle_on_configure().
const std::string mock_controller_driver::MockControllerDriver::vehicle_cmd_topic_ = "vehicle_cmd" |
Definition at line 61 of file mock_controller_driver_node.hpp.
Referenced by handle_on_configure().