Commit 3e0fbd7a authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

[CollisionGeometry] Reintroduce member cost_density.

  - This member is used to convert a octomap to a set of boxes.
parent 5bf8bcb8
......@@ -58,7 +58,9 @@ enum NODE_TYPE {BV_UNKNOWN, BV_AABB, BV_OBB, BV_RSS, BV_kIOS, BV_OBBRSS, BV_KDOP
class CollisionGeometry
{
public:
CollisionGeometry()
CollisionGeometry() : cost_density(1),
threshold_occupied(1),
threshold_free(0)
{
}
......@@ -86,13 +88,15 @@ public:
}
/// @brief whether the object is completely occupied
inline bool isOccupied() const HPP_FCL_DEPRECATED { return true; }
inline bool isOccupied() const HPP_FCL_DEPRECATED
{ return cost_density >= threshold_occupied; }
/// @brief whether the object is completely free
inline bool isFree() const { return false; }
inline bool isFree() const HPP_FCL_DEPRECATED
{ return cost_density <= threshold_free; }
/// @brief whether the object has some uncertainty
inline bool isUncertain() const { return false; }
bool isUncertain() const HPP_FCL_DEPRECATED;
/// @brief AABB center in local coordinate
Vec3f aabb_center;
......@@ -106,6 +110,9 @@ public:
/// @brief pointer to user defined data specific to this object
void *user_data;
/// @brief collision cost for unit volume
FCL_REAL cost_density;
/// @brief threshold for occupied ( >= is occupied)
FCL_REAL threshold_occupied;
......
......@@ -38,6 +38,7 @@ set(${LIBRARY_NAME}_SOURCES
distance_func_matrix.cpp
collision_data.cpp
collision_node.cpp
collision_object.cpp
BV/RSS.cpp
BV/AABB.cpp
BV/kIOS.cpp
......
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011-2014, Willow Garage, Inc.
* Copyright (c) 2014-2015, Open Source Robotics Foundation
* 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 Open Source Robotics Foundation 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.
*/
/** \author Florent Lamiraux */
#include <hpp/fcl/collision_object.h>
namespace fcl {
bool CollisionGeometry::isUncertain() const
{
return !isOccupied() && !isFree();
}
} // namespace fcl
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