Skip to content

Commit

Permalink
Fix more windows warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <[email protected]>
  • Loading branch information
nkoenig committed Jan 16, 2024
1 parent 4907c13 commit 2b1b16e
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions plugins/joy_to_twist/JoyToTwist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,21 @@ void JoyToTwist::OnJoy(const gz::msgs::Joy &_msg)
if (this->enableTurboButton >= 0 && _msg.buttons(this->enableTurboButton))
{
cmdVelMsg.mutable_linear()->set_x(
_msg.axes(this->axisLinear.X()) * this->scaleLinearTurbo.X());
_msg.axes(this->axisLinear.X()) * this->scaleLinearTurbo.X());
cmdVelMsg.mutable_linear()->set_y(
_msg.axes(this->axisLinear.Y()) * this->scaleLinearTurbo.Y());
_msg.axes(this->axisLinear.Y()) * this->scaleLinearTurbo.Y());
cmdVelMsg.mutable_linear()->set_z(
_msg.axes(this->axisLinear.Z()) * this->scaleLinearTurbo.Z());
_msg.axes(this->axisLinear.Z()) * this->scaleLinearTurbo.Z());

cmdVelMsg.mutable_angular()->set_x(
_msg.axes(this->axisAngular.X()) * this->scaleAngularTurbo.X());
_msg.axes(static_cast<int>(this->axisAngular.X())) *
this->scaleAngularTurbo.X());
cmdVelMsg.mutable_angular()->set_y(
_msg.axes(this->axisAngular.Y()) * this->scaleAngularTurbo.Y());
_msg.axes(static_cast<int>(this->axisAngular.Y())) *
this->scaleAngularTurbo.Y());
cmdVelMsg.mutable_angular()->set_z(
_msg.axes(this->axisAngular.Z()) * this->scaleAngularTurbo.Z());
_msg.axes(static_cast<int>(this->axisAngular.Z())) *
this->scaleAngularTurbo.Z());

this->cmdVelPub.Publish(cmdVelMsg);
this->sentDisableMsg = false;
Expand All @@ -166,18 +169,21 @@ void JoyToTwist::OnJoy(const gz::msgs::Joy &_msg)
else if (_msg.buttons(this->enableButton))
{
cmdVelMsg.mutable_linear()->set_x(
_msg.axes(this->axisLinear.X()) * this->scaleLinear.X());
_msg.axes(this->axisLinear.X()) * this->scaleLinear.X());
cmdVelMsg.mutable_linear()->set_y(
_msg.axes(this->axisLinear.Y()) * this->scaleLinear.Y());
_msg.axes(this->axisLinear.Y()) * this->scaleLinear.Y());
cmdVelMsg.mutable_linear()->set_z(
_msg.axes(this->axisLinear.Z()) * this->scaleLinear.Z());
_msg.axes(this->axisLinear.Z()) * this->scaleLinear.Z());

cmdVelMsg.mutable_angular()->set_x(
_msg.axes(this->axisAngular.X()) * this->scaleAngular.X());
_msg.axes(static_cast<int>(this->axisAngular.X())) *
this->scaleAngular.X());
cmdVelMsg.mutable_angular()->set_y(
_msg.axes(this->axisAngular.Y()) * this->scaleAngular.Y());
_msg.axes(static_cast<int>(this->axisAngular.Y())) *
this->scaleAngular.Y());
cmdVelMsg.mutable_angular()->set_z(
_msg.axes(this->axisAngular.Z()) * this->scaleAngular.Z());
_msg.axes(static_cast<int>(this->axisAngular.Z())) *
this->scaleAngular.Z());

this->cmdVelPub.Publish(cmdVelMsg);
this->sentDisableMsg = false;
Expand Down

0 comments on commit 2b1b16e

Please sign in to comment.