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 logging and robustness characterization of Drake simulations.
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
dw, 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.
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 .
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. ;)
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.
- Demonstrate how to create a simple Vector logger for the
tutorial's diagram.
- Determine if we can use
DiagramTargetobjects to do everything (assuming that they are all valid). i.e., with the name and the port # can we do waht we want?
- Determine if we can use
- Add more examples
- Add Code coverage
- Add support for abstract output ports?
- Add more readme explanations of what is going on under the hood.
- Add support for giving
DiagramTarget(or simpler objects) to the convenience functions. - Add to PyPI
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.0.2.tar.gz.
File metadata
- Download URL: brom_drake-0.0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a86e27053abedf3edc42252ad27488276874dab2ef2106ac9bb3d4e45fa0424
|
|
| MD5 |
0d0fefdae84e8f47fb5e8d9ce85f6801
|
|
| BLAKE2b-256 |
f715c3f0fbcd316a124e426a400aeb6d8cf7b5bd1076bb48968350c96ca137fc
|
File details
Details for the file brom_drake-0.0.2-py3-none-any.whl.
File metadata
- Download URL: brom_drake-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38fcd89936dc4a62c1c020def2552de8a5d032c91b37af15cdbc6ccddd847da3
|
|
| MD5 |
d99c70174d418b703d1c10549fe922b8
|
|
| BLAKE2b-256 |
d6c4d980dcb12a2861d231138d38f72966a7181fde9775547c8e35681cdc97e3
|