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.
|
#include <pure_pursuit_wrapper.hpp>
Public Member Functions | |
PurePursuitWrapperNode (const rclcpp::NodeOptions &options) | |
Constructor. More... | |
autoware_msgs::msg::ControlCommandStamped | generate_command () override |
Extending class provided method which should generate a command message which will be published to the required topic by the base class. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Example callback for dynamic parameter updates. More... | |
carma_ros2_utils::CallbackReturn | on_configure_plugin () override |
This method should be used to load parameters and will be called on the configure state transition. More... | |
bool | get_availability () override |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes. More... | |
std::string | get_version_id () override |
Returns the version id of this plugin. More... | |
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > | remove_repeated_timestamps (const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &traj_points) |
Drops any points that sequentially have same target_time and return new trajectory_points in order to avoid divide by zero situation. More... | |
motion::motion_common::State | convert_state (geometry_msgs::msg::PoseStamped pose, geometry_msgs::msg::TwistStamped twist) |
autoware_msgs::msg::ControlCommandStamped | convert_cmd (motion::motion_common::Command cmd) |
Public Member Functions inherited from carma_guidance_plugins::ControlPlugin | |
ControlPlugin (const rclcpp::NodeOptions &) | |
ControlPlugin constructor. More... | |
virtual | ~ControlPlugin ()=default |
Virtual destructor for safe deletion. More... | |
virtual autoware_msgs::msg::ControlCommandStamped | generate_command ()=0 |
Extending class provided method which should generate a command message which will be published to the required topic by the base class. More... | |
std::string | get_capability () override |
Get the capability string representing this plugins capabilities Method must be overriden by extending classes. Expectation is that abstract plugin type parent classes will provide a default implementation. More... | |
uint8_t | get_type () override final |
Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum. Extending classes for the specific type should override this method. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_deactivate (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_cleanup (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_shutdown (const rclcpp_lifecycle::State &) override final |
carma_ros2_utils::CallbackReturn | handle_on_error (const rclcpp_lifecycle::State &, const std::string &exception_string) override final |
Public Member Functions inherited from carma_guidance_plugins::PluginBaseNode | |
PluginBaseNode (const rclcpp::NodeOptions &) | |
PluginBaseNode constructor. More... | |
virtual | ~PluginBaseNode ()=default |
Virtual destructor for safe deletion. More... | |
virtual std::shared_ptr< carma_wm::WMListener > | get_world_model_listener () final |
Method to return the default world model listener provided as a convience by this base class If this method or get_world_model() are not called then the world model remains uninitialized and will not create unnecessary subscriptions. More... | |
virtual carma_wm::WorldModelConstPtr | get_world_model () final |
Method to return the default world model provided as a convience by this base class If this method or get_world_model_listener() are not called then the world model remains uninitialized and will not create unnecessary subscriptions. More... | |
virtual bool | get_activation_status () final |
Returns the activation status of this plugin. The plugins API callbacks will only be triggered when this method returns true. More... | |
virtual uint8_t | get_type () |
Returns the type of this plugin according to the carma_planning_msgs::Plugin type enum. Extending classes for the specific type should override this method. More... | |
std::string | get_plugin_name_and_ns () const |
Return the name of this plugin with namespace. NOTE: If only the name of the plugin is required, use get_plugin_name() More... | |
std::string | get_plugin_name () const |
Return the name of this plugin. More... | |
virtual bool | get_availability ()=0 |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes. More... | |
virtual std::string | get_capability ()=0 |
Get the capability string representing this plugins capabilities Method must be overriden by extending classes. Expectation is that abstract plugin type parent classes will provide a default implementation. More... | |
virtual std::string | get_version_id ()=0 |
Returns the version id of this plugin. More... | |
virtual carma_ros2_utils::CallbackReturn | on_configure_plugin ()=0 |
Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states. This method should be used to load parameters and is required to be implemented. More... | |
virtual carma_ros2_utils::CallbackReturn | on_activate_plugin () |
Method which is triggered when this plugin is moved from the INACTIVE to ACTIVE states. This method should be used to prepare for future callbacks for plugin's capabilites. More... | |
virtual carma_ros2_utils::CallbackReturn | on_deactivate_plugin () |
Method which is triggered when this plugin is moved from the ACTIVE to INACTIVE states. This method should be used to disable any functionality which should cease execution when plugin is inactive. More... | |
virtual carma_ros2_utils::CallbackReturn | on_cleanup_plugin () |
Method which is triggered when this plugin is moved from the INACTIVE to UNCONFIGURED states. This method should be used to fully reset the plugin such that a future call to on_configure_plugin would leave the plugin in a fresh state as though just launched. More... | |
virtual carma_ros2_utils::CallbackReturn | on_shutdown_plugin () |
Method which is triggered when this plugin is moved from any state to FINALIZED This method should be used to generate any shutdown logs or final cleanup. More... | |
virtual carma_ros2_utils::CallbackReturn | on_error_plugin (const std::string &exception_string) |
Method which is triggered when an unhandled exception occurs in this plugin This method should be used to cleanup such that the plugin could be moved to UNCONFIGURED state if possible. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_deactivate (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_cleanup (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_shutdown (const rclcpp_lifecycle::State &) override |
carma_ros2_utils::CallbackReturn | handle_on_error (const rclcpp_lifecycle::State &, const std::string &exception_string) override |
FRIEND_TEST (carma_guidance_plugins_test, connections_test) | |
Private Member Functions | |
std::shared_ptr< pure_pursuit::PurePursuit > | get_pure_pursuit_worker () |
FRIEND_TEST (PurePursuitTest, sanity_check) | |
Private Attributes | |
PurePursuitWrapperConfig | config_ |
std::shared_ptr< pure_pursuit::PurePursuit > | pp_ |
Additional Inherited Members | |
Protected Member Functions inherited from carma_guidance_plugins::ControlPlugin | |
void | current_pose_callback (geometry_msgs::msg::PoseStamped::UniquePtr msg) |
void | current_twist_callback (geometry_msgs::msg::TwistStamped::UniquePtr msg) |
virtual void | current_trajectory_callback (carma_planning_msgs::msg::TrajectoryPlan::UniquePtr msg) |
Extending class provided method which can optionally handle trajectory plan callbacks. More... | |
Protected Attributes inherited from carma_guidance_plugins::ControlPlugin | |
boost::optional< geometry_msgs::msg::PoseStamped > | current_pose_ |
The most recent pose message received by this node. More... | |
boost::optional< geometry_msgs::msg::TwistStamped > | current_twist_ |
The most recent velocity message received by this node. More... | |
boost::optional< carma_planning_msgs::msg::TrajectoryPlan > | current_trajectory_ |
The most recent trajectory received by this plugin. More... | |
Definition at line 37 of file pure_pursuit_wrapper.hpp.
|
explicit |
Constructor.
Definition at line 27 of file pure_pursuit_wrapper.cpp.
References config_, pure_pursuit_wrapper::PurePursuitWrapperConfig::dist_front_rear_wheels, pure_pursuit_wrapper::PurePursuitWrapperConfig::dt, pure_pursuit_wrapper::PurePursuitWrapperConfig::emergency_stop_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::integrator_max_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::integrator_min_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_delay_compensation, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_integrator_enabled, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_interpolate_lookahead_point, pure_pursuit_wrapper::PurePursuitWrapperConfig::Ki_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::maximum_lookahead_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::minimum_lookahead_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_thres_traveling_direction, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_to_lookahead_ratio, and pure_pursuit_wrapper::PurePursuitWrapperConfig::vehicle_response_lag.
autoware_msgs::msg::ControlCommandStamped pure_pursuit_wrapper::PurePursuitWrapperNode::convert_cmd | ( | motion::motion_common::Command | cmd | ) |
Definition at line 114 of file pure_pursuit_wrapper.cpp.
References carma_cooperative_perception::to_string().
Referenced by generate_command().
motion::motion_common::State pure_pursuit_wrapper::PurePursuitWrapperNode::convert_state | ( | geometry_msgs::msg::PoseStamped | pose, |
geometry_msgs::msg::TwistStamped | twist | ||
) |
Definition at line 100 of file pure_pursuit_wrapper.cpp.
Referenced by generate_command().
|
private |
|
overridevirtual |
Extending class provided method which should generate a command message which will be published to the required topic by the base class.
NOTE: Implementer can determine if trajectory has changed based on current_trajectory_->trajectory_id
Implements carma_guidance_plugins::ControlPlugin.
Definition at line 132 of file pure_pursuit_wrapper.cpp.
References config_, convert_cmd(), convert_state(), carma_guidance_plugins::ControlPlugin::current_pose_, carma_guidance_plugins::ControlPlugin::current_trajectory_, carma_guidance_plugins::ControlPlugin::current_twist_, pp_, basic_autonomy::waypoint_generation::process_trajectory_plan(), and pure_pursuit_wrapper::PurePursuitWrapperConfig::vehicle_response_lag.
|
overridevirtual |
Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 187 of file pure_pursuit_wrapper.cpp.
|
inlineprivate |
|
overridevirtual |
Returns the version id of this plugin.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 192 of file pure_pursuit_wrapper.cpp.
|
overridevirtual |
This method should be used to load parameters and will be called on the configure state transition.
Implements carma_guidance_plugins::PluginBaseNode.
Definition at line 49 of file pure_pursuit_wrapper.cpp.
References config_, pure_pursuit_wrapper::PurePursuitWrapperConfig::dist_front_rear_wheels, pure_pursuit_wrapper::PurePursuitWrapperConfig::dt, pure_pursuit_wrapper::PurePursuitWrapperConfig::emergency_stop_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::integrator_max_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::integrator_min_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_delay_compensation, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_integrator_enabled, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_interpolate_lookahead_point, pure_pursuit_wrapper::PurePursuitWrapperConfig::Ki_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::maximum_lookahead_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::minimum_lookahead_distance, parameter_update_callback(), pp_, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_thres_traveling_direction, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_to_lookahead_ratio, and pure_pursuit_wrapper::PurePursuitWrapperConfig::vehicle_response_lag.
rcl_interfaces::msg::SetParametersResult pure_pursuit_wrapper::PurePursuitWrapperNode::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Example callback for dynamic parameter updates.
Definition at line 158 of file pure_pursuit_wrapper.cpp.
References config_, pure_pursuit_wrapper::PurePursuitWrapperConfig::dist_front_rear_wheels, pure_pursuit_wrapper::PurePursuitWrapperConfig::emergency_stop_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::integrator_max_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::integrator_min_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_delay_compensation, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_integrator_enabled, pure_pursuit_wrapper::PurePursuitWrapperConfig::is_interpolate_lookahead_point, pure_pursuit_wrapper::PurePursuitWrapperConfig::Ki_pp, pure_pursuit_wrapper::PurePursuitWrapperConfig::maximum_lookahead_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::minimum_lookahead_distance, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_thres_traveling_direction, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_to_lookahead_ratio, and pure_pursuit_wrapper::PurePursuitWrapperConfig::vehicle_response_lag.
Referenced by on_configure_plugin().
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > pure_pursuit_wrapper::PurePursuitWrapperNode::remove_repeated_timestamps | ( | const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > & | traj_points | ) |
Drops any points that sequentially have same target_time and return new trajectory_points in order to avoid divide by zero situation.
traj_points | Velocity profile to shift. The first point should be the current vehicle speed |
NOTE: This function assumes the target_time will not go backwards. In other words, it only removes "sequential" points that have same target_time
Definition at line 197 of file pure_pursuit_wrapper.cpp.
References process_traj_logs::point.
|
private |
Definition at line 78 of file pure_pursuit_wrapper.hpp.
Referenced by PurePursuitWrapperNode(), generate_command(), on_configure_plugin(), and parameter_update_callback().
|
private |
Definition at line 80 of file pure_pursuit_wrapper.hpp.
Referenced by generate_command(), get_pure_pursuit_worker(), and on_configure_plugin().