Two depth-image clearing designs lived in this package: the frustum ray
clearing inherited from dev_cam_intel (DepthCameraData sources of
ObstacleLayer/VoxelLayer, frustum_* and column_* keys) and the observed_volume
evidence clearing (ROC) on top of it. Both are replaced on the robot by
DepthCameraObstacleLayer, a port of costmap_depth_camera that takes the
filtered PointCloud2 directly, so both are removed and the tree is rebuilt
from main (a63c084) plus the plugin.
- observation.h / observation_buffer: DepthFrustumConfig, DepthCameraObservation
and the depth buffering API are gone; buffers hold point clouds only.
- ObstacleLayer/VoxelLayer: no frustum ray casting, column clearing or depth
ray cache. A DepthCameraData source or frustum_clearing_enabled: true now
fails at startup with a message pointing to DepthCameraObstacleLayer
instead of silently dropping the camera; DepthCameraData reaching the layer
through the gateway is ignored.
- copyParentParameters no longer forwards the frustum_* / column_* keys.
- ROC files (depth_evidence_store, depth_visibility, depth_frame_pairer) and
their tests are not carried over; CloudProcessingConfig goes with them.
- PCL is needed by the plugin library only. The plugin test moves under
BUILD_COSTMAP_TESTS; BUILD_DEPTH_MARKING_TESTS is gone.
- README documents DepthCameraObstacleLayer and its known limits.
The plugin code is unchanged from the version running on the KIT robot.
151 lines
5.5 KiB
C++
Executable File
151 lines
5.5 KiB
C++
Executable File
/*
|
|
* Copyright (c) 2008, 2013, Willow Garage, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions are met:
|
|
*
|
|
* * Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
* * Neither the name of the Willow Garage, Inc. nor the names of its
|
|
* contributors may be used to endorse or promote products derived from
|
|
* this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
* Authors: Conor McGann
|
|
*/
|
|
|
|
#ifndef ROBOT_COSTMAP_2D_OBSERVATION_H_
|
|
#define ROBOT_COSTMAP_2D_OBSERVATION_H_
|
|
|
|
#include <robot_geometry_msgs/Point.h>
|
|
#include <robot_sensor_msgs/PointCloud2.h>
|
|
#include <boost/make_shared.hpp>
|
|
#include <boost/shared_ptr.hpp>
|
|
#include <utility>
|
|
|
|
namespace robot_costmap_2d
|
|
{
|
|
|
|
/**
|
|
* @brief Stores an observation in terms of a point cloud and the origin of the source
|
|
* @note Tried to make members and constructor arguments const but the compiler would not accept the default
|
|
* assignment operator for vector insertion!
|
|
*/
|
|
class Observation
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Creates an empty observation
|
|
*/
|
|
Observation() :
|
|
cloud_handle_(boost::make_shared<robot_sensor_msgs::PointCloud2>()),
|
|
cloud_(cloud_handle_.get()), obstacle_range_(0.0), raytrace_range_(0.0)
|
|
{
|
|
}
|
|
|
|
virtual ~Observation() = default;
|
|
|
|
/**
|
|
* @brief Creates an observation from an origin point and a point cloud
|
|
* @param origin The origin point of the observation
|
|
* @param cloud The point cloud of the observation
|
|
* @param obstacle_range The range out to which an observation should be able to insert obstacles
|
|
* @param raytrace_range The range out to which an observation should be able to clear via raytracing
|
|
*/
|
|
Observation(robot_geometry_msgs::Point& origin, const robot_sensor_msgs::PointCloud2 &cloud,
|
|
double obstacle_range, double raytrace_range) :
|
|
origin_(origin), cloud_handle_(boost::make_shared<robot_sensor_msgs::PointCloud2>(cloud)),
|
|
cloud_(cloud_handle_.get()),
|
|
obstacle_range_(obstacle_range), raytrace_range_(raytrace_range)
|
|
{
|
|
}
|
|
|
|
Observation(robot_geometry_msgs::Point origin,
|
|
boost::shared_ptr<robot_sensor_msgs::PointCloud2> cloud,
|
|
double obstacle_range, double raytrace_range) :
|
|
origin_(std::move(origin)), cloud_handle_(std::move(cloud)),
|
|
cloud_(cloud_handle_.get()),
|
|
obstacle_range_(obstacle_range), raytrace_range_(raytrace_range)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @brief Copy constructor
|
|
* @param obs The observation to copy
|
|
*/
|
|
Observation(const Observation& obs) :
|
|
origin_(obs.origin_), cloud_handle_(obs.cloud_handle_), cloud_(cloud_handle_.get()),
|
|
obstacle_range_(obs.obstacle_range_), raytrace_range_(obs.raytrace_range_)
|
|
{
|
|
}
|
|
|
|
Observation(Observation&& obs) noexcept :
|
|
origin_(std::move(obs.origin_)), cloud_handle_(std::move(obs.cloud_handle_)),
|
|
cloud_(cloud_handle_.get()), obstacle_range_(obs.obstacle_range_),
|
|
raytrace_range_(obs.raytrace_range_)
|
|
{
|
|
obs.cloud_ = nullptr;
|
|
}
|
|
|
|
Observation& operator=(const Observation& obs)
|
|
{
|
|
if (this == &obs)
|
|
return *this;
|
|
|
|
origin_ = obs.origin_;
|
|
cloud_handle_ = obs.cloud_handle_;
|
|
cloud_ = cloud_handle_.get();
|
|
obstacle_range_ = obs.obstacle_range_;
|
|
raytrace_range_ = obs.raytrace_range_;
|
|
return *this;
|
|
}
|
|
|
|
Observation& operator=(Observation&& obs) noexcept
|
|
{
|
|
if (this == &obs)
|
|
return *this;
|
|
|
|
origin_ = std::move(obs.origin_);
|
|
cloud_handle_ = std::move(obs.cloud_handle_);
|
|
cloud_ = cloud_handle_.get();
|
|
obstacle_range_ = obs.obstacle_range_;
|
|
raytrace_range_ = obs.raytrace_range_;
|
|
obs.cloud_ = nullptr;
|
|
return *this;
|
|
}
|
|
|
|
/**
|
|
* @brief Creates an observation from a point cloud
|
|
* @param cloud The point cloud of the observation
|
|
* @param obstacle_range The range out to which an observation should be able to insert obstacles
|
|
*/
|
|
Observation(const robot_sensor_msgs::PointCloud2 &cloud, double obstacle_range) :
|
|
cloud_handle_(boost::make_shared<robot_sensor_msgs::PointCloud2>(cloud)),
|
|
cloud_(cloud_handle_.get()), obstacle_range_(obstacle_range), raytrace_range_(0.0)
|
|
{
|
|
}
|
|
|
|
robot_geometry_msgs::Point origin_;
|
|
boost::shared_ptr<robot_sensor_msgs::PointCloud2> cloud_handle_;
|
|
robot_sensor_msgs::PointCloud2* cloud_;
|
|
double obstacle_range_, raytrace_range_;
|
|
};
|
|
|
|
} // namespace robot_costmap_2d
|
|
#endif // ROBOT_COSTMAP_2D_OBSERVATION_H_
|