utils

Submodules

Classes

class brom_drake.utils.angles.RollPitchYawAngle(*values)[source]
class brom_drake.utils.ground.GroundShape(*values)[source]
Description:

This class defines the different shapes that the ground can have.

Functions

brom_drake.utils.angles.rpy_equivalent_body_rotation_order() list[RollPitchYawAngle][source]

Description

This method returns the equivalent body rotation order for Roll-Pitch-Yaw angles.

brom_drake.utils.collision_checking.using_point_pair_penetration(plant: MultibodyPlant, scene_graph: SceneGraph, root_context: Context, min_acceptable_distance: float = 0.001, debug_flag: bool = False) bool[source]

Description

Check for any collisions using the point pair penetration method. Returns True if any collisions are detected, otherwise False.

Arguments

plantMultibodyPlant

The plant to check for collisions. (Seems unnecessary)

scene_graphSceneGraph

The scene graph associated with the plant.

root_contextContext

The context of the root diagram.

min_acceptable_distancefloat

The minimum distance to consider as a collision. Defaults to 1e-2.

brom_drake.utils.ground.AddGround(plant: MultibodyPlant, shape: GroundShape = GroundShape.kBox, z_ground: float = None, ground_thickness: float = 0.1)[source]

Description

Add a flat ground with friction

Arguments

plant: MultibodyPlant

The plant to add the ground to.

shape: GroundShape

The shape of the ground. Defaults to a box.

z_ground: float

The height at which the “top” of the ground will be placed.

brom_drake.utils.model_instances.find_number_of_positions_in_welded_model(path_to_model: str) int[source]

Description

This method will return the number of positions in the model described at path_to_model WHEN the base link is welded to the world frame.

This is most useful for finding things like the number of positions in a robot.

Returns

int

The number of positions in the model.

brom_drake.utils.model_instances.get_all_bodies_in(plant: MultibodyPlant, model_instance: ModelInstanceIndex) list[RigidBody][source]

Description

This method returns all the bodies in the given model instance.

brom_drake.utils.model_instances.get_first_body_in(plant: MultibodyPlant, model_instance: ModelInstanceIndex) RigidBody[source]

Description

This method returns the first body in the given model instance.

brom_drake.utils.model_instances.get_name_of_all_bodies_in_urdf(urdf_in: str) list[str][source]

Description

This method returns the name of the first body found in the urdf given by urdf_in.

brom_drake.utils.model_instances.get_name_of_first_body_in_urdf(urdf_in: str) str[source]

Description

This method returns the name of the first body found in the urdf given by urdf_in.

brom_drake.utils.plant.get_all_associated_body_indices_in_plant(plant: MultibodyPlant) List[BodyIndex][source]

Description

This method returns all the bodies in the given model instance.

brom_drake.utils.search.find_all_systems_with_input_port(builder: DiagramBuilder, target_port_name: str) List[LeafSystem | Diagram][source]

Description

This method looks through the builder and finds all systems that have an input port with the given name. :param builder: :param target_port_name: :return:

brom_drake.utils.search.find_all_systems_with_name(builder: DiagramBuilder, target_system_name: str) List[LeafSystem | Diagram][source]

Description

This method looks through the builder and finds all systems that have an output port with the given name. :param builder: :param target_system_name: Target name of the system that we would like to find. :return:

brom_drake.utils.search.find_all_systems_with_output_port(builder: DiagramBuilder, target_port_name: str) List[LeafSystem | Diagram][source]

Description

This method looks through the builder and finds all systems that have an output port with the given name. :param builder: :param target_port_name: :return:

brom_drake.utils.triads.AddMultibodyTriad(frame: Frame, scene_graph: SceneGraph, length: float = 0.25, radius: float = 0.01, opacity: float = 1.0)[source]
brom_drake.utils.triads.AddTriad(source_id, frame_id, scene_graph: SceneGraph, length: float = 0.25, radius: float = 0.01, opacity: float = 1.0, X_FT: RigidTransform = RigidTransform(R=RotationMatrix([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]), p=[0.0, 0.0, 0.0]), name: str = 'frame')[source]

Adds illustration geometry representing the coordinate frame, with the x-axis drawn in red, the y-axis in green and the z-axis in blue. The axes point in +x, +y and +z directions, respectively.

Args:

source_id: The source registered with SceneGraph. frame_id: A geometry::frame_id registered with scene_graph. scene_graph: The SceneGraph with which we will register the geometry. length: the length of each axis in meters. radius: the radius of each axis in meters. opacity: the opacity of the coordinate axes, between 0 and 1. X_FT: a RigidTransform from the triad frame T to the frame_id frame F name: the added geometry will have names name + “ x-axis”, etc.

brom_drake.utils.type_checking.is_rigid_transform(obj: Any) bool[source]

Description

This function checks if the object is a RigidTransform. We will perform 2 checks. 1. Check if the object is a RigidTransform object directly, and then 2. Check if the object has the translation() and rotation() methods.

Variables

(None found)