提交 decfb12d 编写于 作者: S sjiang2018 提交者: Jiaming Tao

Common: added steering_percentage to vehicle provider.

上级 cc56c12b
......@@ -21,4 +21,5 @@ message VehicleState {
optional apollo.canbus.Chassis.GearPosition gear = 13;
optional apollo.canbus.Chassis.DrivingMode driving_mode = 14;
optional apollo.localization.Pose pose = 15;
optional double steering_percentage = 16;
}
......@@ -67,6 +67,10 @@ Status VehicleStateProvider::Update(
}
}
if (chassis.has_steering_percentage()) {
vehicle_state_.set_steering_percentage(chassis.steering_percentage());
}
static constexpr double kEpsilon = 1e-6;
if (std::abs(vehicle_state_.linear_velocity()) < kEpsilon) {
vehicle_state_.set_kappa(0.0);
......@@ -189,6 +193,10 @@ double VehicleStateProvider::linear_acceleration() const {
double VehicleStateProvider::gear() const { return vehicle_state_.gear(); }
double VehicleStateProvider::steering_percentage() const {
return vehicle_state_.steering_percentage();
}
double VehicleStateProvider::timestamp() const {
return vehicle_state_.timestamp();
}
......
......@@ -152,6 +152,12 @@ class VehicleStateProvider {
*/
double gear() const;
/**
* @brief Get the vehicle's steering angle.
* @return double
*/
double steering_percentage() const;
/**
* @brief Set the vehicle's linear velocity.
* @param linear_velocity The value to set the vehicle's linear velocity.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册