|
| BaseDistance () |
| Gets the parameters from ROS parameter server and initializes arguments with that. More...
|
|
void | compute_distance_keeping (double *vx, double *vy, double *vth) |
| Sets vx_last_, vy_last and vth_last_ to input parameters, adjusting them. More...
|
|
bool | compute_pose2d (const char *from, const char *to, const ros::Time time, double *x, double *y, double *th) |
| Computes the translation and rotation from one frame to another. More...
|
|
double | distance (std::vector< Vector2 > &points, Vector2 *nearest, double dx=0, double dy=0, double dth=0) |
| Calculates the distance to closest of points from nearest footprint wall The distance is calculated not from the current position of base_link_frame_, but the adjusted with dx , dy and dth one, because in the next timestamp the robot will have moved a little. More...
|
|
bool | fresh_scans (double watchdog_timeout) |
| Check if the laser scans are older than a certain timeout, to use with a watchdog. More...
|
|
void | setFootprint (double front, double rear, double left, double right, double tolerance) |
| Sets front_, rear_, left_, right_, tolerance_, and early_reject_distance_. More...
|
|
void | setSafetyLimits (double safety_dist, double slowdown_near, double slowdown_far, double rate) |
| Sets safety_dist_, slowdown_near_, slowdown_far_, and d_ = 1 / rate. More...
|
|
|
double | brake (std::vector< Vector2 > &points, double *vx, double *vy, double *vth) |
| If distance to closest point when moving with given velocity is short, brake. Given velocity here is given through vx , vy and vth . Short means smaller than safety_dist_. Adjusts mode_. More...
|
|
void | calculateEarlyRejectDistance () |
| early_reject_distance_ = diameter + slowdown_far_ + tolerance_ + movement_tolerance; More...
|
|
double | grad (std::vector< Vector2 > &points, double *gx, double *gy, double *gth) |
| Calculates the gradient of the distance to the closes point of points Is it increasing? Is it decreasing? How fast? More...
|
|
bool | interpolateBlindPoints (int n, const Vector2 &pt1, const Vector2 &pt2) |
| Interpolates n points between pt1 and pt2 and adds them to blind_spots_ Interpolation is linear and component-wise: separately on X and Y coordinates pt1 and pt2 are defined in odom_frame_. More...
|
|
void | laserCallback (int index, const sensor_msgs::LaserScan::ConstPtr &scan) |
| laserCallback Sets the laser_points_ to filtered data from lasers in the odom frame. Completes blind spots if complete_blind_spots is set to true. More...
|
|
double | project (std::vector< Vector2 > &points, double *vx, double *vy, double *vth) |
| Adapts the velocity given in parameters to slow down or back up Adjusts mode_, vx , vy and vth . More...
|
|
void | publishBaseMarker () |
| Publishes a purple cube at the position of the robot in odom_frame_ The size of the cube is the size of the footprint given through front_ etc. More...
|
|
void | publishLaserMarker (const Vector2 &pt, const std::string &ns, int id=0) |
| Publishes a red cube at the coordinates of pt using marker_pub_. More...
|
|
void | publishNearestPoint () |
| Publishes nearest_ as a cube or a sphere of corresponding color nearest_ is defined in base_link_frame_. More...
|
|
void | publishPoints (const std::vector< Vector2 > &points) |
| Publishes coordinates in points as a point cloud Uses laser_points_pub_ to publish. More...
|
|
Vector2 | transform (const Vector2 &v, double x, double y, double th) |
| Applies ridig transformation to the input vector, i.e. rotation and translation I.e. gets transformed into a coordinate system defined by x , y and th . More...
|
|
|
std::string | base_link_frame_ |
|
double | blind_spot_threshold_ |
| blind_spot_threshold_ Distance from base_link_frame to the end of a blind spot. Non-parallel lines always meet somewhere, so the blind spot is a triangle. If the obstacles are further away than the triangle, means they are outside of the blind spot, so there is no need to triangulate. More...
|
|
std::vector< Vector2 > | blind_spots_ |
| blind_spots_ A vector of interpolated coordinates for the blind spots Defined in the odom_frame_ More...
|
|
bool | complete_blind_spots_ |
| complete_blind_spots_ If the laser/s have blind spots, wheter to complete them. The completion will be through interpolation. More...
|
|
double | d_ |
| d_ duration of one time frame, i.e. dt or Tdot More...
|
|
ros::Publisher | debug_pub_ |
|
double | early_reject_distance_ |
| early_reject_distance_ From how many meters to discard laser measurements. Laser is used to avoid obstacles, so if the obstacles are far away they're not relevant for the time being. More...
|
|
double | front_ |
| Footprint of the robot, coordinates of front edge, back edge, etc. in the footprint coordinate system. E.g. front = 0.33, rear = -0.33, left = 0.33, right = -0.33. More...
|
|
ros::Time | laser_0_last_msg_time_ |
| Stores the last time when we received laser messages. More...
|
|
ros::Time | laser_1_last_msg_time_ |
|
boost::shared_ptr< std::vector< Vector2 > > | laser_points_ [2] |
| laser_points_ Data from lasers filtered and converted into the odom frame. The size is 2 for 2 lasers, i.e. supports up to 2 lasers only. More...
|
|
ros::Publisher | laser_points_pub_ |
|
ros::Subscriber | laser_subscriptions_ [2] |
|
double | left_ |
|
boost::mutex | lock |
|
ros::Publisher | marker_pub_ |
|
double | marker_size_ |
| marker_size_ When publishing points to RViz, in meters More...
|
|
int | mode_ |
| mode_ Defined the movement mode for the base. Can be one of the modes defined in the cpp file: MODE_FREE - move freely, MODE_PROJECTING - slow down slowly, MODE_HARD_PROJECTING - slow down faster, MODE_BRAKING - brake right now, command 0 velocity, MODE_REPELLING - move away from obstacle. More...
|
|
ros::NodeHandle | n_ |
|
int | n_lasers_ |
| n_lasers_ Number of laser scanners that create the base scan. Note: laser_points_ is of size 2, so currently only up to 2 lasers supported. More...
|
|
Vector2 | nearest_ |
| nearest_ The nearest point to the base More...
|
|
std::string | odom_frame_ |
|
double | rear_ |
|
double | repelling_dist_ |
| repelling_dist_ Distance from footprint edges to closest obstacle point from when to start backing up More...
|
|
double | repelling_gain_ |
|
double | repelling_gain_max_ |
|
double | right_ |
|
double | rob_th_ |
|
double | rob_x_ |
| rob_x_, rob_y_, rob_th_ Pose of the base_link_frame_ in odom_frame_ More...
|
|
double | rob_y_ |
|
double | safety_dist_ |
| safety_dist_ Distance in meters when to brake when moving with current velocity. More...
|
|
double | slowdown_far_ |
| slowdown_far_ Distance from footprint edges to closest obstacle point from when to start slowing More...
|
|
double | slowdown_near_ |
| slowdown_near_ Distance from footprint edges to closest obstacle point from when to slow aggressively More...
|
|
tf::TransformListener | tf_ |
|
double | tolerance_ |
| tolerance_ Error in the footprint measurements in meters. More...
|
|
double | vth_last_ |
|
double | vx_last_ |
| vx_last_, vy_last_, vth_last_ Robot velocity to drive with in next time frame More...
|
|
double | vy_last_ |
|
This is the BaseDistance utility class for avoiding obstacles! It figures out if the robot should slow down or move freely based on laser scan data. If there are points in the laser (lasers) that are closer than safe distance the robot should start slowing down, completely brake, or even back up.
ROS topics
Subscribes to (name/type):
- "~laser_1" sensor_msgs/LaserScan: laser scan from first laser
- "~laser_2" sensor_msgs/LaserScan: laser scan from second laser if available
Publishes to (name / type):
- "/visualization_marker" visualization_msgs/Marker : markers for base footprint and laser nearest point
- "~laser_points" sensor_msgs/PointCloud : laser scanner points from combined lasers & interpolated blind spots
- "~debug_channels" std_msgs/Float64MultiArray : debug array for velocity gradient debugging of grad method
ROS parameters
- "odom_frame" (string) : odometry frame, default: "/odom"
- "base_link_frame" (string) : base frame, default: "/base_link"
- "n_lasers" (int) : number of lasers on robot's base, default: 2
- "slowdown_far" (double) : distance from footprint edges to closest obstacle point from when to start slowing, default: 0.30 m
- "slowdown_near" (double) : distance from footprint edges to closest obstacle point from when to slow aggressively, default: 0.15 m
- "safety_dist" (double) : distance in meters when to brake when moving with current velocity, default: 0.10 m
- "repelling_dist" (double) : distance from footprint edges to closest obstacle point from when to start backing up, default: 0.20 m
- "repelling_gain" (double) : gain for repelling speed, default: 0.5
- "repelling_gain_max" (double) : maximum repelling speed gain, default: 0.015
- "complete_blind_spots" (bool) : interpolate the angles where lasers can't see or not, default: true
- "blind_spot_threshold" (double) : distance from base_link_frame to the end of a blind spot, default: 0.85 m
- "marker_size" (double) : size of markers in Rviz, default: 0.1 m
Definition at line 80 of file BaseDistance.h.
double BaseDistance::front_ |
|
private |
Footprint of the robot, coordinates of front edge, back edge, etc. in the footprint coordinate system. E.g. front = 0.33, rear = -0.33, left = 0.33, right = -0.33.
Definition at line 184 of file BaseDistance.h.
mode_ Defined the movement mode for the base. Can be one of the modes defined in the cpp file: MODE_FREE - move freely, MODE_PROJECTING - slow down slowly, MODE_HARD_PROJECTING - slow down faster, MODE_BRAKING - brake right now, command 0 velocity, MODE_REPELLING - move away from obstacle.
Definition at line 269 of file BaseDistance.h.