A set of convenient logging and testing tools for the Drake robotics toolbox.
Project description
brom_drake-py
Brom is a helper library for the Drake robotics simulation and verification library. Its goal is to simplify common debugging and testing activities in Drake (for example, logging the outputs of systems in your block diagrams).
Some of Brom's features:
| Feature | Code | Results |
|---|---|---|
The Diagram Watcher (the DiagramWatcher will log + plot all output ports of your Diagram automatically) |
add_watcher_and_build() |
|
| The Drake-ify feature (converts your URDF file into a form that Drake can consume) | drakeify_my_urdf() |
|
| Scenes (partially complete robot scenarios to test your algorithms) | (See Examples Directory or the Wiki) |
(More coming soon...)
Installation
brom_drake is available on PyPI and installable with pip:
pip install brom-drake
Developer install
You can also install the package during local development by cloning the repository and running the following commands from inside it:
pip install -r requirements.txt
pip install -e .
Use Cases
Here are a few of the features available in brom_drake and how they work.
Easily Log Your Diagram's Signals
It is recommended that you use the convenience function add_watcher_and_build to add a DiagramWatcher to your diagram.
# Drake imports
from pydrake.all import (
DiagramBuilder, Simulator,
)
# All your other imports
from brom_drake.all import add_watcher_and_build
# Create a diagram builder
builder = DiagramBuilder()
# Add and connect your systems...
# Add the watcher and build the diagram
watcher, diagram, diagram_context = add_watcher_and_build(builder)
# Set up simulation
simulator = Simulator(diagram, diagram_context)
simulator.set_target_realtime_rate(1.0)
simulator.set_publish_every_time_step(False)
# Run simulation
simulator.Initialize()
simulator.AdvanceTo(15.0)
What will happen whenever you use this function is that:
- The
DiagramWatcherwill be created.- It will search through all systems that the
DiagramBuilderhas added. - For each system, the watcher will add a
VectorLoggerto each output port that is akVectorValuedport. - The
DiagramWatcherwill connect all loggers to all targeted ports (in the above case, we will target all available output ports).
- It will search through all systems that the
- After the simulation is run and the script completes, the watcher will save all data traces for each port in
.pngfiles. These plots will be in a new.bromdirectory.
Watching Specific systems
If you only want to watch a specific system, then you can do so by passing in information to the "targets" argument:
watcher, _, _ = add_watcher_and_build(
builder,
targets=[
("system_name", "port_name"),
"system_name2",
],
)
The above code tells the watcher to watch the port named port_name on the system named system_name.
(If you don't know your system's name in Drake, then you can usually find it by using the get_name() method.)
Citation
Feel free to cite this project if it helped with your work!
@misc{drake,
author = "Kwesi Rutledge and the Wrench Robotics Team",
title = "Brom: A Helper Library for the Drake Toolbox",
year = 2024,
}
FAQs
Why the name Brom?
Brom the storyteller is a character from the Inheritance series by Christopher Paolini. He is a wise mentor that helps Eragon (the protagonist) master dragons. ;)
How can I support this project?
Related Work
Some other work in the open-source drake community:
- kinova_drake - A Drake-based library that builds a simple version of the manipulation station for the Kinova Gen3 robot arm. Also works with the hardware.
- airo-drake - A python package meant to simplify
working with Drake and the
airo-monorepository from the AI and Robotics Lab at Ghent University.
To-Dos
- Figure out how to tell if two systems are connected in Drake.
- Add support for abstract output ports?
- Add more readme explanations of what is going on under the hood.
- Add Documentation
- Create a method that makes each material in a URDF file have unique names if they have specific values
- Add methods for saving the state names on state plots from diagram watcher
- Add methods for over or under-approximating complex mehes with cylinders or circles or other shapes.
- Allow for the user to give "Drake-unfriendly" URDFs to
ShowMeThisModelscene
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brom_drake-0.2.9.tar.gz.
File metadata
- Download URL: brom_drake-0.2.9.tar.gz
- Upload date:
- Size: 61.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae23f8f6a9f5d5623df846e7d2838bb52eb28bc956830aa60818e4c50dca163d
|
|
| MD5 |
1d5717d10724b28bcda66b2f498b0632
|
|
| BLAKE2b-256 |
8e8c40e80cbe48d4c38f4b2a667802e7e6706a183fdb8ce7f46d098a6b3357a9
|
Provenance
The following attestation bundles were made for brom_drake-0.2.9.tar.gz:
Publisher:
deploy-to-pypi.yml on kwesiRutledge/brom_drake-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brom_drake-0.2.9.tar.gz -
Subject digest:
ae23f8f6a9f5d5623df846e7d2838bb52eb28bc956830aa60818e4c50dca163d - Sigstore transparency entry: 153969957
- Sigstore integration time:
-
Permalink:
kwesiRutledge/brom_drake-py@5935ef89ec35c7a2a002f553e554beb0994b0812 -
Branch / Tag:
refs/tags/0.2.9 - Owner: https://github.com/kwesiRutledge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-to-pypi.yml@5935ef89ec35c7a2a002f553e554beb0994b0812 -
Trigger Event:
push
-
Statement type:
File details
Details for the file brom_drake-0.2.9-py3-none-any.whl.
File metadata
- Download URL: brom_drake-0.2.9-py3-none-any.whl
- Upload date:
- Size: 95.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3755b9593e93d8a8cad26513cdf6c191be9f6c649b1138c60cb66a6bd15acb58
|
|
| MD5 |
18ad3f7c8889218b043e59c7b4d4cf98
|
|
| BLAKE2b-256 |
d9733fa910e4fbb3e3bdbe4ca77acd80fc2d3f942d86d54f80855fd1fb49a7ca
|
Provenance
The following attestation bundles were made for brom_drake-0.2.9-py3-none-any.whl:
Publisher:
deploy-to-pypi.yml on kwesiRutledge/brom_drake-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brom_drake-0.2.9-py3-none-any.whl -
Subject digest:
3755b9593e93d8a8cad26513cdf6c191be9f6c649b1138c60cb66a6bd15acb58 - Sigstore transparency entry: 153969958
- Sigstore integration time:
-
Permalink:
kwesiRutledge/brom_drake-py@5935ef89ec35c7a2a002f553e554beb0994b0812 -
Branch / Tag:
refs/tags/0.2.9 - Owner: https://github.com/kwesiRutledge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-to-pypi.yml@5935ef89ec35c7a2a002f553e554beb0994b0812 -
Trigger Event:
push
-
Statement type: