Skip to content
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

fix(raw_vehicle_cmd_converter): inconsitent sign of braking command #1945

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions vehicle/raw_vehicle_cmd_converter/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ void RawVehicleCommandConverterNode::publishActuationCmd()
}
if (!current_twist_ptr_ || !control_cmd_ptr_ || !current_steer_ptr_) {
RCLCPP_WARN_EXPRESSION(
get_logger(), is_debugging_, "some of twist/control_cmd/steer pointer is null");
get_logger(), is_debugging_, "some pointers are null: %s, %s, %s",
!current_twist_ptr_ ? "twist" : "", !control_cmd_ptr_ ? "cmd" : "",
!current_steer_ptr_ ? "steer" : "");
return;
}
double desired_accel_cmd = 0.0;
Expand All @@ -124,9 +126,9 @@ void RawVehicleCommandConverterNode::publishActuationCmd()
if (accel_cmd_is_zero) {
desired_brake_cmd = calculateBrakeMap(vel, acc);
}
} else {
// if conversion is disabled use acceleration as brake cmd
desired_brake_cmd = (acc < 0) ? acc : 0;
} else if (acc < 0) {
// if conversion is disabled use negative acceleration as brake cmd
desired_brake_cmd = -acc;
}
if (convert_steer_cmd_) {
desired_steer_cmd = calculateSteer(vel, steer, steer_rate);
Expand Down