A thing which can move itself using a differential drive system.
- See also
- https://en.wikipedia.org/wiki/Differential_wheeled_robot
|
enum | Type {
Undetermined
, Switch
, DistanceSensor
, DirectionalSensor
,
TemperatureSensor
, TouchSensor
, ControlledMotor
, UncontrolledMotor
,
Servo
, Roboid
, Humanoid
, ExternalSensor
} |
| Predefined thing types.
|
|
|
| DifferentialDrive () |
| Create a differential drive without networking support.
|
|
| DifferentialDrive (LocalParticipant participant) |
| Create a differential drive with networking support.
|
|
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.
|
|
delegate void | ChangeHandler () |
|
delegate void | SphericalHandler (Spherical v) |
|
delegate void | ThingHandler (Thing t) |
|
void | AddChild (Thing child) |
| Attach a thing as a child of this thing.
|
|
void | RemoveChild (Thing child) |
| Remove the given thing as a child of this thing.
|
|
void | Update (bool recursive=false) |
| Convience function for use in Unity which removes the need for a currentTime argument.
|
|
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.
|
|
|
Participant | owner |
| The participant to which this thing belongs.
|
|
byte | networkId |
| The network ID of this thing.
|
|
byte | id |
| The ID of this thing.
|
|
byte | type |
| The type of this thing. This can be either a Thing::Type (needs casting) or a byte value for custom types.
|
|
List< Thing > | children = new List<Thing>() |
| The list of children of this thing.
|
|
string | modelUrl = "" |
| An URL pointing to the location where a model of the thing can be found.
|
|
bool | hasPosition = false |
|
Spherical | angularVelocity = Spherical.zero |
| The angular velocity of the thing in local space.
|
|
Unity.Thing | component = null |
| A reference to the representation of the thing in Unity.
|
|
|
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.
|
|
|
Thing | parent [get, set] |
| The parent of this thing.
|
|
virtual string | name [get, set] |
| The name of the 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.
|
|
|
ChangeHandler | OnParentChanged = delegate { } |
| Event which is triggered when the parent changes.
|
|
ChangeHandler | OnNameChanged = delegate { } |
| Event which is triggered when the name changes.
|
|
ChangeHandler | OnPositionChanged = delegate { } |
| Event triggered when the position has changed.
|
|
ChangeHandler | OnOrientationChanged = delegate { } |
| Event triggered when the orientation has changed.
|
|
SphericalHandler | OnLinearVelocityChanged = delegate { } |
| Event triggered when the linear velocity has changed.
|
|
static ThingHandler | OnNewThing = delegate { } |
| Event triggered when a new thing has been created.
|
|
◆ DifferentialDrive()
RoboidControl.DifferentialDrive.DifferentialDrive |
( |
LocalParticipant |
participant | ) |
|
Create a differential drive with networking support.
- Parameters
-
participant | The local participant |
◆ 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()
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 |
Attach a thing as a child of this thing.
- Parameters
-
child | The thing to attach as a child |
◆ RemoveChild()
void RoboidControl.Thing.RemoveChild |
( |
Thing |
child | ) |
|
|
inherited |
Remove the given thing as a child of this thing.
- Parameters
-
◆ GenerateBinary()
virtual byte[] RoboidControl.Thing.GenerateBinary |
( |
| ) |
|
|
virtualinherited |
Function used to generate binary data for this thing.
- Returns
- a byte array with the binary data
- See also
- Passer::RoboidControl::BinaryMsg
Reimplemented in RoboidControl.TouchSensor.
◆ ProcessBinary()
virtual void RoboidControl.Thing.ProcessBinary |
( |
byte[] |
bytes | ) |
|
|
virtualinherited |
◆ InvokeNewThing()
static void RoboidControl.Thing.InvokeNewThing |
( |
Thing |
thing | ) |
|
|
staticinherited |
Trigger the creation for the given thing.
- Parameters
-
◆ IsThing()
static bool RoboidControl.Thing.IsThing |
( |
Thing |
thing, |
|
|
byte |
networkId, |
|
|
byte |
thingId |
|
) |
| |
|
staticinherited |
Check if the thing has the given properaties.
- Parameters
-
thing | The thing to check |
networkId | The network ID to compare to |
thingId | The thing ID to compare to |
- Returns
- True when the thing has the given properties