35 #define _DO_NOT_USE_OPENCV_ 0
36 #define _DO_NOT_USE_CARMEN_ 0
50 #include <atlasmv_base/AtlasmvLightsCommand.h>
51 #include <atlasmv_base/AtlasmvVertSignsCommand.h>
52 #include <atlasmv_base/AtlasmvMotionCommand.h>
53 #include <atlasmv_base/AtlasmvStatus.h>
57 template <
class cmd_type>
62 typename std::map<int,cmd_type>::iterator
it;
67 for(it=message_map.begin();it!=message_map.end();it++)
68 if(ros::Time::now().toSec() > (*it).second->lifetime)
69 message_map.erase(it);
74 msg->lifetime=ros::Time::now().toSec()+msg->lifetime;
76 it=message_map.find(msg->priority);
78 if(it==message_map.end())
79 message_map[msg->priority]=msg;
82 message_map.erase(it);
83 message_map[msg->priority]=msg;
92 typename std::map<int,cmd_type>::iterator it_max;
94 for(it=message_map.begin();it!=message_map.end();it++)
95 if((*it).second->priority > max_priority)
97 max_priority=(*it).second->priority;
101 if(message_map.size())
102 return (*it_max).second;
137 int main(
int argc,
char **argv);
pthread_mutex_t command_mutex
void atlasmv_help(bool debug)
writes used flags for help.
atlasmv_base::AtlasmvLightsCommandPtr atlasmv_lights
int initialize_motion_model(t_motion_model *model, double X0, double Y0, double orientation, double wheelbase)
Initialize car motion model.
double S
Distance traveled.
pthread_mutex_t speed_mutex
int main(int argc, char **argv)
c_atlasmv.h file for this module. Includes, global vars, function prototypes, etc.
class that defines everything related with the atlasmv robot interface. this class only deals with SI...
double percentage2real_velocity(double percentage)
pthread_mutex_t brake_check_mutex
void atlasmv_shutdown_module(int x)
std::map< int, cmd_type > message_map
pthread_mutex_t dir_mutex
TYPE_atlasmv_public_params atlasmv_details
atlasmv_base::AtlasmvStatusPtr atlasmv_status
command_queue_priority< atlasmv_base::AtlasmvMotionCommandPtr > command_queue
int update_motion_model(t_motion_model *model, double velocity, double steering_angle)
Updates velocity and steering variables.
atlasmv_base::AtlasmvVertSignsCommandPtr atlasmv_vert_signs
std::map< int, cmd_type >::iterator it
pthread_mutex_t speed_check_mutex
TYPE_atlasmv_public_params params
void push_msg(cmd_type msg)
pthread_mutex_t brk_mutex
pthread_mutex_t dioc_mutex
pthread_mutex_t count_des_errors_mutex
char new_command_received
atlasmv_base::AtlasmvMotionCommandPtr atlasmv_motion
typedef that includes all params that define atlasmv robot
t_motion_model motion_model
int increment_motion_model(t_motion_model *model, double dt)
Increments motion model based on the current available information.