Constructor
new ThreeWheelDistanceSensingRobotRepresentation()
- License:
- MIT
- Source:
Extends
Methods
addBody() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the body of the robot to the scene
Returns:
- The robot
addBuzzer() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the buzzer and registers its process function.
Returns:
- The robot
addFrontWheel() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the front (not driving) wheel of the robot to the scene.
Returns:
- The robot
addSonars() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the sonars of the robot to the scene and registers their process function.
Returns:
- The robot
addVirtualCamera() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the virtual camera and registers its process function.
Returns:
- The robot
addVirtualCompass() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the virtual compass and registers its process function.
Returns:
- The robot
addVirtualLocator() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the virtual locator and registers its process function.
Returns:
- The robot
addVirtualPen() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the virtual pen and registers its process function.
Returns:
- The robot
addVirtualScanner() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the virtual scanner and registers its process function.
Returns:
- The robot
addWheels() → {ThreeWheelDistanceSensingRobotRepresentation}
Adds the driving wheels of the robot to the scene.
Returns:
- The robot
build() → {boolean}
Builds the robot's representation.
- Overrides:
- Source:
Returns:
- Whether the robot's representation could be built
- Type
- boolean
createDOFConstraint(mainObject, constrainedObject, position) → {Physijs.DOFConstraint}
Returns a Physijs DOF Constraint.
Parameters:
Name | Type | Description |
---|---|---|
mainObject |
Object | First object to be constrained |
constrainedObject |
Object | Second object to be constrained |
position |
THREE.Vector3 | Point in the scene to apply the constraint |
- Inherited From:
- Source:
Returns:
- The constraint created
- Type
- Physijs.DOFConstraint
createHingeConstraint(mainObject, constrainedObject, position, axis) → {Physijs.DOFConstraint}
Returns a Physijs Hinge Constraint.
Parameters:
Name | Type | Description |
---|---|---|
mainObject |
Object | First object to be constrained |
constrainedObject |
Object | Second object to be constrained |
position |
THREE.Vector3 | Point in the scene to apply the constraint |
axis |
THREE.Vector3 | Axis along which the hinge lies |
- Inherited From:
- Source:
Returns:
- The constraint created
- Type
- Physijs.DOFConstraint
createWheel(options) → {Physijs.CylinderMesh}
Returns a Physijs CylinderMesh representing a wheel.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | The options |
- Inherited From:
- Source:
Returns:
- The wheel created
- Type
- Physijs.CylinderMesh
finalizeBody() → {ThreeWheelDistanceSensingRobotRepresentation}
Finalizes the body of the robot. After calling this function, no other object can be added to the chassis.
Returns:
- The robot
getAbsolutePositionForObject(obj, forceUpdate) → {THREE.Vector3}
Returns the absolute position of an object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | The object |
forceUpdate |
boolean | Whether the cached value should be used |
- Inherited From:
- Source:
Returns:
- The position
- Type
- THREE.Vector3
getAngle(pos1, pos2, axes) → {float}
Returns the angle on a plain between two points.
Parameters:
Name | Type | Description |
---|---|---|
pos1 |
THREE.Vector3 | The first point |
pos2 |
THREE.Vector3 | The second point |
axes |
array | An array of two chars, each representing an axis to be considered for the definition of the plane |
- Inherited From:
- Source:
Returns:
- The angle in radians
- Type
- float
getBottomImagePixelCoordinatesForObject(obj, forceUpdate) → {THREE.Vector2}
Returns the coordinates of an object mapped on the pixels of the bottom image.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | The object |
forceUpdate |
boolean | Whether the cached value should be used |
- Inherited From:
- Source:
Returns:
- The coordinates
- Type
- THREE.Vector2
getLambertPjsMaterial() → {object}
Returns a Physijs Material based on a THREE.MeshLambertMaterial.
- Inherited From:
- Source:
Returns:
- The material created
- Type
- object
hasCamera() → {boolean}
Returns true if the robot has available a (virtual) camera.
- Inherited From:
- Source:
Returns:
- Whether the robot has been assigned a remote control
- Type
- boolean
hasController() → {boolean}
Returns true if the robot has been assigned a remote control.
- Inherited From:
- Source:
Returns:
- Whether the robot has been assigned a remote control
- Type
- boolean
manageCommunicationFailure()
Manages the fact that there has been a communication failure.
- Overrides:
- Source:
move(vector, relative) → {RobotRepresentation}
Moves the robot to a specific place.
Parameters:
Name | Type | Description |
---|---|---|
vector |
THREE.Vector3 | The vector with the coordinates to move the robot to |
relative |
boolean | Whether the coordinates are to be considered relative or absolute |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
process() → {ThreeWheelDistanceSensingRobotRepresentation}
Processes incoming data and prepares outgoing data.
Returns:
- The robot
rotateOnAxis(axis, angle) → {RobotRepresentation}
Rotates the robot on an axis.
Parameters:
Name | Type | Description |
---|---|---|
axis |
THREE.Vector3 | The axis along which the robot should be rotated |
angle |
float | The angle of rotation, in radians |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
setControllerUrl(url) → {RobotRepresentation}
Sets the url for the simulated remote control or similar device.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
setId(id) → {RobotRepresentation}
Sets the id of the robot and prepares the containers it needs.
Parameters:
Name | Type | Description |
---|---|---|
id |
string | The id of the robot |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
setInitialValues(values) → {RobotRepresentation}
Sets the initialValues of the robot.
Parameters:
Name | Type | Description |
---|---|---|
values |
Object | The values |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
setRobotManager(robotsManager) → {RobotRepresentation}
Sets the robot's manager.
Parameters:
Name | Type | Description |
---|---|---|
robotsManager |
RobotsManager | The Robots' Manager to set |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
show() → {RobotRepresentation}
Writes information about the robot on the console.
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation
update(data)
Updates the data to/from the robot's behavior.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | The data received/transmitted |
- Overrides:
- Source:
updateWheelSpeed(wheel, speed) → {RobotRepresentation}
Updates the speed of a wheel.
Parameters:
Name | Type | Description |
---|---|---|
wheel |
Object | The wheel to update |
speed |
float | The speed to set |
- Inherited From:
- Source:
Returns:
- The robot
- Type
- RobotRepresentation