A two-wheeled Propulsion method.
More...
#include <DifferentialDrive.h>
A two-wheeled Propulsion method.
The wheels are put at either side of the roboid with the following behaviour
- When both wheels spin forward, the Roboid moves forward
- When both wheels spin backward, the Roboid moves backward
- When both wheels are spinning in opposite directions, the Roboid rotates wihout moving forward or backward
- When just one wheel is spinning, the Roboid turnes while moving forward or backward.
◆ DifferentialDrive() [1/2]
DifferentialDrive::DifferentialDrive |
( |
| ) |
|
◆ DifferentialDrive() [2/2]
DifferentialDrive::DifferentialDrive |
( |
Placement |
leftMotorPlacement, |
|
|
Placement |
rightMotorPlacement |
|
) |
| |
Setup of the DifferentialDrive with the Placement of the motors.
- Parameters
-
leftMotorPlacement | Placement of the left Motor |
rightMotorPlacement | Placement of the right Motor In this setup, the left motor Direction will be CounterClockWise when driving forward, while the right motor will turn Clockwise. |
- Note
- When not using controlled motors, the placement of the motors is irrelevant.
◆ SetTargetSpeeds()
void DifferentialDrive::SetTargetSpeeds |
( |
float |
leftSpeed, |
|
|
float |
rightSpeed |
|
) |
| |
Set the target speeds of the motors directly.
- Parameters
-
leftSpeed | The target speed of the left Motor |
rightSpeed | The target speed of the right Motor |
◆ SetTwistSpeed() [1/3]
void DifferentialDrive::SetTwistSpeed |
( |
float |
forward, |
|
|
float |
yaw |
|
) |
| |
|
overridevirtual |
◆ SetTwistSpeed() [2/3]
void DifferentialDrive::SetTwistSpeed |
( |
Vector2 |
linear, |
|
|
float |
yaw = 0.0F |
|
) |
| |
|
virtual |
◆ SetTwistSpeed() [3/3]
void DifferentialDrive::SetTwistSpeed |
( |
Vector3 |
linear, |
|
|
float |
yaw = 0.0F , |
|
|
float |
pitch = 0.0F , |
|
|
float |
roll = 0.0F |
|
) |
| |
|
virtual |
Controls the motors through forward and rotation speeds.
- Parameters
-
linear | The target linear speed |
yaw | The target rotation speed around the vertical axis |
pitch | Pitch is not supported and is ignored |
roll | Roll is not supported and is ignores |
- Note
- As a DifferentialDrive cannot move sideward or vertical, this function has the same effect as using the void SetTwistSpeed(float
forward, float yaw) function.
Reimplemented from Passer::RoboidControl::Propulsion.
◆ Update()
void Propulsion::Update |
( |
float |
currentTimeMs | ) |
|
|
inherited |
Update the propulsion state of the Roboid.
- Parameters
-
currentTimeMs | The time in milliseconds when calling this |
◆ GetMotorCount()
unsigned int Propulsion::GetMotorCount |
( |
| ) |
|
|
inherited |
Get the number of motors in this roboid.
- Returns
- The number of motors. Zero when no motors are present
◆ GetMotor()
Motor * Propulsion::GetMotor |
( |
unsigned int |
motorIx | ) |
|
|
inherited |
Get a specific motor.
- Parameters
-
motorIx | The index of the motor |
- Returns
- Returns the motor or a nullptr when no motor with the given index could be found
◆ GetMotorPlacement()
Placement * Propulsion::GetMotorPlacement |
( |
unsigned int |
motorIx | ) |
|
|
inherited |
◆ motorCount
unsigned int Passer::RoboidControl::Propulsion::motorCount = 0 |
|
protectedinherited |
◆ placement
Placement* Passer::RoboidControl::Propulsion::placement = nullptr |
|
protectedinherited |
The documentation for this class was generated from the following files: