irsim.world.object_base#

Classes#

ObjectInfo

ObstacleInfo

ObjectBase

Base class representing a generic object in the robot simulator.

Module Contents#

class irsim.world.object_base.ObjectInfo[source]#
id: int#
shape: str#
kinematics: str#
role: str#
color: str#
static: bool#
goal: numpy.ndarray#
vel_min: numpy.ndarray#
vel_max: numpy.ndarray#
acce: numpy.ndarray#
angle_range: numpy.ndarray#
goal_threshold: float#
wheelbase: float#
G: numpy.ndarray#
h: numpy.ndarray#
cone_type: str#
convex_flag: bool#
add_property(key, value)[source]#
class irsim.world.object_base.ObstacleInfo[source]#
center: numpy.ndarray#
vertex: numpy.ndarray#
velocity: numpy.ndarray#
radius: float#
G: numpy.ndarray#
h: numpy.ndarray#
cone_type: str#
convex_flag: bool#
add_property(key, value)[source]#
class irsim.world.object_base.ObjectBase(shape: dict | None = None, kinematics: dict | None = None, state: list = [0, 0, 0], velocity: list = [0, 0], goal: list | None = None, role: str = 'obstacle', color: str = 'k', static: bool = False, vel_min: list = [-1, -1], vel_max: list = [1, 1], acce: list = [inf, inf], angle_range: list = [-pi, pi], behavior: dict | None = None, goal_threshold: float = 0.1, sensors: dict | None = None, arrive_mode: str = 'position', description: str | None = None, group: int = 0, state_dim: int | None = None, vel_dim: int | None = None, unobstructed: bool = False, fov: float | None = None, fov_radius: float | None = None, **kwargs)[source]#

Base class representing a generic object in the robot simulator.

This class encapsulates common attributes and behaviors for all objects, including robots and obstacles, managing their state, velocity, goals, and kinematics.

Parameters:
  • shape (dict) – Parameters defining the shape of the object for geometry creation. The dictionary should contain keys and values required by the GeometryFactory to create the object’s geometry, such as ‘type’ (e.g., ‘circle’, ‘rectangle’) and associated parameters. Defaults to None.

  • kinematics (dict) – Parameters defining the kinematics of the object. Includes kinematic model and any necessary parameters. If None, no kinematics model is applied. Defaults to None.

  • state (list of float) – Initial state vector [x, y, theta, …]. The state can have more dimensions depending on state_dim. Excess dimensions are truncated, and missing dimensions are filled with zeros. Defaults to [0, 0, 0].

  • velocity (list of float) – Initial velocity vector [vx, vy] or according to the kinematics model. Defaults to [0, 0].

  • goal (list of float or list of list of float) – Goal state vector [x, y, theta, …] or [[x, y, theta], [x, y, theta], …] for multiple goals Used by behaviors to determine the desired movement. Defaults to [10, 10, 0].

  • role (str) – Role of the object in the simulation, e.g., “robot” or “obstacle”. Defaults to “obstacle”.

  • color (str) – Color of the object when plotted. Defaults to “k” (black).

  • static (bool) – Indicates if the object is static (does not move). Defaults to False.

  • vel_min (list of float) – Minimum velocity limits for each control dimension. Used to constrain the object’s velocity. Defaults to [-1, -1].

  • vel_max (list of float) – Maximum velocity limits for each control dimension. Used to constrain the object’s velocity. Defaults to [1, 1].

  • acce (list of float) – Acceleration limits, specifying the maximum change in velocity per time step. Defaults to [inf, inf].

  • angle_range (list of float) – Allowed range of orientation angles [min, max] in radians. The object’s orientation will be wrapped within this range. Defaults to [-pi, pi].

  • behavior (dict or str) – Behavioral mode or configuration of the object. Can be a behavior name (str) or a dictionary with behavior parameters. If None, default behavior is applied. Defaults to {‘name’: ‘dash’}, moving to the goal directly.

  • goal_threshold (float) – Threshold distance to determine if the object has reached its goal. When the object is within this distance to the goal, it’s considered to have arrived. Defaults to 0.1.

  • sensors (list of dict) – List of sensor configurations attached to the object. Each sensor configuration is a dictionary specifying sensor type and parameters. Defaults to None.

  • arrive_mode (str) – Mode for arrival detection, either “position” or “state”. Determines how arrival at the goal is evaluated. Defaults to “position”.

  • description (str) – Description or label for the object. Can be used for identification or attaching images in plotting. Defaults to None.

  • group (int) – Group identifier for organizational purposes, allowing objects to be grouped. Defaults to 0.

  • state_dim (int) – Dimension of the state vector. If None, it is inferred from the class attribute state_shape. Defaults to None.

  • vel_dim (int) – Dimension of the velocity vector. If None, it is inferred from the class attribute vel_shape. Defaults to None.

  • unobstructed (bool) – Indicates if the object should be considered to have an unobstructed path, ignoring obstacles in certain scenarios. Defaults to False.

  • fov (float) – Field of view angles in radians for the object’s sensors. Defaults to None. If set lidar, the default value is angle range of lidar.

  • fov_radius (float) – Field of view radius for the object’s sensors. Defaults to None. If set lidar, the default value is range_max of lidar.

  • **kwargs

    Additional keyword arguments for extended functionality.

    • plot (dict): Plotting options for the object. May include ‘show_goal’, ‘show_text’, ‘show_arrow’, ‘show_uncertainty’, ‘show_trajectory’, ‘trail_freq’, etc.

Raises:

ValueError – If dimension parameters do not match the provided shapes or if input parameters are invalid.

state_dim#

Dimension of the state vector.

Type:

int

state_shape#

Shape of the state array.

Type:

tuple

vel_dim#

Dimension of the velocity vector.

Type:

int

vel_shape#

Shape of the velocity array.

Type:

tuple

state#

Current state of the object.

Type:

np.ndarray

_init_state#

Initial state of the object.

Type:

np.ndarray

_velocity#

Current velocity of the object.

Type:

np.ndarray

_init_velocity#

Initial velocity of the object.

Type:

np.ndarray

_goal#

Goal state of the object.

Type:

np.ndarray

_init_goal#

Initial goal state of the object.

Type:

np.ndarray

_geometry#

Geometry representation of the object.

Type:

any

group#

Group identifier for the object.

Type:

int

stop_flag#

Flag indicating if the object should stop.

Type:

bool

arrive_flag#

Flag indicating if the object has arrived at the goal.

Type:

bool

collision_flag#

Flag indicating a collision has occurred.

Type:

bool

unobstructed#

Indicates if the object has an unobstructed path.

Type:

bool

static#

Indicates if the object is static.

Type:

bool

vel_min#

Minimum velocity limits.

Type:

np.ndarray

vel_max#

Maximum velocity limits.

Type:

np.ndarray

color#

Color of the object.

Type:

str

role#

Role of the object (e.g., “robot”, “obstacle”).

Type:

str

info#

Information container for the object.

Type:

ObjectInfo

wheelbase#

Distance between the front and rear wheels. Specified for ackermann robots.

Type:

float

fov#

Field of view angles in radians.

Type:

float

fov_radius#

Field of view radius.

Type:

float

Initialize an ObjectBase instance.

This method sets up a new ObjectBase object with the specified parameters, initializing its geometry, kinematics, behaviors, sensors, and other properties relevant to simulation.

The initialization process includes: - Setting up geometry handlers and collision detection - Configuring kinematics models for movement - Initializing state vectors and goal management - Setting up behaviors and sensor systems - Configuring visualization and plotting options

Note

All parameters are documented in the class docstring above. Refer to the ObjectBase class documentation for detailed parameter descriptions.

Raises:

ValueError – If dimension parameters do not match the provided shapes or if input parameters are invalid.

id_iter#
vel_shape = (2, 1)#
state_shape = (3, 1)#
gf#
kf#
state_dim = None#
vel_dim = None#
role = 'obstacle'#
group = 0#
stop_flag = False#
arrive_flag = False#
collision_flag = False#
unobstructed = False#
static = False#
vel_min#
vel_max#
color = 'k'#
info#
obstacle_info = None#
trajectory = []#
description = None#
goal_threshold = 0.1#
arrive_mode = 'position'#
lidar = None#
obj_behavior#
rl#
rh#
wander#
plot_kwargs#
plot_patch_list = []#
plot_line_list = []#
plot_text_list = []#
collision_obj = []#
plot_trail_list = []#
classmethod reset_id_iter(start: int = 0, step: int = 1)[source]#

reset the id iterator

step(velocity: numpy.ndarray | None = None, **kwargs: any)[source]#

Perform a single simulation step, updating the object’s state and sensors.

This method advances the object by one time step, integrating the given velocity or behavior-generated velocity to update the object’s position, orientation, and other state variables. It also updates sensors and checks for collisions.

Parameters:
  • velocity (np.ndarray, optional) –

    Desired velocity for this step. If None, the object will use its behavior system to generate velocity. The shape and meaning depend on the kinematics model:

    • Differential: [linear_velocity, angular_velocity]

    • Omnidirectional: [velocity_x, velocity_y]

    • Ackermann: [linear_velocity, steering_angle]

  • **kwargs – Additional parameters passed to behavior generation and processing.

Returns:

The updated state vector of the object after the step. Returns the current state unchanged if the object is static or stopped.

Return type:

np.ndarray

Note

  • Static objects (static=True) will not move and return their current state

  • Objects with stop_flag=True will halt and return their current state

  • The method automatically handles sensor updates and trajectory recording

sensor_step()[source]#

Update all sensors for the current state.

check_status()[source]#

Check the current status of the object, including arrival and collision detection.

This method evaluates collision detection and sets stop flags based on the collision mode. It also handles different collision modes like ‘stop’, , ‘unobstructed’, etc.

check_arrive_status()[source]#

Check if the object has arrived at its goal position.

The arrival detection depends on the arrive_mode setting: - “state”: Compares full state (x, y, theta) - “position”: Compares only position (x, y)

Updates the arrive_flag and handles multiple goals by removing completed ones.

check_collision_status()[source]#

Check if the object is in collision with other objects in the environment.

This method queries possible collision objects from the geometry tree and checks for intersections. It logs collision warnings for robots and updates the collision_flag and collision_obj list.

check_collision(obj)[source]#

Check collision with another object.

Parameters:

obj (ObjectBase) – Another object to check collision with.

Returns:

True if collision occurs, False otherwise.

Return type:

bool

gen_behavior_vel(velocity: numpy.ndarray | None = None) numpy.ndarray[source]#

Generate behavior-influenced velocity for the object.

This method adjusts the desired velocity based on the object’s behavior configurations. If no desired velocity is provided (velocity is None), the method may generate a default velocity or issue warnings based on the object’s role and behavior settings.

Parameters:

velocity (Optional[np.ndarray]) – Desired velocity vector. If None, the method determines the velocity based on behavior configurations. Defaults to None.

Returns:

Velocity vector adjusted based on behavior configurations and constraints.

Return type:

np.ndarray

Raises:

Warning – If velocity is None and no behavior configuration is set for a robot.

pre_process()[source]#

Perform pre-processing before stepping the object.

This method is called before velocity generation and state updates. Can be overridden by subclasses to implement custom pre-processing logic.

post_process()[source]#

Perform post-processing after stepping the object.

This method is called after state updates and sensor updates. Can be overridden by subclasses to implement custom post-processing logic.

mid_process(state: numpy.ndarray)[source]#

Process state in the middle of a step. Make sure the state is within the desired dimension.

Parameters:

state (np.ndarray) – State vector.

Returns:

Processed state.

Return type:

np.ndarray

get_lidar_scan()[source]#

Get the lidar scan of the object.

Returns:

Lidar scan data containing range and angle information.

Return type:

dict

get_lidar_points()[source]#

Get the lidar scan points of the object.

Returns:

Array of lidar scan points.

Return type:

np.ndarray

get_lidar_offset()[source]#

Get the lidar offset relative to the object.

Returns:

Lidar offset [x, y, theta] relative to the object center.

Return type:

list

get_fov_detected_objects()[source]#

Detect the env objects that in the field of view.

Returns:

The objects that in the field of view of the object.

Return type:

list

fov_detect_object(detected_object: ObjectBase)[source]#

Detect whether the input object is in the field of view.

Parameters:

object – The object that to be detected.

Returns:

Whether the object is in the field of view.

Return type:

bool

set_state(state: list | numpy.ndarray = [0, 0, 0], init: bool = False)[source]#

Set the current state of the object.

This method updates the object’s position, orientation, and other state variables. It also updates the object’s geometry representation to match the new state.

Parameters:
  • state (Union[list, np.ndarray]) –

    The new state vector for the object. The format depends on the object’s state dimension:

    • 2D objects: [x, y, theta] where theta is orientation in radians

    • 3D objects: [x, y, z, roll, pitch, yaw] or similar based on configuration

    Must match the object’s state_dim dimension.

  • init (bool) – Whether to also set this as the initial state for reset purposes. If True, the object will return to this state when reset() is called. Default is False.

Raises:

AssertionError – If the state dimension doesn’t match the expected state_dim.

Example

>>> # Set robot position and orientation
>>> robot.set_state([5.0, 3.0, 1.57])  # x=5, y=3, facing pi/2 radians
>>>
>>> # Set as initial state for resets
>>> robot.set_state([0, 0, 0], init=True)
set_velocity(velocity: list | numpy.ndarray = [0, 0], init: bool = False)[source]#

Set the velocity of the object.

Parameters:
  • velocity – The velocity of the object. Depending on the kinematics model.

  • init (bool) – Whether to set the initial velocity (default False).

set_original_geometry(geometry: shapely.geometry.base.BaseGeometry)[source]#

Set the original geometry of the object.

set_random_goal(obstacle_list, init: bool = False, free: bool = True, goal_check_radius: float = 0.2, range_limits: list = None, max_attempts: int = 100)[source]#

Set random goal(s) in the environment. If free set to True, the goal will be placed only in the free from obstacles part of the environment.

Parameters:
  • obstacle_list – List of objects in the environment

  • init (bool) – Whether to set the initial goal (default False).

  • free (bool) – Whether to check that goal is placed in a position free of obstacles.

  • goal_check_radius (float) – Radius in which to check if the goal is free of obstacles.

  • range_limits (list) – List of lower and upper bound range limits in which to set the random goal position.

  • max_attempts (int) – Max number of attempts to place the goal in a position free of obstacles.

set_goal(goal: list | numpy.ndarray = [10, 10, 0], init: bool = False)[source]#

Set the goal(s) for the object to navigate towards.

This method configures the target location(s) that the object’s behavior system will attempt to reach. Multiple goals can be provided for sequential navigation.

Parameters:
  • goal (Union[list, np.ndarray]) –

    The goal specification. Can be:

    • Single goal: [x, y, theta] for one target location

    • Multiple goals: [[x1, y1, theta1], [x2, y2, theta2], …] for sequential targets

    • None: Clear all goals

    The theta component specifies the desired final orientation in radians.

  • init (bool) – Whether to also set this as the initial goal for reset purposes. If True, these goals will be restored when reset() is called. Default is False.

Example

>>> # Set single goal
>>> robot.set_goal([10.0, 5.0, 0.0])  # Move to (10,5) facing East
>>>
>>> # Set multiple sequential goals
>>> waypoints = [[5, 0, 0], [10, 5, 1.57], [0, 10, 3.14]]
>>> robot.set_goal(waypoints)
>>>
>>> # Clear goals
>>> robot.set_goal(None)
append_goal(goal: list | numpy.ndarray)[source]#

Append a goal to the goal list.

set_laser_color(laser_indices, laser_color: str = 'cyan', alpha: float = 0.3)[source]#

Set the color of the lasers.

Parameters:
  • laser_indices (list) – The indices of the lasers to set the color.

  • laser_color (str) – The color to set the lasers. Default is ‘cyan’.

  • alpha (float) – The transparency of the lasers. Default is 0.3.

input_state_check(state: list, dim: int = 3)[source]#

Check and adjust the state to match the desired dimension.

Parameters:
  • state (list) – State of the object.

  • dim (int) – Desired dimension. Defaults to 3.

Returns:

Adjusted state.

Return type:

list

plot(ax, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, **kwargs)[source]#

Plot the object on the given axis.

Parameters:
  • ax – Matplotlib axis object for plotting.

  • state – State vector [x, y, theta, …] defining object position and orientation.

  • vertices – Vertices array defining object shape for polygon/rectangle objects.

  • **kwargs – Plotting configuration options.

set_element_property(element, state, **kwargs)[source]#
plot_object(ax, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, **kwargs)[source]#

Plot the object itself in the specified coordinate system.

Parameters:
  • ax – Matplotlib axis object

  • state – State of the object (x, y, r_phi) defining position and orientation. If None, uses the object’s current state. Defaults to None.

  • vertices – Vertices of the object [[x1, y1], [x2, y2], …] for polygon and rectangle shapes. If None, uses the object’s current vertices. Defaults to None.

  • **kwargs – Additional plotting options - obj_linestyle (str): Line style for object outline, defaults to ‘-’ - obj_zorder (int): Drawing layer order, defaults to 3 if object is robot, 1 if object is the obstacle. - obj_color (str): Color of the object, defaults to ‘k’ (black). - obj_alpha (float): Transparency of the object, defaults to 1.0.

Returns:

None

Raises:

ValueError – When object shape is not supported

plot_object_image(ax, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, description: str = None, **kwargs)[source]#

Plot the object using an image file based on the description.

Parameters:
  • ax – Matplotlib axis object for plotting.

  • state (Optional[np.ndarray]) – State of the object (x, y, r_phi) defining position and orientation. If None, uses the object’s current state. Defaults to None.

  • vertices (Optional[np.ndarray]) – Vertices of the object for positioning the image. If None, uses the object’s current vertices. Defaults to None.

  • description (str) – Path or name of the image file to display. Defaults to None.

  • **kwargs – Additional plotting options (currently unused).

Note

The image file is searched in the world/description/ directory relative to the project root. The image is rotated and positioned according to the object’s state and vertices.

plot_trajectory(ax, trajectory: list | None = None, keep_traj_length: int = 0, **kwargs)[source]#

Plot the trajectory path of the object using the specified trajectory data.

Parameters:
  • ax – Matplotlib axis.

  • trajectory – List of trajectory points to plot, where each point is a numpy array [x, y, theta, …]. If None, uses self.trajectory. Defaults to None.

  • keep_traj_length (int) – Number of steps to keep from the end of trajectory. If 0, plots entire trajectory. Defaults to 0.

  • **kwargs – Additional plotting options: traj_color (str): Color of the trajectory line. traj_style (str): Line style of the trajectory. traj_width (float): Width of the trajectory line. traj_alpha (float): Transparency of the trajectory line. traj_zorder (int): Zorder of the trajectory.

plot_goal(ax, goal_state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, goal_color: str | None = None, goal_zorder: int | None = 1, goal_alpha: float | None = 0.5, **kwargs)[source]#

Plot the goal position of the object in the specified coordinate system.

Parameters:
  • ax – Matplotlib axis.

  • goal_state – State of the goal (x, y, r_phi) defining goal position and orientation. If None, uses [0, 0, 0]. Defaults to None.

  • vertices – Vertices for polygon/rectangle goal shapes. If None, uses original_vertices. Defaults to None.

  • goal_color (str) – Color of the goal marker. Defaults to be the color of the object.

  • goal_zorder (int) – Zorder of the goal marker. Defaults to 1.

  • goal_alpha (float) – Transparency of the goal marker. Defaults to 0.5.

plot_text(ax, state: numpy.ndarray | None = None, **kwargs)[source]#

Plot the text label of the object at the specified position.

Parameters:
  • ax – Matplotlib axis.

  • state – State of the object (x, y, r_phi) to determine text position. If None, uses the object’s current state. Defaults to None.

  • **kwargs

    Additional plotting options.

    • text_color (str): Color of the text, default is ‘k’.

    • text_size (int): Font size of the text, default is 10.

    • text_position (list): Position offset from object center [dx, dy], default is [-radius-0.1, radius+0.1].

    • text_zorder (int): Zorder of the text. Defaults to 2.

    • text_alpha (float): Transparency of the text. Defaults to 1.

plot_arrow(ax, state: numpy.ndarray | None = None, velocity: numpy.ndarray | None = None, arrow_length: float = 0.4, arrow_width: float = 0.6, arrow_color: str | None = None, arrow_zorder: int = 3, **kwargs)[source]#

Plot an arrow indicating the velocity orientation of the object at the specified position.

Parameters:
  • ax – Matplotlib axis.

  • state – State of the object (x, y, r_phi) to determine arrow position. If None, uses the object’s current state. Defaults to None.

  • velocity – Velocity of the object to determine arrow direction. If None, uses the object’s current velocity_xy. Defaults to None.

  • arrow_length (float) – Length of the arrow. Defaults to 0.4.

  • arrow_width (float) – Width of the arrow. Defaults to 0.6.

  • arrow_color (str) – Color of the arrow. Defaults to “gold”.

  • arrow_zorder (int) – Z-order for drawing layer. Defaults to 4.

plot_trail(ax, state: numpy.ndarray | None = None, vertices: numpy.ndarray | None = None, keep_trail_length: int = 0, **kwargs)[source]#

Plot the trail/outline of the object at the specified position for visualization purposes.

Parameters:
  • ax – Matplotlib axis.

  • state – State of the object (x, y, r_phi) to determine trail position and orientation. If None, uses the object’s current state. Defaults to None.

  • vertices – Vertices of the object for polygon and rectangle trail shapes. If None, uses the object’s current vertices. Defaults to None.

  • keep_trail_length (int) – Number of steps to keep from the recent trajectory of trail.

  • **kwargs – Additional plotting options: trail_type (str): Type of trail shape, defaults to object’s shape. trail_edgecolor (str): Edge color of the trail. trail_linewidth (float): Line width of the trail edge. trail_alpha (float): Transparency of the trail. trail_fill (bool): Whether to fill the trail shape. trail_color (str): Fill color of the trail. trail_zorder (int): Z-order of the trail.

plot_fov(ax, **kwargs)[source]#

Plot the field of view of the object. Creates FOV wedge at origin, will be positioned using transforms in step_plot.

if fov is 2*pi, plot a circle, otherwise plot a wedge.

Parameters:
  • ax – Matplotlib axis.

  • **kwargs – Additional plotting options. fov_color (str): Color of the field of view. Default is ‘lightblue’. fov_edge_color (str): Edge color of the field of view. Default is ‘blue’. fov_zorder (int): Z-order of the field of view. Default is 1. fov_alpha (float): Transparency of the field of view. Default is 0.5.

plot_uncertainty(ax, **kwargs)[source]#

To be completed.

plot_clear(all: bool = False)[source]#

Clear all plotted elements from the axis.

Parameters:

all (bool) – If True, also clears trail elements. If False, keeps trail elements. Defaults to False.

done()[source]#

Check if the object has completed its task.

Returns:

True if the task is done, False otherwise.

Return type:

bool

reset()[source]#

Reset the object to its initial state.

remove()[source]#

Remove the object from the environment.

get_vel_range() tuple[numpy.ndarray, numpy.ndarray][source]#

Get the velocity range considering acceleration limits.

Returns:

Minimum and maximum velocities.

Return type:

tuple

get_info() ObjectInfo[source]#

Get object information.

Returns:

Information about the object.

Return type:

ObjectInfo

get_obstacle_info() ObstacleInfo[source]#

Get information about the object as an obstacle.

Returns:

Obstacle-related information, including state, vertices, velocity, and radius.

Return type:

ObstacleInfo

get_init_Gh() tuple[numpy.ndarray, numpy.ndarray][source]#

Get the initial generalized inequality matrices G and h for the convex object.

Returns:

Tuple containing initial G matrix and h vector.

Return type:

tuple[np.ndarray, np.ndarray]

get_Gh() tuple[numpy.ndarray, numpy.ndarray][source]#

Get the generalized inequality matrices G and h for the convex object.

Returns:

Tuple containing G matrix and h vector.

Return type:

tuple[np.ndarray, np.ndarray]

property name: str#

Get the name of the object.

Returns:

The name of the object.

Return type:

str

property abbr: str#

Get the abbreviation of the object.

Returns:

The abbreviation of the object.

Return type:

str

property shape: str#

Get the shape name of the object.

Returns:

The shape name of the object.

Return type:

str

property z: float#

Get the z coordinate of the object. For 3D object, the z coordinate is the height of the object, for 2D object, the z coordinate is 0.

Returns:

The z coordinate of the object.

Return type:

float

property kinematics: str#

Get the kinematics name of the object.

Returns:

The kinematics name of the object.

Return type:

str

property geometry: shapely.geometry.base.BaseGeometry#

Get the geometry Instance of the object.

Returns:

The geometry of the object.

Return type:

shapely.geometry.base.BaseGeometry

property centroid: numpy.ndarray#

Get the centroid of the object.

Returns:

The centroid of the object.

Return type:

np.ndarray

property id: int#

Get the id of the object.

Returns:

The id of the object.

Return type:

int

property state: numpy.ndarray#

Get the state of the object.

Returns:

The state of the object.

Return type:

np.ndarray

property init_state: numpy.ndarray#

Get the initial state of the object.

Returns:

The initial state of the object.

Return type:

np.ndarray

property velocity: numpy.ndarray#

Get the velocity of the object.

Returns:

The velocity of the object.

Return type:

np.ndarray

property goal: numpy.ndarray#

Get the goal of the object.

Returns:

The goal of the object.

Return type:

np.ndarray

property goal_vertices: numpy.ndarray#

Get the goal vertices of the object.

Returns:

The goal vertices of the object.

Return type:

np.ndarray

property position: numpy.ndarray#

Get the position of the object.

Returns:

The position of the object .

Return type:

np.ndarray

property radius: float#

Get the radius of the object.

Returns:

The radius of the object.

Return type:

float

property length: float#

Get the length of the object.

Returns:

The length of the object.

Return type:

float

property width: float#

Get the width of the object.

Returns:

The width of the object.

Return type:

float

property wheelbase: float#

Get the wheelbase of the object.

Returns:

The wheelbase of the object.

Return type:

float

property radius_extend: float#

Get the radius of the object with a buffer.

Returns:

The radius of the object with a buffer.

Return type:

float

property arrive: bool#

Get the arrive flag of the object.

Returns:

The arrive flag of the object.

Return type:

bool

property collision: bool#

Get the collision flag of the object.

Returns:

The collision flag of the object.

Return type:

bool

property vertices: numpy.ndarray#

Get the vertices of the object.

Returns:

The vertices of the object.

Return type:

np.ndarray

property original_vertices: numpy.ndarray#

Get the original vertices of the object.

Returns:

The original vertices of the object before any transformations.

Return type:

np.ndarray

property original_geometry: shapely.geometry.base.BaseGeometry#

Get the original geometry of the object.

Returns:

The original geometry of the object.

Return type:

shapely.geometry.base.BaseGeometry

property original_centroid: numpy.ndarray#

Get the center of the object.

Returns:

The center of the object.

Return type:

np.ndarray

property original_state: numpy.ndarray#

Get the original state of the object from the original centroid.

Returns:

The original state of the object.

Return type:

np.ndarray (3,1)

property external_objects#

Get the environment objects that are not the self object.

Returns:

The environment objects that are not the self object.

Return type:

list

property ego_object#

Get the ego object (this object itself).

Returns:

The ego object (this object).

Return type:

ObjectBase

property possible_collision_objects#

Get the possible collision objects of the object from the geometry tree.

Returns:

The possible collision objects that could collide with this object.

Return type:

list

property desired_omni_vel#

Calculate the desired omnidirectional velocity.

Parameters:

goal_threshold (float) – Threshold for goal proximity.

Returns:

Desired velocity [vx, vy].

Return type:

np.ndarray

property rvo_neighbors#

Get the list of RVO neighbors. :returns: List of RVO neighbor states [x, y, vx, vy, radius]. :rtype: list

property rvo_neighbor_state#

Get the RVO state for this object.

Returns:

State [x, y, vx, vy, radius].

Return type:

list

property rvo_state#

Get the full RVO state including desired velocity.

Returns:

State [x, y, vx, vy, radius, vx_des, vy_des, theta].

Return type:

list

property velocity_xy#

Get the velocity in x and y directions.

Returns:

Velocity [vx, vy].

Return type:

(2*1) np.ndarray

property beh_config#

Get the behavior configuration of the object.

Returns:

The behavior configuration of the object.

Return type:

dict

property logger#

Get the logger of the env_param.

Returns:

The logger associated in the env_param.

Return type:

Logger

property heading#

Get the heading of the object.

Returns:

The heading of the object.

Return type:

float

property orientation#

Get the orientation of the object.

Returns:

The orientation angle of the object in radians.

Return type:

float