Skip to content

Commit

Permalink
fix bug where oversteer by factor of 2 (osrf#20)
Browse files Browse the repository at this point in the history
* fix bug where understeer by factor of 2
  • Loading branch information
jbrookshire authored and tfoote committed Oct 6, 2017
1 parent 8610aad commit 099b79c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions car_demo/plugins/PriusHybridPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ void PriusHybridPlugin::OnPriusCommand(const prius_msgs::Control::ConstPtr &msg)
this->dataPtr->lastPedalCmdTime = this->dataPtr->world->SimTime();

// Steering wheel command
double handWheelRange =
this->dataPtr->handWheelHigh - this->dataPtr->handWheelLow;
double handCmd = (msg->steer < 0.)
? (msg->steer * -this->dataPtr->handWheelLow)
: (msg->steer * this->dataPtr->handWheelHigh);

double handCmd = msg->steer * handWheelRange;
handCmd = ignition::math::clamp(handCmd, this->dataPtr->handWheelLow,
this->dataPtr->handWheelHigh);
this->dataPtr->handWheelCmd = handCmd;
Expand Down

0 comments on commit 099b79c

Please sign in to comment.