Beispiel #1
0
void PWMCbTurn(const std_msgs::Int32& msg)
{
  if (isMovingForward)
  {
    if (msg.data > 0)
    {
      thrusterEast(255 - msg.data, true);
      thrusterWest(255 - msg.data, false);
    }
    else
    {
      thrusterEast(255 + msg.data, false);
      thrusterWest(255 + msg.data, true);
    }
  }
  else
  {
    if (msg.data > 0)
    {
      thrusterNorthSway(255 - msg.data, false);
      thrusterSouthSway(255 - msg.data, true);
    }
    else
    {
      thrusterNorthSway(255 + msg.data, true);
      thrusterSouthSway(255 + msg.data, false);
    }
  }
}
Beispiel #2
0
void PWMCbTurnSway(const std_msgs::Int32 &msg)
{
  if (msg.data > 0)
  {
    thrusterEast(msg.data, true);
    thrusterWest(msg.data, false);
  }
  else
  {
    thrusterEast(msg.data, false);
    thrusterWest(msg.data, true);
  }
}
Beispiel #3
0
void PWMCbForward(const std_msgs::Int32 &msg)
{
  if (msg.data > 0)
  {
    thrusterEast(msg.data, true);
    thrusterWest(msg.data, true);
  }
  else
  {
    thrusterEast(msg.data, false);
    thrusterWest(msg.data, false);
  }
  isMovingForward = true;
}