#include <AlgoVFH.h>
Public Member Functions | |
VFH_Algorithm (Decimal cell_size, int window_diameter, int sector_angle, Decimal safety_dist_0ms, Decimal safety_dist_1ms, int max_speed, int max_speed_narrow_opening, int max_speed_wide_opening, int max_acceleration, int min_turnrate, int max_turnrate_0ms, int max_turnrate_1ms, Decimal min_turn_radius_safety_factor, Decimal free_space_cutoff_0ms, Decimal obs_cutoff_0ms, Decimal free_space_cutoff_1ms, Decimal obs_cutoff_1ms, Decimal weight_desired_dir, Decimal weight_current_dir) | |
~VFH_Algorithm () | |
int | Init () |
int | Update_VFH (Decimal laser_ranges[361][2], int current_speed, Decimal goal_direction, Decimal goal_distance, Decimal goal_distance_tolerance, int &chosen_speed, int &chosen_turnrate) |
Chooses a new speed and turnrate based on the given laser data and current speed. | |
int | GetMinTurnrate () |
gets the minimum turn rate | |
Decimal | GetDesiredAngle () |
gets the desired angle | |
Decimal | GetPickedAngle () |
actual angle | |
int | GetMaxTurnrate (int speed) |
gets the max turnrate | |
int | GetCurrentMaxSpeed () |
gets the current max speed | |
void | SetRobotRadius (Decimal robot_radius) |
set the radius of the robot | |
void | SetMinTurnrate (int min_turnrate) |
sets the minimum turnrate | |
void | SetCurrentMaxSpeed (int Current_Max_Speed) |
sets the max current speed | |
Public Attributes | |
Decimal * | Hist |
VFH_Algorithm::VFH_Algorithm | ( | Decimal | cell_size, | |
int | window_diameter, | |||
int | sector_angle, | |||
Decimal | safety_dist_0ms, | |||
Decimal | safety_dist_1ms, | |||
int | max_speed, | |||
int | max_speed_narrow_opening, | |||
int | max_speed_wide_opening, | |||
int | max_acceleration, | |||
int | min_turnrate, | |||
int | max_turnrate_0ms, | |||
int | max_turnrate_1ms, | |||
Decimal | min_turn_radius_safety_factor, | |||
Decimal | free_space_cutoff_0ms, | |||
Decimal | obs_cutoff_0ms, | |||
Decimal | free_space_cutoff_1ms, | |||
Decimal | obs_cutoff_1ms, | |||
Decimal | weight_desired_dir, | |||
Decimal | weight_current_dir | |||
) |
[in] | cell_size | Local occupancy map grid size (default 0.1 m) |
[in] | window_diameter | Dimensions of occupancy map (map consists of window_diameter X window_diameter cells) (defaul 61) |
[in] | sector_angle | Histogram angular resolution, in degrees (default 5) |
[in] | safety_dist_0ms | The minimum distance the robot is allowed to get to obstacles when stopped (defaul 0.1 m) |
[in] | safety_dist_1ms | The minimum distance the robot is allowed to get to obstacles when travelling at 1 m/s. (default safetyDist0ms) |
[in] | max_speed | The maximum allowable speed of the robot (defaul 0.2 m/s) |
[in] | max_speed_narrow_opening | The maximum allowable speed of the robot through a narrow opening (defaul maxSpeed) |
[in] | max_speed_wide_opening | The maximum allowable speed of the robot through a wide opening (defaul maxSpeed) |
[in] | max_acceleration | The maximum allowable acceleration of the robot (default 0.2 m/s^2) |
[in] | min_turnrate | The minimum allowable turnrate of the robot (default 10 deg/s) |
[in] | max_turnrate_0ms | The maximum allowable turnrate of the robot when stopped (default 40 deg/s) |
[in] | max_turnrate_1ms | The maximum allowable turnrate of the robot when travelling 1 m/s (default maxTurnrate0ms) |
[in] | min_turn_radius_safety_factor | min turnrate radius safety factor (default 1.0) |
[in] | free_space_cutoff_0ms | free_space_cutoff_0ms Unitless value. The higher the value, the closer the robot will get to obstacles before avoiding (while stopped) (default 5000000.0) |
[in] | free_space_cutoff_0ms | free space cut off (default freeSpaceCutoff0ms) |
[in] | free_space_cutoff_1ms | Unitless value. The higher the value, the closer the robot will get to obstacles before avoiding (while travelling at 1 m/s) (default freeSpaceCutoff0ms) |
[in] | obs_cutoff_0ms | obstacle cut off (default freeSpaceCutoff1ms) |
[in] | weight_desired_dir | Bias for the robot to turn to move toward goal position (default 5.0) |
[in] | weight_current_dir | Bias for the robot to continue moving in current direction of travel (default 3.0) |
VFH_Algorithm::~VFH_Algorithm | ( | ) |
int VFH_Algorithm::Init | ( | ) |
int VFH_Algorithm::Update_VFH | ( | Decimal | laser_ranges[361][2], | |
int | current_speed, | |||
Decimal | goal_direction, | |||
Decimal | goal_distance, | |||
Decimal | goal_distance_tolerance, | |||
int & | chosen_speed, | |||
int & | chosen_turnrate | |||
) |
Chooses a new speed and turnrate based on the given laser data and current speed.
[in] | laser_ranges[361][2] | laser ranges |
[in] | current_speed | current speed |
[in] | goal_direction | in degrees, 0deg is to the right |
[in] | goal_distance_tolerance | in mm |
[in] | goal_distance | in mm |
[out] | &chosen_speed | chosen speed |
[out] | &chosen_turnrate | chosen turnrate |
int VFH_Algorithm::GetMinTurnrate | ( | ) | [inline] |
gets the minimum turn rate
Decimal VFH_Algorithm::GetDesiredAngle | ( | ) | [inline] |
gets the desired angle
Decimal VFH_Algorithm::GetPickedAngle | ( | ) | [inline] |
actual angle
int VFH_Algorithm::GetMaxTurnrate | ( | int | speed | ) |
gets the max turnrate
[in] | speed |
int VFH_Algorithm::GetCurrentMaxSpeed | ( | ) | [inline] |
gets the current max speed
void VFH_Algorithm::SetRobotRadius | ( | Decimal | robot_radius | ) | [inline] |
set the radius of the robot
[in] | robot_radius | robot radius |
void VFH_Algorithm::SetMinTurnrate | ( | int | min_turnrate | ) | [inline] |
sets the minimum turnrate
[in] | min_turnrate | minimum turnrate |
void VFH_Algorithm::SetCurrentMaxSpeed | ( | int | Current_Max_Speed | ) |
sets the max current speed
[in] | Current_Max_Speed | the maximum speed setted |