SLAM

# @FileName : slam.py # @Time : 2024-08-03 15:08:53 # @Author : yk # @Email : yangkui1127@gmail.com # @Description: : A simple slam method in pybullet sim

SLAM.slam.simple_slam(client, robot, enable_plot=False)[source]

Perform a simple SLAM (Simultaneous Localization and Mapping) operation.

Parameters:
  • client (pybullet) – The pybullet client object.

  • robot (object) – The robot object.

  • enable_plot (bool, optional) – Flag to enable or disable plotting of the SLAM visualization. Defaults to False.

Returns:

A list of obstacle bounds in the format [x_min, y_min, x_max, y_max].

Return type:

list

class SLAM.utils.AreaBounds(obstacles_bounds)[source]

Bases: object

A class to represent the bounding area for navigation obstacles.

x_min

Minimum x-coordinate of the bounding area.

Type:

float

y_min

Minimum y-coordinate of the bounding area.

Type:

float

x_max

Maximum x-coordinate of the bounding area.

Type:

float

y_max

Maximum y-coordinate of the bounding area.

Type:

float

SLAM.utils.plot_rectangle(x_min, y_min, x_max, y_max)[source]

Plots a rectangle on the current matplotlib axis.

Parameters:
  • x_min (float) – Minimum x-coordinate of the rectangle.

  • y_min (float) – Minimum y-coordinate of the rectangle.

  • x_max (float) – Maximum x-coordinate of the rectangle.

  • y_max (float) – Maximum y-coordinate of the rectangle.