Struct jalansim::obstacle::CircleObstacle
template <typename T, std::size_t N_TRAJ>
ClassList > jalansim > obstacle > CircleObstacle
Circular obstacle with trajectory support. More...
#include <circle.hpp>
Public Attributes
| Type | Name |
|---|---|
| T | poly_x X coordinates of polygon vertices (local frame) |
| T | poly_y Y coordinates of polygon vertices (local frame) |
| T | radius = T(0.1)Obstacle radius. |
| std::size_t | traj_size = 1Number of trajectory waypoints. |
| T | traj_time = {T(0.0)}Timestamps for trajectory waypoints. |
| T | traj_x = {T(0.0)}X coordinates of trajectory waypoints. |
| T | traj_y = {T(0.0)}Y coordinates of trajectory waypoints. |
| T | traj_yaw Yaw angles of trajectory waypoints (radians) |
| std::size_t | verts = 4Number of vertices in the polygon. |
Public Functions
| Type | Name |
|---|---|
| JALANSIM_HOST_DEVICE bool | collided (T x, T y) const Check collision with a point. |
| JALANSIM_HOST_DEVICE bool | collided (T x, T y) const Check collision with a point (implementation needed). |
| JALANSIM_HOST_DEVICE T | distance (T x, T y) const Calculate distance from a point to obstacle center. |
| JALANSIM_HOST_DEVICE T | distance (T x, T y) const Calculate distance from a point to obstacle (implementation needed). |
| JALANSIM_HOST_DEVICE T | get_radius () const Get the current obstacle radius. |
| JALANSIM_HOST_DEVICE T | get_radius () const Get the current obstacle radius. |
| JALANSIM_HOST_DEVICE void | get_trajectory (T * x, T * y, T * time) const Get the obstacle trajectory. |
| JALANSIM_HOST_DEVICE void | get_trajectory (T * x, T * y, T * yaw, T * time) const Get the obstacle trajectory with orientation. |
| JALANSIM_HOST_DEVICE void | set_radius (T r) Set the obstacle radius. |
| JALANSIM_HOST_DEVICE void | set_radius (T r) Set the obstacle radius (note: for polygon obstacles, this may affect scaling). |
| JALANSIM_HOST_DEVICE void | set_trajectory (const T * x, const T * y, const T * time) Set the obstacle trajectory. |
| JALANSIM_HOST_DEVICE void | set_trajectory (const T * x, const T * y, const T * yaw, const T * time, std::size_t n) Set the obstacle trajectory with orientation. |
Detailed Description
Polygonal obstacle with trajectory and orientation support.
Represents a moving circular obstacle that can follow a predefined trajectory over time. Provides collision detection and distance calculation based on the obstacle's current position. The trajectory is defined by a series of waypoints with associated timestamps.
Template parameters:
TNumeric type (float, double)N_TRAJMaximum number of trajectory waypoints
Represents a moving polygonal obstacle that can follow a predefined trajectory over time with orientation changes. Provides collision detection and distance calculation based on the obstacle's current position and orientation. The trajectory includes position, yaw angle, and timestamps. Supports up to 16 vertices and 64 trajectory waypoints.
Template parameters:
TNumeric type (float, double)
Public Attributes Documentation
variable poly_x
X coordinates of polygon vertices (local frame)
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::poly_x[16];
variable poly_y
Y coordinates of polygon vertices (local frame)
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::poly_y[16];
variable radius
Obstacle radius.
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::radius;
Bounding radius for the polygon.
variable traj_size
Number of trajectory waypoints.
std::size_t jalansim::obstacle::CircleObstacle< T, N_TRAJ >::traj_size;
variable traj_time
Timestamps for trajectory waypoints.
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::traj_time;
variable traj_x
X coordinates of trajectory waypoints.
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::traj_x;
variable traj_y
Y coordinates of trajectory waypoints.
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::traj_y;
variable traj_yaw
Yaw angles of trajectory waypoints (radians)
T jalansim::obstacle::CircleObstacle< T, N_TRAJ >::traj_yaw[64];
variable verts
Number of vertices in the polygon.
std::size_t jalansim::obstacle::CircleObstacle< T, N_TRAJ >::verts;
Public Functions Documentation
function collided [1/2]
Check collision with a point.
inline JALANSIM_HOST_DEVICE bool jalansim::obstacle::CircleObstacle::collided (
T x,
T y
) const
Parameters:
xX coordinate of point to checkyY coordinate of point to check
Returns:
True if point is inside obstacle, false otherwise
function collided [1/2]
Check collision with a point (implementation needed).
inline JALANSIM_HOST_DEVICE bool jalansim::obstacle::CircleObstacle::collided (
T x,
T y
) const
Parameters:
xX coordinate of point to checkyY coordinate of point to check
Returns:
True if point is inside obstacle, false otherwise
function distance [1/2]
Calculate distance from a point to obstacle center.
inline JALANSIM_HOST_DEVICE T jalansim::obstacle::CircleObstacle::distance (
T x,
T y
) const
Parameters:
xX coordinate of pointyY coordinate of point
Returns:
Euclidean distance to obstacle center
function distance [1/2]
Calculate distance from a point to obstacle (implementation needed).
inline JALANSIM_HOST_DEVICE T jalansim::obstacle::CircleObstacle::distance (
T x,
T y
) const
Parameters:
xX coordinate of pointyY coordinate of point
Returns:
Distance to obstacle
function get_radius [1/2]
Get the current obstacle radius.
inline JALANSIM_HOST_DEVICE T jalansim::obstacle::CircleObstacle::get_radius () const
Returns:
Current radius value
function get_radius [1/2]
Get the current obstacle radius.
inline JALANSIM_HOST_DEVICE T jalansim::obstacle::CircleObstacle::get_radius () const
Returns:
Current radius value
function get_trajectory [1/2]
Get the obstacle trajectory.
inline JALANSIM_HOST_DEVICE void jalansim::obstacle::CircleObstacle::get_trajectory (
T * x,
T * y,
T * time
) const
Parameters:
xOutput array for X coordinates (must have space for N_TRAJ elements)yOutput array for Y coordinates (must have space for N_TRAJ elements)timeOutput array for timestamps (must have space for N_TRAJ elements)
function get_trajectory [2/2]
Get the obstacle trajectory with orientation.
inline JALANSIM_HOST_DEVICE void jalansim::obstacle::CircleObstacle::get_trajectory (
T * x,
T * y,
T * yaw,
T * time
) const
Parameters:
xOutput array for X coordinates (must have space for traj_size elements)yOutput array for Y coordinates (must have space for traj_size elements)yawOutput array for yaw angles (must have space for traj_size elements)timeOutput array for timestamps (must have space for traj_size elements)
function set_radius [1/2]
Set the obstacle radius.
inline JALANSIM_HOST_DEVICE void jalansim::obstacle::CircleObstacle::set_radius (
T r
)
Parameters:
rNew radius value
function set_radius [1/2]
Set the obstacle radius (note: for polygon obstacles, this may affect scaling).
inline JALANSIM_HOST_DEVICE void jalansim::obstacle::CircleObstacle::set_radius (
T r
)
Parameters:
rNew radius value
function set_trajectory [1/2]
Set the obstacle trajectory.
inline JALANSIM_HOST_DEVICE void jalansim::obstacle::CircleObstacle::set_trajectory (
const T * x,
const T * y,
const T * time
)
Parameters:
xArray of X coordinates for waypointsyArray of Y coordinates for waypointstimeArray of timestamps for waypoints
function set_trajectory [2/2]
Set the obstacle trajectory with orientation.
inline JALANSIM_HOST_DEVICE void jalansim::obstacle::CircleObstacle::set_trajectory (
const T * x,
const T * y,
const T * yaw,
const T * time,
std::size_t n
)
Parameters:
xArray of X coordinates for waypointsyArray of Y coordinates for waypointsyawArray of yaw angles for waypoints (radians)timeArray of timestamps for waypointsnNumber of trajectory points (max 64)
The documentation for this class was generated from the following file include/jalansim/obstacle/circle.hpp