Skip to content

Commit

Permalink
fix inconsitent sign of braking command
Browse files Browse the repository at this point in the history
  • Loading branch information
ralwing committed Sep 23, 2022
1 parent 1b23f84 commit f7f1e13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 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 @@ -126,7 +128,7 @@ void RawVehicleCommandConverterNode::publishActuationCmd()
}
} else {
// if conversion is disabled use acceleration as brake cmd
desired_brake_cmd = (acc < 0) ? acc : 0;
desired_brake_cmd = (acc < 0) ? -acc : 0;
}
if (convert_steer_cmd_) {
desired_steer_cmd = calculateSteer(vel, steer, steer_rate);
Expand Down

0 comments on commit f7f1e13

Please sign in to comment.