-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port platooning_control to ros2 #2377
Changes from 5 commits
b41cc12
2e7b207
5531d40
7aa4b27
39e3136
7920d09
7377dea
6262e36
ea4129d
d5f0d94
8a998cc
1615810
391b412
e4b900c
f140c49
3572383
0c7beb8
d18d40c
82d7f6b
36b9943
5bd7d5d
73c0dac
e434aaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,12 +28,12 @@ namespace carma_guidance_plugins | |
{ | ||
|
||
/** | ||
* \brief ControlPlugin base class which can be extended by user provided plugins which wish to implement the Control Plugin ROS API. | ||
* | ||
* A control plugin is responsible for generating high frequency vehicle speed and steering commands to execute the currently planned trajectory. | ||
* This plugin provides default subscribers to track the pose, velocity, and current trajectory in the system. | ||
* Extending classes must implement the generate_command() method to use that data and or additional data to plan commands at a 30Hz frequency. | ||
* | ||
* \brief ControlPlugin base class which can be extended by user provided plugins which wish to implement the Control Plugin ROS API. | ||
* | ||
* A control plugin is responsible for generating high frequency vehicle speed and steering commands to execute the currently planned trajectory. | ||
* This plugin provides default subscribers to track the pose, velocity, and current trajectory in the system. | ||
* Extending classes must implement the generate_command() method to use that data and or additional data to plan commands at a 30Hz frequency. | ||
* | ||
*/ | ||
class ControlPlugin : public PluginBaseNode | ||
{ | ||
|
@@ -53,7 +53,6 @@ namespace carma_guidance_plugins | |
// These callbacks do direct assignment into their respective member variables | ||
void current_pose_callback(geometry_msgs::msg::PoseStamped::UniquePtr msg); | ||
void current_twist_callback(geometry_msgs::msg::TwistStamped::UniquePtr msg); | ||
void current_trajectory_callback(carma_planning_msgs::msg::TrajectoryPlan::UniquePtr msg); | ||
|
||
|
||
protected: | ||
|
@@ -71,23 +70,28 @@ namespace carma_guidance_plugins | |
|
||
public: | ||
/** | ||
* \brief ControlPlugin constructor | ||
* \brief ControlPlugin constructor | ||
*/ | ||
explicit ControlPlugin(const rclcpp::NodeOptions &); | ||
|
||
//! Virtual destructor for safe deletion | ||
virtual ~ControlPlugin() = default; | ||
|
||
/** | ||
* \brief Extending class provided method which should generate a command message | ||
* \brief 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 | ||
* | ||
* | ||
* \return The command message to publish | ||
*/ | ||
*/ | ||
virtual autoware_msgs::msg::ControlCommandStamped generate_command() = 0; | ||
|
||
/** | ||
* \brief Extending class provided method which can optionally handle trajectory plan callbacks. | ||
*/ | ||
virtual void current_trajectory_callback(carma_planning_msgs::msg::TrajectoryPlan::UniquePtr msg); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think you can make the trajectory callback pure virtual, other controllers dont have their own implementation and depend on it to receive the trajectory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one won't be pure virtual (doesn't include the =0). Also i'm able to build the pure pursuit wrapper There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you are right, it was shown in multiple lanes and I thought I saw the =0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put all the callbacks in protected, can you do the same? to avoid merge conflicts? |
||
|
||
//// | ||
// Overrides | ||
//// | ||
|
@@ -102,7 +106,7 @@ namespace carma_guidance_plugins | |
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_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; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# platoon_control | ||
|
||
Platooning Control plugin which allows platooning to maintain the gap; moreover, generates longitudinal and lateral control commands to follow the trajectory. The structure of this plugin is very similar to the control plugin for IHP2, so the same design document is included here. | ||
The difference between platoon_control, and platoon_control_ihp is that the IHP plugin includes logic to open or close the gap between platoon members, to allow for a new member to join or an existing memeber to exit the platoon. | ||
The difference between platoon_control, and platoon_control_ihp is that the IHP plugin includes logic to open or close the gap between platoon members, to allow for a new member to join or an existing memeber to exit the platoon. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think we need this paragraph anymore since the control ihp will be removed. You can add a few sentences saying it includes logic from control ihp, and autoware pure pursuit |
||
|
||
Overview | ||
https://usdot-carma.atlassian.net/wiki/spaces/CUCS/pages/2392981532/Basic+Travel+and+IHP | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
standStillHeadway: 12.0 # Standstill gap between vehicles (m) | ||
maxAccel: 1.5 # Maximum acceleration absolute value used in controller filters (m/s^2) | ||
Kp: 0.4 # Proportional weight for PID controller | ||
Kd: 0.0 # Derivative Weight for PID controller | ||
Ki: 0.03 # Integral weight for PID controller | ||
maxValue: 2.0 # Max value to restrict speed adjustment at one time step (limit on delta_v) (m/s) | ||
minValue: -10.0 # Min value to restrict speed adjustment at one time step (limit on delta_v) (m/s) | ||
cmdTmestamp: 100 # Timestep to calculate ctrl commands (ms) | ||
adjustmentCap: 15.0 # Adjustment cap for speed command (m/s) | ||
stand_still_headway: 12.0 # Standstill gap between vehicles (m) | ||
max_accel: 1.5 # Maximum acceleration absolute value used in controller filters (m/s^2) | ||
MishkaMN marked this conversation as resolved.
Show resolved
Hide resolved
|
||
kp: 0.4 # Proportional weight for PID controller | ||
kd: 0.0 # Derivative Weight for PID controller | ||
ki: 0.03 # Integral weight for PID controller | ||
max_value: 2.0 # Max value to restrict speed adjustment at one time step (limit on delta_v) (m/s) | ||
min_value: -10.0 # Min value to restrict speed adjustment at one time step (limit on delta_v) (m/s) | ||
cmd_tmestamp: 100 # Timestep to calculate ctrl commands (ms) | ||
adjustment_cap: 15.0 # Adjustment cap for speed command (m/s) | ||
dt: 0.1 # Timestep to calculate ctrl commands (s) | ||
integratorMax: 30 # Max limit for integrator term | ||
integratorMin: -30 # Min limit for integrator term | ||
lowpassGain: 0.5 ##Lowpass filter gain | ||
lookaheadRatio: 2.0 # Ratio to calculate lookahead distance | ||
minLookaheadDist: 15.0 # Min lookahead distance (m) | ||
correctionAngle: 0.0 # Correction angle to improve steering accuracy | ||
integratorMax_pp: 0.1 # Max integrator val for pure pursuit integral controller | ||
integratorMin_pp: -0.1 # Min integrator val for pure pursuit integral controller | ||
Ki_pp: 0.012 # Integral weight for pure pursuit integral controller | ||
integrator_max: 30.0 # Max limit for integrator term | ||
integrator_min: -30.0 # Min limit for integrator term | ||
lowpass_gain: 0.5 ##Lowpass filter gain | ||
lookahead_ratio: 2.0 # Ratio to calculate lookahead distance | ||
min_lookahead_dist: 15.0 # Min lookahead distance (m) | ||
correction_angle: 0.0 # Correction angle to improve steering accuracy | ||
integrator_max_pp: 0.1 # Max integrator val for pure pursuit integral controller | ||
integrator_min_pp: -0.1 # Min integrator val for pure pursuit integral controller | ||
ki_pp: 0.012 # Integral weight for pure pursuit integral controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove the ihp plugin too. We wont need it