70 const std::vector<ModelRanger::Sensor>& sensors = rgr->
GetSensors();
73 for(
unsigned int i=0; i < 8; i++ )
75 dx += sensors[i].ranges[0] * cos( sensors[i].pose.a );
76 dy += sensors[i].ranges[0] * sin( sensors[i].pose.a );
79 if( (dx == 0) || (dy == 0) )
82 double resultant_angle = atan2( dy, dx );
83 double forward_speed = 0.0;
84 double side_speed = 0.0;
105 if( fabs(turn_speed) < 0.1 )
106 turn_speed = drand48();
127 if( other->
range < dist )
meters_t range
range to the target
Model * GetUnusedModelOfType(const std::string &type)
The Stage library uses its own namespace.
std::vector< Fiducial > & GetFiducials()
ModelFiducial::Fiducial * closest
void SetSpeed(double x, double y, double a)
void Init(int *argc, char **argv[])
int(* model_callback_t)(Model *mod, void *user)
int FiducialUpdate(ModelFiducial *fid, robot_t *robot)
int RangerUpdate(ModelRanger *mod, robot_t *robot)
void AddCallback(callback_type_t type, model_callback_t cb, void *user)
radians_t bearing
bearing to the target
const std::vector< Sensor > & GetSensors() const
radians_t closest_bearing
Pose geom
size and relative angle of the target
const double EXPAND_WGAIN
radians_t closest_heading_error
radians_t a
rotation about the z axis.