Commit 3c8b4178 authored by Niklas Yann Wettengel's avatar Niklas Yann Wettengel
Browse files

filter scan rages

parent 858ef333
......@@ -2,6 +2,8 @@
/homer_navigation/waypoint_sampling_threshold: 1.0 # factor of how dense the path waypoints are sampled regarding the obstacle_distance of the last or next waypoint
/homer_navigation/frontier_safeness_factor: 1.0 # factor of min_allowed_obstacle_distance to an obstacle of a cell which is considered safe
/homer_navigation/scan/skip_ranges: 23
### cost calculation parameters
/homer_navigation/allowed_obstacle_distance/min: 0.27 # m robot must stay further away than this from obstacles
/homer_navigation/allowed_obstacle_distance/max: 5.0 # m not used at the moment
......
......@@ -1363,7 +1363,16 @@ void HomerNavigationNode::maxDepthMoveDistanceCallback(const std_msgs::Float32::
void HomerNavigationNode::laserDataCallback(const sensor_msgs::LaserScan::ConstPtr& msg)
{
m_scan_map[msg->header.frame_id] = msg;
sensor_msgs::LaserScan::Ptr tmp_scan = boost::make_shared<sensor_msgs::LaserScan>(*msg);
int param_skip_ranges = 0;
ros::param::getCached("/homer_navigation/scan/skip_ranges", param_skip_ranges);
for( int i = 0; i < param_skip_ranges; i++ ) {
tmp_scan->ranges[i] = 0.0;
}
for( int i = tmp_scan->ranges.size()-1; i >= tmp_scan->ranges.size() - param_skip_ranges; i-- ) {
tmp_scan->ranges[i] = 0.0;
}
m_scan_map[msg->header.frame_id] = tmp_scan;
if (m_state != IDLE)
{
std::vector<geometry_msgs::Point> points = map_tools::laser_msg_to_points(msg, m_transform_listener, "/base_link");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment