8 #include "drive_msgs/drive_param.h" 11 #include "sensor_msgs/LaserScan.h" 12 #include "std_msgs/Bool.h" 13 #include "std_msgs/Float64.h" 15 #include <ros/console.h> 18 #include <dynamic_reconfigure/server.h> 19 #include <wallfollowing1/wallfollowing1Config.h> 37 float m_min_range = 0.2;
38 float m_max_range = 30;
40 float m_fallback_range = 4;
45 float m_wall_following_max_speed = 0.25;
46 float m_wall_following_min_speed = 0.2;
50 float m_prediction_distance = 2;
52 float m_target_wall_distance = 0.5;
54 float m_time_between_scans = 0.025;
56 ros::NodeHandle m_node_handle;
58 dynamic_reconfigure::Server<wallfollowing1::wallfollowing1Config> m_dyn_cfg_server;
60 ros::Subscriber m_lidar_subscriber;
61 ros::Publisher m_drive_parameter_publisher;
66 void followSingleWall(
const sensor_msgs::LaserScan::ConstPtr& lidar,
bool right_wall);
67 void followWalls(
const sensor_msgs::LaserScan::ConstPtr& lidar);
68 Wall getWall(
const sensor_msgs::LaserScan::ConstPtr& lidar,
bool right_wall);
70 void lidarCallback(
const sensor_msgs::LaserScan::ConstPtr& lidar);
71 void publishDriveParameters(
float velocity,
float angle);
73 void updateDynamicConfig();
80 float getRangeAtDegree(
const sensor_msgs::LaserScan::ConstPtr& lidar,
float angle);
constexpr float DEG_TO_RAD
constexpr const char * TOPIC_VISUALIZATION
constexpr const char * TOPIC_DRIVE_PARAMETERS
constexpr const char * TOPIC_EMERGENCY_STOP
constexpr const char * LIDAR_FRAME
constexpr const char * TOPIC_LASER_SCAN