Carma-platform v4.11.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.
pure_pursuit_wrapper::PurePursuitWrapperNode Class Reference

#include <pure_pursuit_wrapper.hpp>

Inheritance diagram for pure_pursuit_wrapper::PurePursuitWrapperNode:
Inheritance graph
Collaboration diagram for pure_pursuit_wrapper::PurePursuitWrapperNode:
Collaboration graph

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 > &parameters)
 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::WMListenerget_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...
 

Detailed Description

Definition at line 37 of file pure_pursuit_wrapper.hpp.

Constructor & Destructor Documentation

◆ PurePursuitWrapperNode()

pure_pursuit_wrapper::PurePursuitWrapperNode::PurePursuitWrapperNode ( const rclcpp::NodeOptions &  options)
explicit

Constructor.

Definition at line 28 of file pure_pursuit_wrapper.cpp.

30{
31 basic_autonomy::set_logger(get_logger().get_child("basic_autonomy"));
32 config_ = PurePursuitWrapperConfig();
33 config_.vehicle_response_lag = declare_parameter<double>("vehicle_response_lag", config_.vehicle_response_lag);
34 config_.minimum_lookahead_distance = declare_parameter<double>("minimum_lookahead_distance", config_.minimum_lookahead_distance);
35 config_.maximum_lookahead_distance = declare_parameter<double>("maximum_lookahead_distance", config_.maximum_lookahead_distance);
36 config_.speed_to_lookahead_ratio = declare_parameter<double>("speed_to_lookahead_ratio", config_.speed_to_lookahead_ratio);
37 config_.is_interpolate_lookahead_point = declare_parameter<bool>("is_interpolate_lookahead_point", config_.is_interpolate_lookahead_point);
38 config_.is_delay_compensation = declare_parameter<bool>("is_delay_compensation", config_.is_delay_compensation);
39 config_.emergency_stop_distance = declare_parameter<double>("emergency_stop_distance", config_.emergency_stop_distance);
40 config_.speed_thres_traveling_direction = declare_parameter<double>("speed_thres_traveling_direction", config_.speed_thres_traveling_direction);
41 config_.dist_front_rear_wheels = declare_parameter<double>("dist_front_rear_wheels", config_.dist_front_rear_wheels);
42
43 // integrator part
44 config_.dt = declare_parameter<double>("dt", config_.dt);
45 config_.integrator_max_pp = declare_parameter<double>("integrator_max_pp", config_.integrator_max_pp);
46 config_.integrator_min_pp = declare_parameter<double>("integrator_min_pp", config_.integrator_min_pp);
47 config_.Ki_pp = declare_parameter<double>("Ki_pp", config_.Ki_pp);
48 config_.is_integrator_enabled = declare_parameter<bool>("is_integrator_enabled", config_.is_integrator_enabled);
49}
ControlPlugin base class which can be extended by user provided plugins which wish to implement the C...
void set_logger(rclcpp::Logger logger)
Replace the module-level logger used by all basic_autonomy functions.
Definition: log.cpp:33
rclcpp::Logger get_logger()
Return the module-level logger used by all basic_autonomy functions.
Definition: log.cpp:32

References config_, pure_pursuit_wrapper::PurePursuitWrapperConfig::dist_front_rear_wheels, pure_pursuit_wrapper::PurePursuitWrapperConfig::dt, pure_pursuit_wrapper::PurePursuitWrapperConfig::emergency_stop_distance, basic_autonomy::get_logger(), 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, basic_autonomy::set_logger(), pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_thres_traveling_direction, pure_pursuit_wrapper::PurePursuitWrapperConfig::speed_to_lookahead_ratio, and pure_pursuit_wrapper::PurePursuitWrapperConfig::vehicle_response_lag.

Here is the call graph for this function:

Member Function Documentation

◆ convert_cmd()

autoware_msgs::msg::ControlCommandStamped pure_pursuit_wrapper::PurePursuitWrapperNode::convert_cmd ( motion::motion_common::Command  cmd)

Definition at line 116 of file pure_pursuit_wrapper.cpp.

117{
118 autoware_msgs::msg::ControlCommandStamped return_cmd;
119 return_cmd.header.stamp = cmd.stamp;
120
121 return_cmd.cmd.linear_acceleration = cmd.long_accel_mps2;
122 return_cmd.cmd.linear_velocity = cmd.velocity_mps;
123 return_cmd.cmd.steering_angle = cmd.front_wheel_angle_rad;
124
125 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "generate_command() cmd.stamp: " << std::to_string(rclcpp::Time(cmd.stamp).seconds()));
126 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "generate_command() cmd.long_accel_mps2: " << cmd.long_accel_mps2);
127 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "generate_command() cmd.velocity_mps: " << cmd.velocity_mps);
128 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "generate_command() cmd.rear_wheel_angle_rad: " << cmd.rear_wheel_angle_rad);
129 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "generate_command() cmd.front_wheel_angle_rad: " << cmd.front_wheel_angle_rad);
130
131 return return_cmd;
132}
auto to_string(const UtmZone &zone) -> std::string
Definition: utm_zone.cpp:21

References basic_autonomy::get_logger(), and carma_cooperative_perception::to_string().

Referenced by generate_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert_state()

motion::motion_common::State pure_pursuit_wrapper::PurePursuitWrapperNode::convert_state ( geometry_msgs::msg::PoseStamped  pose,
geometry_msgs::msg::TwistStamped  twist 
)

Definition at line 102 of file pure_pursuit_wrapper.cpp.

103{
104 motion::motion_common::State state;
105 state.header = pose.header;
106 state.state.x = pose.pose.position.x;
107 state.state.y = pose.pose.position.y;
108 state.state.z = pose.pose.position.z;
109 state.state.heading.real = pose.pose.orientation.w;
110 state.state.heading.imag = pose.pose.orientation.z;
111
112 state.state.longitudinal_velocity_mps = twist.twist.linear.x;
113 return state;
114}

Referenced by generate_command().

Here is the caller graph for this function:

◆ FRIEND_TEST()

pure_pursuit_wrapper::PurePursuitWrapperNode::FRIEND_TEST ( PurePursuitTest  ,
sanity_check   
)
private

◆ generate_command()

autoware_msgs::msg::ControlCommandStamped pure_pursuit_wrapper::PurePursuitWrapperNode::generate_command ( )
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

Returns
The command message to publish

Implements carma_guidance_plugins::ControlPlugin.

Definition at line 134 of file pure_pursuit_wrapper.cpp.

135{
136 // process and save the trajectory inside pure_pursuit
137 autoware_msgs::msg::ControlCommandStamped converted_cmd;
138
140 return converted_cmd;
141
142 motion::control::controller_common::State state_tf = convert_state(current_pose_.get(), current_twist_.get());
143
144 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "Forced from frame_id: " << state_tf.header.frame_id << ", into: " << current_trajectory_.get().header.frame_id);
145
146 current_trajectory_.get().header.frame_id = state_tf.header.frame_id;
147
149
150 pp_->set_trajectory(autoware_traj_plan);
151
152 const auto cmd{pp_->compute_command(state_tf)};
153
154 converted_cmd = convert_cmd(cmd);
155
156
157 return converted_cmd;
158}
boost::optional< geometry_msgs::msg::TwistStamped > current_twist_
The most recent velocity message received by this node.
boost::optional< carma_planning_msgs::msg::TrajectoryPlan > current_trajectory_
The most recent trajectory received by this plugin.
boost::optional< geometry_msgs::msg::PoseStamped > current_pose_
The most recent pose message received by this node.
std::shared_ptr< pure_pursuit::PurePursuit > pp_
autoware_msgs::msg::ControlCommandStamped convert_cmd(motion::motion_common::Command cmd)
motion::motion_common::State convert_state(geometry_msgs::msg::PoseStamped pose, geometry_msgs::msg::TwistStamped twist)
autoware_auto_msgs::msg::Trajectory process_trajectory_plan(const carma_planning_msgs::msg::TrajectoryPlan &tp, double vehicle_response_lag)
Given a carma type of trajectory_plan, generate autoware type of trajectory accounting for speed_lag ...

References config_, convert_cmd(), convert_state(), carma_guidance_plugins::ControlPlugin::current_pose_, carma_guidance_plugins::ControlPlugin::current_trajectory_, carma_guidance_plugins::ControlPlugin::current_twist_, basic_autonomy::get_logger(), pp_, basic_autonomy::waypoint_generation::process_trajectory_plan(), and pure_pursuit_wrapper::PurePursuitWrapperConfig::vehicle_response_lag.

Here is the call graph for this function:

◆ get_availability()

bool pure_pursuit_wrapper::PurePursuitWrapperNode::get_availability ( )
overridevirtual

Get the availability status of this plugin based on the current operating environment. Method must be overriden by extending classes.

Returns
This method should return true if the plugin's current understanding of the world means it would be capable of planning or executing its capability.

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 189 of file pure_pursuit_wrapper.cpp.

190{
191 return true;
192}

◆ get_pure_pursuit_worker()

std::shared_ptr< pure_pursuit::PurePursuit > pure_pursuit_wrapper::PurePursuitWrapperNode::get_pure_pursuit_worker ( )
inlineprivate

Definition at line 82 of file pure_pursuit_wrapper.hpp.

83 {
84 return pp_;
85 }

References pp_.

◆ get_version_id()

std::string pure_pursuit_wrapper::PurePursuitWrapperNode::get_version_id ( )
overridevirtual

Returns the version id of this plugin.

Returns
The version id represented as a string

Implements carma_guidance_plugins::PluginBaseNode.

Definition at line 194 of file pure_pursuit_wrapper.cpp.

195{
196 return "v4.0";
197}

◆ on_configure_plugin()

carma_ros2_utils::CallbackReturn pure_pursuit_wrapper::PurePursuitWrapperNode::on_configure_plugin ( )
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 51 of file pure_pursuit_wrapper.cpp.

52{
53 config_ = PurePursuitWrapperConfig();
54 get_parameter<double>("vehicle_response_lag", config_.vehicle_response_lag);
55 get_parameter<double>("minimum_lookahead_distance", config_.minimum_lookahead_distance);
56 get_parameter<double>("maximum_lookahead_distance", config_.maximum_lookahead_distance);
57 get_parameter<double>("speed_to_lookahead_ratio", config_.speed_to_lookahead_ratio);
58 get_parameter<bool>("is_interpolate_lookahead_point", config_.is_interpolate_lookahead_point);
59 get_parameter<bool>("is_delay_compensation", config_.is_delay_compensation);
60 get_parameter<double>("emergency_stop_distance", config_.emergency_stop_distance);
61 get_parameter<double>("speed_thres_traveling_direction", config_.speed_thres_traveling_direction);
62 get_parameter<double>("dist_front_rear_wheels", config_.dist_front_rear_wheels);
63
64 // integrator configs
65 get_parameter<double>("dt", config_.dt);
66 get_parameter<double>("integrator_max_pp", config_.integrator_max_pp);
67 get_parameter<double>("integrator_min_pp", config_.integrator_min_pp);
68 get_parameter<double>("Ki_pp", config_.Ki_pp);
69 get_parameter<bool>("is_integrator_enabled", config_.is_integrator_enabled);
70
71 RCLCPP_INFO_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "Loaded Params: " << config_);
72
73 // Register runtime parameter update callback
74 add_on_set_parameters_callback(std::bind(&PurePursuitWrapperNode::parameter_update_callback, this, std_ph::_1));
75
76 // create config for pure_pursuit worker
77 pure_pursuit::Config cfg{
86 };
87
88 pure_pursuit::IntegratorConfig i_cfg;
89 i_cfg.dt = config_.dt;
90 i_cfg.integrator_max_pp = config_.integrator_max_pp;
91 i_cfg.integrator_min_pp = config_.integrator_min_pp;
92 i_cfg.Ki_pp = config_.Ki_pp;
93 i_cfg.integral = 0.0; // accumulator of integral starts from 0
94 i_cfg.is_integrator_enabled = config_.is_integrator_enabled;
95
96 pp_ = std::make_shared<pure_pursuit::PurePursuit>(cfg, i_cfg);
97
98 // Return success if everything initialized successfully
99 return CallbackReturn::SUCCESS;
100}
rcl_interfaces::msg::SetParametersResult parameter_update_callback(const std::vector< rclcpp::Parameter > &parameters)
Example callback for dynamic parameter updates.

References config_, pure_pursuit_wrapper::PurePursuitWrapperConfig::dist_front_rear_wheels, pure_pursuit_wrapper::PurePursuitWrapperConfig::dt, pure_pursuit_wrapper::PurePursuitWrapperConfig::emergency_stop_distance, basic_autonomy::get_logger(), 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.

Here is the call graph for this function:

◆ parameter_update_callback()

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 160 of file pure_pursuit_wrapper.cpp.

161{
162 auto error_double = update_params<double>({
163 {"vehicle_response_lag", config_.vehicle_response_lag},
164 {"minimum_lookahead_distance", config_.minimum_lookahead_distance},
165 {"maximum_lookahead_distance", config_.maximum_lookahead_distance},
166 {"speed_to_lookahead_ratio", config_.speed_to_lookahead_ratio},
167 {"emergency_stop_distance", config_.emergency_stop_distance},
168 {"speed_thres_traveling_direction", config_.speed_thres_traveling_direction},
169 {"dist_front_rear_wheels", config_.dist_front_rear_wheels},
170 {"integrator_max_pp", config_.integrator_max_pp},
171 {"integrator_min_pp", config_.integrator_min_pp},
172 {"Ki_pp", config_.Ki_pp},
173 }, parameters);
174
175 auto error_bool = update_params<bool>({
176 {"is_interpolate_lookahead_point", config_.is_interpolate_lookahead_point},
177 {"is_delay_compensation", config_.is_delay_compensation},
178 {"is_integrator_enabled", config_.is_integrator_enabled}
179 }, parameters);
180
181 rcl_interfaces::msg::SetParametersResult result;
182
183 result.successful = !error_double && !error_bool;
184
185 return result;
186}

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().

Here is the caller graph for this function:

◆ remove_repeated_timestamps()

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.

Parameters
traj_pointsVelocity 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

Returns
A new trajectory without any repeated time_stamps

Definition at line 199 of file pure_pursuit_wrapper.cpp.

200{
201
202 std::vector<carma_planning_msgs::msg::TrajectoryPlanPoint> new_traj_points;
203
204 carma_planning_msgs::msg::TrajectoryPlanPoint prev_point;
205 bool first = true;
206
207 for(auto point : traj_points){
208
209 if(first){
210 first = false;
211 prev_point = point;
212 new_traj_points.push_back(point);
213 continue;
214 }
215
216 if(point.target_time != prev_point.target_time){
217 new_traj_points.push_back(point);
218 prev_point = point;
219 }
220 else{
221 RCLCPP_DEBUG_STREAM(rclcpp::get_logger("pure_pursuit_wrapper"), "Duplicate point found");
222 }
223 }
224
225 return new_traj_points;
226
227}

References basic_autonomy::get_logger(), and process_traj_logs::point.

Here is the call graph for this function:

Member Data Documentation

◆ config_

PurePursuitWrapperConfig pure_pursuit_wrapper::PurePursuitWrapperNode::config_
private

◆ pp_

std::shared_ptr<pure_pursuit::PurePursuit> pure_pursuit_wrapper::PurePursuitWrapperNode::pp_
private

The documentation for this class was generated from the following files: