A thing which can move itself using a differential drive system.
- See also
- https://en.wikipedia.org/wiki/Differential_wheeled_robot
|
| DifferentialDrive (Thing parent=default) |
| Create a new differential drive.
|
|
void | SetDriveDimensions (float wheelDiameter, float wheelSeparation=0) |
| Configures the dimensions of the drive.
|
|
void | SetMotors (Motor leftWheel, Motor rightWheel) |
| Congures the motors for the wheels.
|
|
void | SetWheelVelocity (float speedLeft, float speedRight) |
| Directly specify the speeds of the motors.
|
|
void | SetWheelAngularVelocity (float angularSpeedLeft, float angularSpeedRight) |
| Directly specify the speeds of the motors.
|
|
override void | Update (bool recursive=true) |
|
override byte[] | GenerateBinary () |
| Function used to generate binary data for this thing.
|
|
override void | ProcessBinary (byte[] data) |
| Function used to process binary data received for this thing.
|
|
virtual void | CreateComponent () |
| Function which can be used to create components in external engines.
|
|
void | AddChild (Thing child) |
| Add a child Thing to this Thing.
|
|
bool | RemoveChild (Thing child) |
| Remove the given thing as a child of this thing.
|
|
void | ReplacePosition (Spherical newPosition) |
|
void | ReplaceOrientation (SwingTwist newOrientation) |
|
|
Motor | leftWheel = null |
| The left wheel.
|
|
Motor | rightWheel = null |
| The right wheel.
|
|
bool | terminate = false |
| Terminated things are no longer updated.
|
|
byte | id = 0 |
| The ID of this thing.
|
|
byte | type = Type.Undetermined |
| The type of this thing.
|
|
bool | isRemote = false |
|
Participant | owner = null |
| The participant owning this thing.
|
|
bool | nameChanged = false |
|
Unity.Thing | component = null |
| A reference to the representation of the thing in Unity.
|
|
bool | hierarchyChanged = true |
| Indicator that the hierarchy of the thing has changed.
|
|
bool | positionUpdated = false |
| Boolean indicating that the thing has an updated position.
|
|
bool | orientationUpdated = false |
| Boolean indicating the thing has an updated orientation.
|
|
bool | linearVelocityUpdated = false |
| Boolean indicating the thing has an updated linear velocity.
|
|
bool | angularVelocityUpdated = false |
| Boolean indicating the thing has an updated angular velocity.
|
|
ConcurrentQueue< CoreEvent > | updateQueue = new() |
| Queue containing events happened to this thing.
|
|
|
float | rpsToMs = 1.0f |
| The distance between the wheels in meters.
|
|
List< Thing > | children = new() |
| The children of this thing.
|
|
|
float | wheelRadius [get] |
|
static Thing | localRoot [get] |
| The root thing for the local participant.
|
|
virtual string | name [get, set] |
| The name of the thing.
|
|
string | modelUrl [get, set] |
| An URL pointing to the location where a model of the thing can be found.
|
|
Thing | parent [get, set] |
| The parent of this thing.
|
|
bool | isRoot [get] |
| Indication whether this is a root thing.
|
|
Spherical | position [get, set] |
| The position of the thing in local space, in meters.
|
|
SwingTwist | orientation [get, set] |
| The orientation of the thing in local space.
|
|
Spherical | linearVelocity [get, set] |
| The linear velocity of the thing in local space in meters per second.
|
|
Spherical | angularVelocity [get, set] |
| The angular velocity of the thing in local space in degrees per second.
|
|
◆ DifferentialDrive()
RoboidControl.DifferentialDrive.DifferentialDrive |
( |
Thing |
parent = default | ) |
|
Create a new differential drive.
- Parameters
-
◆ SetDriveDimensions()
void RoboidControl.DifferentialDrive.SetDriveDimensions |
( |
float |
wheelDiameter, |
|
|
float |
wheelSeparation = 0 |
|
) |
| |
Configures the dimensions of the drive.
- Parameters
-
wheelDiameter | The diameter of the wheels in meters |
wheelSeparation | The distance between the wheels in meters |
These values are used to compute the desired wheel speed from the set linear and angular velocity.
- See also
- SetLinearVelocity SetAngularVelocity
◆ SetMotors()
void RoboidControl.DifferentialDrive.SetMotors |
( |
Motor |
leftWheel, |
|
|
Motor |
rightWheel |
|
) |
| |
Congures the motors for the wheels.
- Parameters
-
leftWheel | The motor for the left wheel |
rightWheel | The motor for the right wheel |
◆ SetWheelVelocity()
void RoboidControl.DifferentialDrive.SetWheelVelocity |
( |
float |
speedLeft, |
|
|
float |
speedRight |
|
) |
| |
Directly specify the speeds of the motors.
- Parameters
-
speedLeft | The speed of the left wheel in degrees per second. Positive moves the robot in the forward direction. |
speedRight | The speed of the right wheel in degrees per second. Positive moves the robot in the forward direction. |
◆ SetWheelAngularVelocity()
void RoboidControl.DifferentialDrive.SetWheelAngularVelocity |
( |
float |
angularSpeedLeft, |
|
|
float |
angularSpeedRight |
|
) |
| |
Directly specify the speeds of the motors.
- Parameters
-
speedLeft | The speed of the left wheel in degrees per second. Positive moves the robot in the forward direction. |
speedRight | The speed of the right wheel in degrees per second. Positive moves the robot in the forward direction. |
◆ Update()
override void RoboidControl.DifferentialDrive.Update |
( |
bool |
recursive = true | ) |
|
|
virtual |
◆ GenerateBinary()
override byte[] RoboidControl.DifferentialDrive.GenerateBinary |
( |
| ) |
|
|
virtual |
Function used to generate binary data for this thing.
- Returns
- A byte array with the binary data
- See also
- Passer::RoboidControl::BinaryMsg
Reimplemented from RoboidControl.Thing.
◆ ProcessBinary()
override void RoboidControl.DifferentialDrive.ProcessBinary |
( |
byte[] |
bytes | ) |
|
|
virtual |
Function used to process binary data received for this thing.
- Parameters
-
bytes | The binary data to process |
Reimplemented from RoboidControl.Thing.
◆ CreateRoot()
static void RoboidControl.Thing.CreateRoot |
( |
Participant |
owner | ) |
|
|
staticinherited |
Create a root Thing for a participant.
- Parameters
-
owner | The participant who will own this root thing |
◆ CreateComponent()
virtual void RoboidControl.Thing.CreateComponent |
( |
| ) |
|
|
virtualinherited |
◆ AddChild()
void RoboidControl.Thing.AddChild |
( |
Thing |
child | ) |
|
|
inherited |
Add a child Thing to this Thing.
- Parameters
-
child | The Thing which should become a child |
◆ RemoveChild()
bool RoboidControl.Thing.RemoveChild |
( |
Thing |
child | ) |
|
|
inherited |
Remove the given thing as a child of this thing.
- Parameters
-
- Returns
- True when the child was present or false when it was not found
◆ GetTimeMs()
static ulong RoboidControl.Thing.GetTimeMs |
( |
| ) |
|
|
staticinherited |
Get the current time in milliseconds.
- Returns
- The current time in milliseconds
◆ rpsToMs
float RoboidControl.DifferentialDrive.rpsToMs = 1.0f |
|
protected |
The distance between the wheels in meters.
Convert revolutions per second to meters per second
◆ type
byte RoboidControl.Thing.type = Type.Undetermined |
|
inherited |
The type of this thing.
This can be either a Thing.Type or a byte value for custom types.
◆ modelUrl
string RoboidControl.Thing.modelUrl |
|
getsetinherited |
An URL pointing to the location where a model of the thing can be found.
Although the roboid implementation is not dependent on the model, the only official supported model formats are .png (sprite), .gltf and .glb