leaf_systems

Submodules

Classes

class brom_drake.utils.leaf_systems.bool_to_vec_system.BoolToVectorSystem[source]

Description

This LeafSystem receives boolean inputs (i.e., AbstractValue inputs containing bool values) and returns an output vector of size 1 (i.e., BasicVector) where the single element is 1 if the input bool is True and 0 if the input bool is False.

Diagram

The LeafSystem’s input and output ports can be illustrated with the following block:

                |---------------|
                | Bool          |
bool_in ---->   | To            | ---> vector_out 
(bool)          | VectorSystem  | (BasicVector[1])
                |---------------|
CalcVectorOutput(context: Context, output: BasicVector)[source]

Description

Callback function for calculating the output vector of the BoolToVectorSystem. This function takes in a bool and outputs a vector of size 1.

class brom_drake.utils.leaf_systems.end_effector_wrench_calculator.EndEffectorWrenchCalculator(plant, end_effector_frame)[source]

Description

A simple system which takes as input joint torques and outputs the corresponding wrench applied to the end-effector.

Diagram

The system can be illustrated with the following block:

                    ---------------------------------
                    |                               |
                    |                               |
                    |                               |
joint_positions --> |  EndEffectorWrenchCalculator  | ---> end_effector_wrench
joint_angles -----> |                               |
joint_torques ----> |                               |
                    |                               |
                    |                               |
                    ---------------------------------
class brom_drake.utils.leaf_systems.flexible_port_switch.FlexiblePortSwitch(dim: int, selector_type_in: type = <class 'str'>)[source]

Description

This system is a simplification of the PortSwitch system primitive that is built into Drake. It allows for you to command the switch with a simple input (i.e., a string or an int) instead of a more complicated type.

DeclareInputPort(name: str) InputPort[source]

Description

This method will declare an input port for the system.

DoCalcValue(context: Context, output: BasicVector)[source]

Description

This method will calculate the value of the output port.

get_port_selector_input_port() InputPort[source]

Description

This method will return the port selector input port.

Functions

brom_drake.utils.leaf_systems.named_vector_selection_system.define_named_vector_selection_system(all_element_names: List[str], sequence_of_names_for_output: List[str]) AffineSystem[source]

Description

This method creates an Affine System that will receive as input a vector where each element is named according to all_element_names and returns an output vector that selects only the elements specified in desired_inputs.

Parameters

namestr

The name of the system to be added.

all_element_namesList[str]

The list of all element names in the input vector.

desired_inputsList[str]

The list of desired element names to be selected for output.

Returns

AffineSystem

The created NamedVectorSelectionSystem.

Variables

(None found)