|
Bratmobile
|
A closed hybrid control loop. It has an initial disturbance representing the continuous state and a direction representing (in 2D) the discrete control strategy. More...
#include <task.h>

Classes | |
| struct | Action |
| The motor instructions generated by the control strategy used in this tasks. More... | |
| class | Listener |
| Used to find collisions in the Box2D simulation. More... | |
Public Member Functions | |
| Task::Action | getAction () const |
| AffordanceIndex | getAffIndex () |
| Direction | H (Disturbance ob, Direction d, bool topDown=0) |
| Agent transfer function H which generates a motor output (Action) in response to a disturbance. More... | |
| void | setEndCriteria (const Angle &angle=SAFE_ANGLE, const Distance &distance=BOX2DRANGE) |
| Sets the end criteria for this task (bounds of the Flow condition). Angle is a valid measurement for turning task but not for DEFAULT Tasks. More... | |
| void | setEndCriteria (const Distance &distance) |
| void | setEndCriteria (const EndCriteria &ec) |
| EndedResult | checkEnded (b2Transform robotTransform=b2Transform_zero, Direction dir=UNDEFINED, bool relax=0, b2Body *robot=NULL, std::pair< bool, b2Transform > use_start=std::pair< bool, b2Transform >(1, b2Transform_zero)) |
| Check if this task has ended based on state information (default are info for the task which calls the method) More... | |
| EndedResult | checkEnded (const State &n, Direction dir=UNDEFINED, bool relax=false, std::pair< bool, b2Transform > use_start=std::pair< bool, b2Transform >(1, b2Transform_zero)) |
| Check if a state represents the end of this task. More... | |
| bool | checkEnded (const b2PolygonShape &box, const b2Transform &robot_pose=b2Transform_zero, Disturbance *dist_obs=NULL) |
| Uses a virtual sensor (attention window) to determine whether the task has ended or not. More... | |
| Task (Direction d) | |
| Task (Disturbance ob, Direction d, b2Transform _start=b2Transform(b2Vec2(0.0, 0.0), b2Rot(0.0)), bool topDown=0) | |
| simResult | bumping_that (b2World &_world, int iteration, b2Body *, float remaining=SIM_DURATION) |
| Executes this task in a Box2D simulation. More... | |
| EndCriteria | getEndCriteria (const Disturbance &d) |
| Returns the endCriteria for this Task if it were to counteract Disturbance. More... | |
| EndCriteria & | getEndCriteria () |
| Returns a REFERENCE to the endCriteria. | |
| bool | endCriteria_met (Angle &a, Distance &d) |
| Returns true if the endCriteria is met based on. More... | |
| b2Transform | from_Di (const b2Transform *custom_start=NULL, Disturbance *d_obs=NULL) |
| Returns a b2Transform expressing the pose of the disturbance relative to the robot in the robot's local coordinates. More... | |
| void | set_change (bool b) |
| bool | get_change () |
| bool | is_over () |
| If task has finished executing. More... | |
| Disturbance * | get_disturbance_ptr () |
| Get a pointer to the disturbance. More... | |
| const Disturbance & | get_disturbance () const |
| void | setMotorStep (int i) |
| int | getMotorStep () const |
| b2Transform | getStart () |
| b2Transform & | getStartRef () |
| Direction | get_direction () |
| void | set_direction (Direction d) |
Protected Member Functions | |
| bool | isTurnFinished (const b2Transform &robotTransform, Direction dir) |
| bool | isMoving () |
Protected Attributes | |
| char | planFile [250] |
| bool | debug_k =false |
| bool | change =0 |
| b2Transform | start =b2Transform_zero |
| EndCriteria | endCriteria |
| Direction | direction = DEFAULT |
| int | motorStep =0 |
| AffordanceIndex | affordance =NONE |
| Action | action |
| Disturbance | disturbance |
Friends | |
| class | Configurator |
A closed hybrid control loop. It has an initial disturbance representing the continuous state and a direction representing (in 2D) the discrete control strategy.
| simResult Task::bumping_that | ( | b2World & | _world, |
| int | iteration, | ||
| b2Body * | robot, | ||
| float | remaining = SIM_DURATION |
||
| ) |
Executes this task in a Box2D simulation.
| _world | box2d world |
| iteration | configurator iteration (for logging) |
| remaining | (simulation duration in seconds) |
| EndedResult Task::checkEnded | ( | b2Transform | robotTransform = b2Transform_zero, |
| Direction | dir = UNDEFINED, |
||
| bool | relax = 0, |
||
| b2Body * | robot = NULL, |
||
| std::pair< bool, b2Transform > | use_start = std::pair <bool,b2Transform>(1, b2Transform_zero) |
||
| ) |
Check if this task has ended based on state information (default are info for the task which calls the method)
| robotTransform | the robot's pose to evaluate |
| dir | the direction of the task being carried out |
| relax | apply a larger threshold to check whehter a goal was reached |
| robot | robot box2d body |
| use_start | use a custom start for the task |
| bool Task::checkEnded | ( | const b2PolygonShape & | box, |
| const b2Transform & | robot_pose = b2Transform_zero, |
||
| Disturbance * | dist_obs = NULL |
||
| ) |
Uses a virtual sensor (attention window) to determine whether the task has ended or not.
| box | the sensor |
| robot_pose | |
| dist_obs | pointer to the observed disturbance (the disturbance as it was at the beginning of the task, or as it was expected) |
| EndedResult Task::checkEnded | ( | const State & | n, |
| Direction | dir = UNDEFINED, |
||
| bool | relax = false, |
||
| std::pair< bool, b2Transform > | use_start = std::pair <bool,b2Transform>(1, b2Transform_zero) |
||
| ) |
Check if a state represents the end of this task.
| n | the state |
| dir | the direction of the task being carried out |
| relax | apply a larger threshold to check whehter a goal was reached |
| use_start | use a custom start for the task |
Returns true if the endCriteria is met based on.
| a | angle from the disturbance |
| d | distance from the disturbance |
| b2Transform Task::from_Di | ( | const b2Transform * | custom_start = NULL, |
| Disturbance * | d_obs = NULL |
||
| ) |
Returns a b2Transform expressing the pose of the disturbance relative to the robot in the robot's local coordinates.
| custom_start | global coordinates of the task start, if null defaults to the origin |
| d_obs | a disturbance different from the Di for this task. If null defaults to Di |
|
inline |
Get a pointer to the disturbance.
| EndCriteria Task::getEndCriteria | ( | const Disturbance & | d | ) |
Returns the endCriteria for this Task if it were to counteract Disturbance.
| d |
| Direction Task::H | ( | Disturbance | ob, |
| Direction | d, | ||
| bool | topDown = 0 |
||
| ) |
Agent transfer function H which generates a motor output (Action) in response to a disturbance.
| ob | the disturbance |
| d | top-down instruction on how to generate the Action. DEFAULT with no top down control generates a reflex |
| topDown | whether the input direction should be used as is (true) or to generate a reflex (false) |
NB: only generates default turns if absolute angle of the disturbance is larger than .1rad
|
inline |
If task has finished executing.
| void Task::setEndCriteria | ( | const Angle & | angle = SAFE_ANGLE, |
| const Distance & | distance = BOX2DRANGE |
||
| ) |
Sets the end criteria for this task (bounds of the Flow condition). Angle is a valid measurement for turning task but not for DEFAULT Tasks.
| angle | manually input angle |
| distance | manually input distance |