Agent File Format
From Digital Spaces
Special string ==agentName== is replaced by AgentManager with agent instance name before file is parsed by the Agent implementation.
Contents |
chunk
Generic identifier for DSS compatible XML based data.
agent
- name: string. Should be unique. Recommended: ==agentName==
- type: string. Used to identify the Agent Implementation that will be responsible for implementing the agents logic.
Values: "Vehicle", "Robot", "Rover", "DefaultHuman", "SpaceVehicle". Default: DefaultHuman
DefaultHuman
state
- name: string.
- animation: string. Name of the animation in the .skeleton file
- speed: float. Speed multiplier of animation.
gib
- name: string.
- src: string.
node
Passed directly to the SGManager
speed
- walk: float. Defaults to 1.0
- fly: float. Defaults to 10.0
- jump: float. Defaults to 2.0
Vehicle
extern
- src: string. Path to .scene file to be loaded.
node
Passed directly to the SGManager. Is an alternative to <extern>.
collision
SettingMap format (same xml structure as used Scene_File_Format#settings ).
- name: String. Name used for human reading. Default is an empty string.
A vheicle agent specification may contain multiple <collision> elements. Each set of <setting>'s will be applied to the collision that contains the appropriate <shape> entry. The one with no name attribute will be used for all other collisions. All the <setting>'s provided are passed directly to the physics implementation. However, common settings are:
- staticFriction. This is possibly misnamed, sets the amount of friction used parellel to the vehicles facing.
- kineticFriction. This is possibly misnamed, sets the amount of friction used perpendicular to the vehicles facing (sideways). If not specified, staticFriction is used.
- pyramidFriction: bool. Changes the model used to apply staticFriction and kineticFriction.
- bounceVelocity
- softness
- softCFM
- slipForwards
- slipSideways
For more information about these settings, see the ODE documentation on http://www.ode.org .
Common Problems
My vehicle won't turn: kineticFriction is too high.
shape
Contains a text element, eg:
<shape>NameOfShape</shape>
general
- steermode: string. Options are "tank" or "car". Defaults to "tank".
- centralbody: string. The name of a body (specified in the .scene by <node name="..." body="true">) that will be used when the agent is asked for it's current position/orientation.
- motorspeed: float. Measured in radians (of rotation) per second.
- motorforce: float. Measured in newtonmeters.
- turnspeed: float. A multiplier used to control the turning rate of the steering wheels.
- boost: float. A multiplier applied to motorspeed when in boosted mode. NOTE: This may be phased out in future.
suspension
Lists joints which may be used to provide a powered suspension, allowing the vehicle to be raised or lowered.
joint
- name: string. Name of the joint.
bodies
A list of bodies belonging to the agent that <collision> settings should be applied for. An example of this will be the wheel bodies.
body
Contains text that is the name of the body.
<bodies> <body>Wheel1</body> <body>Wheel2</body> </bodies>
Steering Modes
Depending on which steering mode you specify (tank or car), some different elements are available.
Tank
Tank steering treats each side of the vehicle as independantly powered, and performs steering by slowing or reversing the wheels on one side of the vehicle. This steering method is used in tracked vehicles, such as bulldozers. These elements are children of <agent> if <general steermode="tank"/> is specified:
leftside
wheel
Contains text that is the name of the joint for a left side wheel.
rightside
wheel
Contains text that is the name of the joint for a right side wheel.
<leftside> <wheel>Wheel1Joint</wheel> <wheel>Wheel3Joint</wheel> </leftside> <rightside> <wheel>Wheel2Joint</wheel> <wheel>Wheel4Joint</wheel> </rightside>
Car
This mode rotates a set of joints, with the general intention of altering the travel direction of the vehicle. This is the steering method commonly used in motor vehicles. These elements are children of <agent> if <general steermode="car"/> is specified:
steer
wheel
Contains text that is the name of the joint for a steering wheel.
drive
wheel
Contains text that is the name of the joint for a driving wheel.
<steer> <wheel>Wheel1Joint</wheel> <wheel>Wheel2Joint</wheel> </steer> <drive> <wheel>Wheel3Joint</wheel> <wheel>Wheel4Joint</wheel> </drive>
Note that steering is actually applied to the second axis of a joint. In most joints, this will be ignored and applied to the only existing axis, but in the case of multiple axis joints (specifically the "hinge2") this prevents conflicts with the first axis, which is used for driving. In this way, a joint may be specified in both <steer> and <drive>, as in the case of a four wheel drive vehicle.