X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fdevices%2Frobot%2Ftrajectory_manager%2Ftrajectory_manager.h;h=3ebd586b32dcdeacfa5e768ad077b2732eb799d8;hp=648ec1c96a749aa04344b8eda66ca6805d032775;hb=dcb7cd39f9e3026ac926fa471056bf52f3f4023f;hpb=91987ff2747a521681d087935148964eed6b3556 diff --git a/modules/devices/robot/trajectory_manager/trajectory_manager.h b/modules/devices/robot/trajectory_manager/trajectory_manager.h index 648ec1c..3ebd586 100644 --- a/modules/devices/robot/trajectory_manager/trajectory_manager.h +++ b/modules/devices/robot/trajectory_manager/trajectory_manager.h @@ -47,6 +47,15 @@ enum trajectory_state { RUNNING_CIRCLE, }; +struct circle_target { + vect2_cart center; /**< center of the circle */ + double radius; /**< radius of the circle */ + int32_t dest_angle; /**< dst angle in inc */ + +#define TRIGO 1 /* rotation is counterclockwise */ +#define FORWARD 2 /* go forward or backward */ + uint8_t flags; /**< flags for this trajectory */ +}; struct trajectory { enum trajectory_state state; /*<< describe the type of target, and if we reached the target */ @@ -54,6 +63,7 @@ struct trajectory { union { vect2_cart cart; /**<< target, if it is a x,y vector */ struct rs_polar pol; /**<< target, if it is a d,a vector */ + struct circle_target circle; /**<< target, if it is a circle */ } target; double d_win; /**<< distance window (for END_NEAR) */ @@ -160,4 +170,10 @@ void trajectory_goto_d_a_rel(struct trajectory *traj, double d, double a); /** go forward to a x,y relative point, using a trajectory event */ void trajectory_goto_xy_rel(struct trajectory *traj, double x_rel_mm, double y_rel_mm); +/** make the robot orbiting around (x,y) on a circle whose radius is + * radius_mm, and exit when relative destination angle is reached. The + * flags set if we go forward or backwards, and CW/CCW. */ +void trajectory_circle_rel(struct trajectory *traj, double x, double y, + double radius_mm, double rel_a_deg, uint8_t flags); + #endif //TRAJECTORY_MANAGER