SmartBody : Configuring Locomotion, Steering and Path Finding

Locomotion

 

Steering

The steering system uses a grid-based approach to find collision-free paths to the target goal. The steering engine uses the SteerSuite framework (http://www.magix.ucla.edu/steersuite/) and the PPR (Plan, Predict, React) agent to accommodate steering for both static (unmoving) and dynamic (moving) obstacles. A number of steering options can be set on the SBSteeringManager object as follows:

 

AttributeDescription
gridDatabaseOptions.gridSizeXSize of the grid in the X-direction.
gridDatabaseOptions.gridSizeZSize of the grid in the Z-direction.
gridDatabaseOptions.numGridCellsXNumber of grid cells in the X-direction.
gridDatabaseOptions.numGridCellsZNumber of grid cells in the Z-direction.
gridDatabaseOptions.maxItemsPerGridCellThe maximum number of pawns or objects that can occupy a grid cell. Default is 7.
initialConditions.radius

Radius of the characters when performing steering.

This can be set to a very small number (say, .001) if you do not

wish to consider characters as obstacles during the steering calculation.

 

Once the parameters have been set, the steering manager must be restarted, for example:

steer = scene.getSteerManager()
steer.setDoubleAttribute("gridDatabaseOptions.gridSizeX", 200)
steer.setDoubleAttribute("gridDatabaseOptions.gridSizeZ", 200)
steer.stop()
steer.start()

 

Note that characters who are instructed to move to spaces outside of the steering grid will not do so, and any characters who reach the boundary of the steering grid will immediately stop movement. There is a set of walls that are automatically constructed on the edges of the steering grid to help guide the locomotion. To remove these walls:

steer.setBoolAttribute("useBoundaryWalls", False)

The image below shows the default grid size, cell size and border boundaries.

 Path Finding

SmartBody can utilize a simple path finding without obstacle avoidance by setting the 'steering.pathFollowingMode' attribute on a character:

character = scene.getCharacter(characterName)
character.setBoolAttibute("steering.pathFollowingMode", True)

In the path following mode, the character will follow a path as described by a BML locomotion command as closely as possible. There are several attributes on the character that determine how fast the character will move along that path: 'steering.pathMinSpeed', 'steering.pathMaxSpeed', 'steering.pathAngleAcc':

character.setDoubleAttribute("steering.pathMinSpeed", minSpeed)
character.setDoubleAttribute("steering.pathMaxSpeed", maxSpeed)
character.setDoubleAttribute("steering.pathAngleAcc", angularAcceleration)

where 'minSpeed' is the minimum speed at which the character will move, regardless if the path cannot be followed very closerly. Likewise, 'maxSpeed' is the desired speed of the that the character will move  except when it is necessary to move more slowly in order to follow the path more accurately. 'angularAcceleration' is a gain describing how quickly the character will turn.

A BML command specifying locomotion will look something like this:

<locomotion target="waypoint1 waypoint2 waypoint3 waypoint4 waypoint5"/>

 

where 'waypointx' are pawns or characters. Likewise, global coordinates could be used instead like so:

<locomotion target="0 100 20 35 200 -400 67 100"/>

 

where each pair of numbers represent an (x,z) waypoint. Likewise, a combination of numbers and pawns/characters can be used:

<locomotion target="0 100 20 35 waypoint1 67 100"/>

 

 

Attachments:

steeringlongshot.png (image/png)
steeringlongshot.png (image/png)