Class PotentialFieldObstacle

Class Documentation

class PotentialFieldObstacle

Represents a single obstacle in the potential field environment.

Holds a world-frame pose (position + orientation), a group classification, and a concrete ObstacleGeometry that describes the shape. All signed-distance, normal, and Coal collision-object operations are delegated to the geometry.

Public Functions

PotentialFieldObstacle() = delete
~PotentialFieldObstacle() = default
inline PotentialFieldObstacle(std::string frameID, Eigen::Vector3d centerPosition, Eigen::Quaterniond orientation, ObstacleGroup group, std::unique_ptr<ObstacleGeometry> geometry, const std::string &meshResource = std::string(), const Eigen::Vector3d &meshScale = Eigen::Vector3d::Ones())

Constructs a PotentialFieldObstacle.

Parameters:
  • frameID – Unique identifier for this obstacle (e.g. “link1::collision”).

  • centerPosition – World-frame center position.

  • orientation – World-frame orientation.

  • group – Obstacle group (STATIC, DYNAMIC, ROBOT).

  • geometry – Concrete geometry describing the obstacle shape. Ownership is transferred via unique_ptr.

  • meshResource – URI to the mesh file (used only when geometry is MeshGeometry).

  • meshScale – Scale applied to the mesh for visualization.

inline PotentialFieldObstacle(const PotentialFieldObstacle &other)
inline PotentialFieldObstacle(PotentialFieldObstacle &&other) noexcept
inline PotentialFieldObstacle &operator=(const PotentialFieldObstacle &other)
inline bool operator==(const PotentialFieldObstacle &other) const
inline bool operator!=(const PotentialFieldObstacle &other) const
inline std::string getFrameID() const
inline ObstacleGroup getGroup() const
inline Eigen::Vector3d getPosition() const
inline Eigen::Quaterniond getOrientation() const
inline ObstacleType getType() const
inline const ObstacleGeometry &getGeometry() const
inline const std::string &getMeshResource() const
inline Eigen::Vector3d getMeshScale() const
inline std::shared_ptr<coal::CollisionObject> getCoalCollisionObject() const
inline void setPose(const Eigen::Vector3d newPosition, const Eigen::Quaterniond newOrientation)
inline void setPosition(Eigen::Vector3d newPosition)
inline void setOrientation(Eigen::Quaterniond newOrientation)
inline void setMeshCollisionData(const std::shared_ptr<MeshCollisionData> &meshData)
inline void setMeshProperties(const std::string &meshResource, const Eigen::Vector3d &meshScale)
bool withinInfluenceZone(Eigen::Vector3d worldPoint, double influenceDistance) const
bool withinObstacle(Eigen::Vector3d worldPoint) const
Eigen::Vector3d toObstacleFrame(const Eigen::Vector3d &worldPoint) const

Rotate the given point into the obstacle’s local frame.

Parameters:

worldPoint – Point in world coordinates.

Returns:

The point expressed in the obstacle’s local frame.

Eigen::Vector3d halfDimensions() const

Returns the half-dimensions of the obstacle’s axis-aligned bounding box.

Used for broad-phase influence-zone checks.

void computeSignedDistanceAndNormal(const Eigen::Vector3d &worldPoint, double &signedDistance, Eigen::Vector3d &normal) const

Computes the signed distance and outward normal from a world point to the obstacle surface.

Parameters:
  • worldPoint[in] Query point in world coordinates.

  • signedDistance[out] Distance to the surface (negative if inside).

  • normal[out] Outward unit normal in world coordinates.

std::shared_ptr<coal::CollisionObject> toCoalCollisionObject()

Creates (or returns the cached) Coal collision object for this obstacle.

Returns:

Shared pointer to the Coal collision object.

void updateCoalCollisionObjectPose() const

Updates the cached Coal collision object’s pose to match the current obstacle position and orientation.