Roboid Control for C#
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | Events | List of all members
Passer.RoboidControl.TemperatureSensor Class Reference

Detailed Description

A temperature sensor.

Inheritance diagram for Passer.RoboidControl.TemperatureSensor:
Passer.RoboidControl.Thing

Public Types

enum  Type {
  Undetermined , Switch , DistanceSensor , DirectionalSensor ,
  TemperatureSensor , ControlledMotor , UncontrolledMotor , Servo ,
  Roboid , Humanoid , ExternalSensor
}
 Predefined thing types.
 

Public Member Functions

 TemperatureSensor (Participant participant, byte networkId, byte thingId)
 Create a temperature sensor with the given ID.
 
override void ProcessBinary (byte[] bytes)
 Function to extract the temperature received in the binary message.
 
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.
 
virtual void CreateComponent ()
 Function which can be used to create components in external engines.
 
void Update ()
 Convience function for use in Unity which removes the need for a currentTime argument.
 
virtual void Update (ulong currentTime)
 Update this thing.
 
virtual byte[] GenerateBinary ()
 Function used to generate binary data for this thing.
 

Static Public Member Functions

static void InvokeNewThing (Thing thing)
 Trigger the creation for the given thing.
 
static bool IsThing (Thing thing, byte networkId, byte thingId)
 Check if the thing has the given properaties.
 

Public Attributes

float temperature = 0
 The measured temperature.
 
RemoteParticipant participant
 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< Thingchildren = 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.
 
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.
 

Properties

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.
 

Events

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.
 

Constructor & Destructor Documentation

◆ TemperatureSensor()

Passer.RoboidControl.TemperatureSensor.TemperatureSensor ( Participant  participant,
byte  networkId,
byte  thingId 
)

Create a temperature sensor with the given ID.

Parameters
participantThe participant for with the sensor is needed
networkIdThe network ID of the sensor
thingIdThe ID of the thing

Member Function Documentation

◆ ProcessBinary()

override void Passer.RoboidControl.TemperatureSensor.ProcessBinary ( byte[]  bytes)
virtual

Function to extract the temperature received in the binary message.

Parameters
bytesThe byte array

Reimplemented from Passer.RoboidControl.Thing.

◆ AddChild()

void Passer.RoboidControl.Thing.AddChild ( Thing  child)
inherited

Attach a thing as a child of this thing.

Parameters
childThe thing to attach as a child

◆ RemoveChild()

void Passer.RoboidControl.Thing.RemoveChild ( Thing  child)
inherited

Remove the given thing as a child of this thing.

Parameters
childThe child to remove

◆ CreateComponent()

virtual void Passer.RoboidControl.Thing.CreateComponent ( )
virtualinherited

Function which can be used to create components in external engines.

Currently this is used to create GameObjects in Unity

Reimplemented in Passer.RoboidControl.DistanceSensor, and Passer.RoboidControl.TouchSensor.

◆ Update()

virtual void Passer.RoboidControl.Thing.Update ( ulong  currentTime)
virtualinherited

Update this thing.

Parameters
currentTimeThe current time in milliseconds

◆ GenerateBinary()

virtual byte[] Passer.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

◆ InvokeNewThing()

static void Passer.RoboidControl.Thing.InvokeNewThing ( Thing  thing)
staticinherited

Trigger the creation for the given thing.

Parameters
thingThe created thing

◆ IsThing()

static bool Passer.RoboidControl.Thing.IsThing ( Thing  thing,
byte  networkId,
byte  thingId 
)
staticinherited

Check if the thing has the given properaties.

Parameters
thingThe thing to check
networkIdThe network ID to compare to
thingIdThe thing ID to compare to
Returns
True when the thing has the given properties