2 #ifndef RANGE_SENSOR_LAYER_RANGE_SENSOR_LAYER_H_ 3 #define RANGE_SENSOR_LAYER_RANGE_SENSOR_LAYER_H_ 7 #include <sensor_msgs/Range.h> 8 #include <range_sensor_layer/RangeSensorLayerConfig.h> 9 #include <dynamic_reconfigure/server.h> 12 #include <unordered_map> 31 virtual void updateBounds(
double robot_x,
double robot_y,
double robot_yaw,
32 double* min_x,
double* min_y,
double* max_x,
double* max_y);
39 void reconfigureCB(range_sensor_layer::RangeSensorLayerConfig &config, uint32_t level);
48 void updateCostmap(sensor_msgs::Range& range_message,
bool clear_sensor_cone);
50 double gamma(
double theta);
51 double delta(
double phi);
54 void get_deltas(
double angle,
double *dx,
double *dy);
55 void update_cell(
double ox,
double oy,
double ot,
double r,
double nx,
double ny,
bool clear);
84 dynamic_reconfigure::Server<range_sensor_layer::RangeSensorLayerConfig> *
dsrv_;
87 float area(
int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
89 return fabs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2.0);
92 int orient2d(
int Ax,
int Ay,
int Bx,
int By,
int Cx,
int Cy)
94 return (Bx - Ax) * (Cy - Ay) - (By - Ay) * (Cx - Ax);
98 #endif // RANGE_SENSOR_LAYER_RANGE_SENSOR_LAYER_H
void get_deltas(double angle, double *dx, double *dy)
size_t ranges_buffer_size_
virtual void onInitialize()
double no_readings_timeout_
void processFixedRangeMsg(sensor_msgs::Range &range_message)
void processRangeMsg(sensor_msgs::Range &range_message)
virtual void updateBounds(double robot_x, double robot_y, double robot_yaw, double *min_x, double *min_y, double *max_x, double *max_y)
void reconfigureCB(range_sensor_layer::RangeSensorLayerConfig &config, uint32_t level)
void processVariableRangeMsg(sensor_msgs::Range &range_message)
bool clear_on_max_reading_
std::unordered_map< std::string, std::list< sensor_msgs::Range > > range_msgs_buffers_
void bufferIncomingRangeMsg(const sensor_msgs::RangeConstPtr &range_message, const std::string &topic)
boost::mutex range_message_mutex_
std::vector< ros::Subscriber > range_subs_
double gamma(double theta)
boost::function< void(sensor_msgs::Range &range_message)> processRangeMessageFunc_
double sensor_model(double r, double phi, double theta)
dynamic_reconfigure::Server< range_sensor_layer::RangeSensorLayerConfig > * dsrv_
void update_cell(double ox, double oy, double ot, double r, double nx, double ny, bool clear)
unsigned int buffered_readings_
virtual void deactivate()
std::string global_frame_
int orient2d(int Ax, int Ay, int Bx, int By, int Cx, int Cy)
unsigned char to_cost(double p)
static const unsigned char LETHAL_OBSTACLE
ros::Time last_reading_time_
float area(int x1, int y1, int x2, int y2, int x3, int y3)
virtual void updateCosts(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
double to_prob(unsigned char c)