A thing which can move itself using a differential drive system.
- See also
- https://en.wikipedia.org/wiki/Differential_wheeled_robot
|
| DifferentialDrive (bool invokeEvent=true) |
| Create a differential drive without communication abilities </summary - Parameters
-
invokeEvent | Invoke a OnNewThing event when the thing has been created |
|
|
| DifferentialDrive (ParticipantUDP participant, byte thingId=0, bool invokeEvent=true) |
| Create a differential drive for a participant.
|
|
| DifferentialDrive (Thing parent, byte thingId=0, bool invokeEvent=true) |
| Create a new child differential drive.
|
|
void | SetDriveDimensions (float wheelDiameter, float wheelSeparation) |
| Configures the dimensions of the drive.
|
|
void | SetMotors (Thing leftWheel, Thing rightWheel) |
| Congures the motors for the wheels.
|
|
void | SetWheelVelocity (float speedLeft, float speedRight) |
| Directly specify the speeds of the motors.
|
|
override void | Update (ulong currentMs, bool recursive=true) |
|
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 | Update (bool recurse=false) |
| Update de state of the thing.
|
|
delegate void | ChangeHandler () |
|
delegate void | SphericalHandler (Spherical v) |
|
delegate void | ThingHandler (Thing t) |
|
virtual byte[] | GenerateBinary () |
| Function used to generate binary data for this thing.
|
|
virtual void | ProcessBinary (byte[] bytes) |
| Function used to process binary data received for this thing.
|
|
|
static ulong | GetTimeMs () |
| Get the current time in milliseconds.
|
|
static void | InvokeNewThing (Thing thing) |
| Trigger the creation for the given thing.
|
|
|
bool | terminate = false |
|
Participant | owner = null |
| The participant owning this thing.
|
|
byte | id = 0 |
| The ID of this thing.
|
|
byte | type = Type.Undetermined |
| The type of this thing.
|
|
bool | nameChanged = false |
|
string | modelUrl = "" |
| An URL pointing to the location where a model of the thing can be found.
|
|
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.
|
|
|
float | wheelRadius = 1.0f |
| The radius of a wheel in meters.
|
|
float | wheelSeparation = 1.0f |
| The distance between the wheels in meters.
|
|
float | rpsToMs = 1.0f |
| Convert revolutions per second to meters per second.
|
|
Thing | leftWheel = null |
| The left wheel.
|
|
Thing | rightWheel = null |
| The right wheel.
|
|
List< Thing > | children = new() |
| The children of this thing.
|
|
|
virtual string | name [get, set] |
| The name of the thing.
|
|
Thing | parent [get, set] |
| The parent of this 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.
|
|
|
ChangeHandler | OnNameChanged = delegate { } |
| Event which is triggered when the name changes.
|
|
ChangeHandler | OnPoseChanged = delegate { } |
| Event triggered when the pose has changed.
|
|
SphericalHandler | OnLinearVelocityChanged = delegate { } |
| Event triggered when the linear velocity has changed.
|
|
SphericalHandler | OnAngularVelocityChanged = delegate { } |
| Event triggered when the angular velocity has changed.
|
|
static ThingHandler | OnNewThing = delegate { } |
| Event triggered when a new thing has been created.
|
|
◆ DifferentialDrive() [1/2]
RoboidControl.DifferentialDrive.DifferentialDrive |
( |
ParticipantUDP |
participant, |
|
|
byte |
thingId = 0 , |
|
|
bool |
invokeEvent = true |
|
) |
| |
Create a differential drive for a participant.
- Parameters
-
owner | The owning participant |
thingId | The ID of the thing, leave out or set to zero to generate an ID |
invokeEvent | Invoke a OnNewThing event when the thing has been created |
◆ DifferentialDrive() [2/2]
RoboidControl.DifferentialDrive.DifferentialDrive |
( |
Thing |
parent, |
|
|
byte |
thingId = 0 , |
|
|
bool |
invokeEvent = true |
|
) |
| |
Create a new child differential drive.
- Parameters
-
parent | The parent thing |
thingId | The ID of the thing, leave out or set to zero to generate an ID |
invokeEvent | Invoke a OnNewThing event when the thing has been created |
◆ SetDriveDimensions()
void RoboidControl.DifferentialDrive.SetDriveDimensions |
( |
float |
wheelDiameter, |
|
|
float |
wheelSeparation |
|
) |
| |
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 |
( |
Thing |
leftWheel, |
|
|
Thing |
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. |
◆ Update() [1/2]
override void RoboidControl.DifferentialDrive.Update |
( |
ulong |
currentMs, |
|
|
bool |
recursive = true |
|
) |
| |
|
virtual |
◆ 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
◆ Update() [2/2]
void RoboidControl.Thing.Update |
( |
bool |
recurse = false | ) |
|
|
inherited |
Update de state of the thing.
- Parameters
-
recurse | When true, this will Update the descendants recursively |
◆ InvokeNewThing()
static void RoboidControl.Thing.InvokeNewThing |
( |
Thing |
thing | ) |
|
|
staticinherited |
Trigger the creation for the given thing.
- Parameters
-
◆ GenerateBinary()
virtual byte[] RoboidControl.Thing.GenerateBinary |
( |
| ) |
|
|
virtualinherited |
◆ ProcessBinary()
virtual void RoboidControl.Thing.ProcessBinary |
( |
byte[] |
bytes | ) |
|
|
virtualinherited |
◆ 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.