Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
# v0.0.7

## Fixed
* Fixed bug that caused traces to linger when switching from a trace task to a traceless task (@bhung, #108)
* Fixed bug where task and optimizer events were cleared before the Visualizer finished rendering (@bhung, #108)
* Fixed bug where events and locks are getting recreated when a task is made, causing bad references (@bhung, #108)

## Dev
* Updated changelog with instructions on package updates (@bhung, #108)

# v0.0.6

## Added
* New copyrights
* New copyrights (@baxelrod, #103)

## Fixed
* Fixed bug that caused Viser and Mujoco to crash on visualization due to different API
* Added pycparser deps
* Fixed a new mujoco API compatibility
* Fixed bug that caused Viser and Mujoco to crash on visualization due to different API (@bhung, #107)
* Added pycparser deps (@bhung, #107)
* Fixed a new mujoco API compatibility (@bhung, #107)

# v0.0.5

## Added
* Separation between middleware implementation and core functionality
* Support for different middleware implementations
* Sliders with enforced bounds to errors caused by unintended values
* Interface to create controllers from registered tasks and optimizers
* Abstract interface to implement different simulation backends
* Removed duplication of objects inside a node to ensure that all references to data point to the same object
* Separation between middleware implementation and core functionality (@bhung, #93)
* Support for different middleware implementations (@bhung, #93)
* Sliders with enforced bounds to errors caused by unintended values (@bhung, #93)
* Interface to create controllers from registered tasks and optimizers (@bhung, #93)
* Abstract interface to implement different simulation backends (@bhung, #93)
* Removed duplication of objects inside a node to ensure that all references to data point to the same object (@bhung, #93)

## Fixed
* Fixed bug that would allow certain sliders to be set to arbitrary values that could crash the app
* Fixed bug that would allow NaN as a valid entry into the slider text box
* Fixed bug that caused the ControllerConfig to not be recreated when the `TaskConfig` was reset.
* Fixed bug that would allow certain sliders to be set to arbitrary values that could crash the app (@bhung, #93)
* Fixed bug that would allow NaN as a valid entry into the slider text box (@bhung, #93)
* Fixed bug that caused the ControllerConfig to not be recreated when the `TaskConfig` was reset. (@bhung, #93)

## Documentation
* Added specification between different slider types.
* Added guidelines on how to use the `Controller`. `Visualizer`, and `Simulation` objects
* Added specification between different slider types. (@bhung, #93)
* Added guidelines on how to use the `Controller`. `Visualizer`, and `Simulation` objects (@bhung, #93)

## Dev
* Modified release process so that any CODEOWNER can publish to pypi
* Modified release process so that any CODEOWNER can publish to pypi (@bhung, #99)

# v0.0.4

Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ feat(task): add fr3_stack task with novel constraints
fix(mppi): guard against div-by-zero in cost calculation
```

## 📦 Package updates and versioning

If you are adding a significant change and would like it to be reviewed as a new package release, you will need to
update a few things:

1. `CHANGELOG.md`: Following the format in the file, add your changes to the changelog with the proper PR references
2. `pyproject.toml`: Update the version of `judo_rai` appropriately
3. `pixi.lock`: Update the `pixi.lock` file. You can do this by running `pixi shell` and exiting after it's done.

## 💬 Discussions

Have questions or ideas?
Expand Down
2 changes: 1 addition & 1 deletion judo/visualizers/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ def set_traces(self, traces: np.ndarray | None, all_traces_rollout_size: int) ->

def remove(self) -> None:
"""Wrapper function to remove all geometries from Viser."""
self.remove_traces()
for geom in self._geoms:
geom.remove()
self.remove_traces()


def add_plane(
Expand Down
36 changes: 19 additions & 17 deletions judo/visualizers/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,24 @@ def __init__(
self.task_name = ""
self.optimizer_name = ""

# Initializes the locks and events in the constructor to avoid recreating them each time the task is set.
self.task_lock = threading.Lock()
self.task_updated = threading.Event()

self.controller_config_lock = threading.Lock()
self.controller_config_updated = threading.Event()

self.optimizer_lock = threading.Lock()
self.optimizer_updated = threading.Event()

self.optimizer_config_lock = threading.Lock()
self.optimizer_config_updated = threading.Event()

self.task_config_lock = threading.Lock()
self.task_config_updated = threading.Event()

self.task_reset_updated = threading.Event()

self.sim_pause_button = sim_pause_button
if self.sim_pause_button:
self.sim_pause_lock = threading.Lock()
Expand Down Expand Up @@ -120,24 +135,12 @@ def set_task(self, task_name: str, optimizer_name: str) -> None:
raise ValueError(f"Optimizer {optimizer_name} not found in optimizer registry.")
_, optimizer_config_cls = optimizer_entry

self.controller_config_lock = threading.Lock()
self.controller_config_updated = threading.Event()
self.controller_config = ControllerConfig()
self.controller_config.set_override(task_name)

self.optimizer_lock = threading.Lock()
self.optimizer_updated = threading.Event()

self.optimizer_config_lock = threading.Lock()
self.optimizer_config_updated = threading.Event()
self.optimizer_config = optimizer_config_cls()
self.optimizer_config.set_override(task_name)

self.task_config_lock = threading.Lock()
self.task_config_updated = threading.Event()

self.task_reset_updated = threading.Event()

self.setup_gui()

# send the configs to the other nodes
Expand Down Expand Up @@ -235,10 +238,9 @@ def _(_: viser.GuiEvent) -> None:
"""Callback for when the pause button is clicked."""
if sim_pause_button.label == "Pause Simulation":
sim_pause_button.label = "Resume Simulation"
self.sim_pause_updated.set()
else:
sim_pause_button.label = "Pause Simulation"
self.sim_pause_updated.set()
self.sim_pause_updated.set()

# create a display for plan time
self.gui_elements["plan_time_display"] = self.server.gui.add_number(
Expand Down Expand Up @@ -292,7 +294,6 @@ def _(_: viser.GuiEvent) -> None:
def _(_: viser.GuiEvent) -> None:
"""Callback for when the optimizer dropdown is updated."""
# first, send the name of the new optimizer
self.optimizer_updated.set()
self.optimizer_name = optimizer_dropdown.value

# update config
Expand All @@ -301,7 +302,6 @@ def _(_: viser.GuiEvent) -> None:
optimizer_config_cls = optimizer_entry[1]
self.optimizer_config = optimizer_config_cls()
self.optimizer_config.set_override(self.task_name)
self.optimizer_config_updated.set()

# replace optimizer param gui elements
for v in self.gui_elements["optimizer_params"]:
Expand All @@ -316,21 +316,23 @@ def _(_: viser.GuiEvent) -> None:

# because the optimizer will be updated, we need to sent the task parameters back to it so it doesn't start
# with defaults
self.optimizer_updated.set()
self.optimizer_config_updated.set()
self.task_config_updated.set()

@task_dropdown.on_update
def _(_: viser.GuiEvent) -> None:
"""Callback for when the task dropdown is updated."""
# first, send the name of the new task
self.task_name = task_dropdown.value
self.task_updated.set()

# replace gui elements
self._remove_gui_elements()

# set up the entire visualizer from scratch
with self.task_lock:
self.set_task(self.task_name, self.optimizer_name)
self.task_updated.set()

def remove_handles(self, handles: list[ElementType] | ElementType) -> None:
"""Remove GUI handles from the visualization node."""
Expand Down
4 changes: 2 additions & 2 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "judo-rai"
description = "Judo: a hackable sampling-based MPC toolbox"
version = "0.0.6"
version = "0.0.7"
readme = "README.md"
license = { file = "LICENSE" }
authors = [
Expand Down
Loading