NPC Behavior#
Behavior logic of the NPC(non-player-character) is pluggable. If you want to use your own behavior, please see this document.
In this document, we describe how default behavior tree NPC works in traffic environment. Default behavior tree NPC logics are in this package.
List of behaviors#
If you want to check detail, please check documents below.
Entity \ Behavior | Behavior-Tree | Do-Nothing |
---|---|---|
Vehicle | document | document |
Pedestrian | document | document |
MiscObject | Does not exist. | Does not exist. |
Vehicle NPC (with Behavior-Tree)#
Behavior tree of vehicle NPC is here.
Action | Behavior | Success | Failure |
---|---|---|---|
LaneChange | Changing to target lane. | Moved to target lane. | Failed to calculate lane change trajectory. |
FollowLane | Following lane and moving to goal. | Lane change was requested, traffic light, stop sing, conflicting entities are detected. | |
FollowFrontEntity | Following target entity in front of the NPC. | Target entity was disappeared in front of the NPC. | |
StopAtTrafficLight | Stopping at a traffic light until it becomes green. | The traffic light become green. | |
StopAtStopLine | Stopping at a stop line. | The NPC was stopped at stop line. | Overrun stop line. |
StopAtCrossingEntity | Stopping at crossing entity. | Target entity was crossed. | |
Yield | Yield to right-of-way entity. | Right of way entity is moved. | |
MoveBackward | Move backward on lane. | Another request and new goal point was suggested. |
Behavior#
LaneChange#
By using API::requestLaneChange
function, you send lane change request to target NPC.
You can send request with these parameters.
Target#
Value | Meaning |
---|---|
AbsoluteTarget | Changing lanes to the exact target lanelet. You have to specify lanelet_id , offset |
RelativeTarget | Changing lanes to the relative target lanelet. You have to specify entity_name , shift , direction . |
AbsoluteTarget#
Value | Meaning | Default |
---|---|---|
lanelet_id | Lanelet id, which you want to changing lanes to. | |
offset | Target offset you want to changing lanes. | 0 |
offset
value is calculated under lane coordinate.
RelativeTarget#
Value | Meaning | Default |
---|---|---|
entity_name | Reference entity name. | |
shift | Number of lanes counted from reference entity name. | 0 |
offset | Target offset you want to changing lanes. | 0 |
TrajectoryShape#
Value | Meaning | Default |
---|---|---|
CUBIC | Changing lanes with cubic spline trajectory. | |
LINEAR | Changing lanes with linear trajectory. |
Cubic Trajectory Shape#
Linear Trajectory Shape#
Constraint#
Value | Meaning | Default |
---|---|---|
NONE | Just changing lanes if possible. | |
LATERAL_VELOCITY | Changing lanes with target lateral velocity. | |
LONGITUDINAL_DISTANCE | Changing lanes with target longitudinal distance. | |
TIME | Changing lanes with target duration. |
Policy#
Value | Meaning | Default |
---|---|---|
FORCE | Changing lanes and fulfilling constraints ignoring dynamics. | |
BEST_EFFORT | Changing lanes and trying to fulfill constraints without ignoring dynamics. |
Vehicle NPC (with Do-Nothing)#
When this behavior is used, entity can only be moved by specifying its pose, velocity, acceleration, jerk, etc. via the API::setEntityStatus
function, etc.
When using this behavior, any consistency in physical behavior is ignored. Changes in posture, velocity, acceleration, and jerk over time will not occur.
The EntityStatus value will continue to be the value specified and updated via the API::setEntityStatus
function, etc.
This behavior was developed primarily to drive the simulator from Autoware rosbag data.
Pedestrian NPC (with Behavior-Tree)#
Behavior tree of pedestrian entity is here.
Action | Behavior | Success | Failure |
---|---|---|---|
FollowLane | Entity following the lane which it is exist. | ||
WalkStraight | Entity walk forward and without considering lane. |
Pedestrian NPC (with Do-Nothing)#
When this behavior is used, entity can only be moved by specifying its pose, velocity, acceleration, jerk, etc. via the API::setEntityStatus
function, etc.
When using this behavior, any consistency in physical behavior is ignored. Changes in posture, velocity, acceleration, and jerk over time will not occur.
The EntityStatus value will continue to be the value specified and updated via the API::setEntityStatus
function, etc.
This behavior was developed primarily to drive the simulator from Autoware rosbag data.