maddux package

Submodules

maddux.environment module

Our experiment environment.

class maddux.environment.Environment(dimensions=None, dynamic_objects=None, static_objects=None, robot=None)[source]
animate(duration=None, save_path=None)[source]

Animates the running of the program

Parameters:
  • duration (int or None) – (Optional) Duration of animation in seconds
  • save_path (String or None) – (Optional) Path to save mp4 in instead of displaying
Return type:

None

collision()[source]

Check if any dynamic objects collide with any static objects or walls.

Returns:Whether there was a collision
Return type:bool
hypothetical_landing_position()[source]

Find the position that the ball would land (or hit a wall)

Returns:Position (x, y, z) of hypothetical landing position of a thrown object based on end effector velocity.
Return type:numpy.ndarray or None
plot(ax=None, show=True)[source]

Plot throw trajectory and ball

Parameters:
  • ax (matplotlib.axes) – Current axis if a figure already exists
  • show (bool) – (Default: True) Whether to show the figure
Return type:

None

run(duration)[source]

Run for a certain duration

Parameters:duration (integer) – duration to run environment in seconds
Return type:None

maddux.plot module

maddux.plot.plot_sphere(position, radius, ax, color='g', linewidth=0)[source]

Plot a sphere.

Parameters:
  • position (numpy.ndarray) – Position in (x, y, z) of sphere
  • radius (int) – radius of sphere
  • ax (matplotlib.axes) – axes to plot on
  • color (str) – (Optional) color of sphere
  • linewidth (int) – (Optional) width of ball gridlines
Return type:

matplotlib.axes

maddux.plot.plot_sphere_data(position, radius)[source]

Given a position and radius, get the data needed to plot.

Parameters:
  • position (numpy.ndarray) – Position in (x, y, z) of sphere
  • radius (int) – radius of sphere
Returns:

(x, y, z) tuple of sphere data to use to create a surface

Return type:

(np.ndarray, np.ndarray, np.ndarray)

maddux.predefined_environments module

maddux.predefined_environments.get_easy_environment()[source]

An easy difficulty environment for planning tests with two obstacles, a ball as a target, and a simple human arm.

maddux.predefined_environments.get_hard_environment()[source]

A hard difficulty environment for planning tests with five obstacles, a ball as a target, and a simple human arm.

maddux.predefined_environments.get_medium_environment()[source]

A medium difficulty environment for planning tests with two obstacles, a ball as a target, and a simple human arm.

maddux.predefined_environments.get_noodle_environment()[source]

An absurd environment for our noodle arm to do planning tests. It has five obstacles, a ball as a target, and our 10 link noodle arm

maddux.predefined_environments.get_tutorial_environment()[source]

Our environment from our documentation tutorial

maddux.predefined_environments.get_very_hard_environment()[source]

A very hard difficulty environment for planning tests with three obstacles, a ball as a target, and a simple human arm.

Module contents