Repository navigation
Add a tracking camera to the Newton visualizer #9050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6821fe6
17a6ab6
866763b
91e6550
9b1b6ed
c944f49
dfff486
3f6b0bd
59c4b0c
2d4fd34
e4e0d87
6aeaaf2
287c4d4
6d76a1a
434dd87
7141712
9d47742
f2b0beb
dd676d6
70e1a8c
a66e2f8
68fd75e
11417a1
63c51bd
418804c
1151d52
7e907ae
6ac4f43
66862f6
60ab29a
338d3d3
0438b74
b0308a5
32611fb
fd7bc96
7ff049b
7184ded
b6e3568
9bec52e
2ff8ae6
76a890f
a363cd2
19c8a3c
0cc9f88
3f0bea0
b3064cc
80c32a7
5343fd3
9a60f0e
a3dabb8
36809df
25d29f1
45630b4
f266e00
7200706
ff23bad
c5d9813
c7265e4
2721846
3ee43c2
5bf8658
6e1b1ed
4d7541c
8297fce
1a27ee1
13aa091
825d053
a530768
bef13f6
aeeabcc
454b108
ae949c5
78c9e78
98322a4
87966ff
c461d3d
72b35f5
101395f
1a52a90
0512889
f35d9ff
fe32f05
9f97e77
43e8845
fd9beee
01778d5
772740d
136c3a9
5ddd8ab
4769d35
58ac52a
11a37c8
6c1b0b8
4635b52
237f603
5071909
62a237f
915004b
9eec5c0
599ab6b
5359358
372fee4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| * Added :class:`~isaaclab.visualizers.TrackingCameraCfg`, a perspective camera that frames an environment or follows | ||
| an asset with optional smoothed heading. Added the ``viz:<type>:tracking`` video source, which records the first | ||
| tracking camera whichever view the window shows. A visualizer opts in by overriding | ||
| :attr:`~isaaclab.visualizers.BaseVisualizer.has_tracking_view` and | ||
| :meth:`~isaaclab.visualizers.BaseVisualizer.render_tracking_rgb_array`, which Newton GL does. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,15 @@ def __init__(self, cfg: VideoRecorderCfg, env: object): | |
| f"Enable streaming_view on {viz.cfg.backend.visualizer_type!r} to record its sensor view." | ||
| ) | ||
| # Legacy recording follows camera selection in the window. | ||
| self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array | ||
| if channel == "tracking": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we not have hardcoded string checks in if statements? can we leverage the cfg for this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i kept channel == "tracking" since its the source name from --video viz:newton:tracking, same as the channel == "streaming_view" check next to it and in sim_launcher we could use a cfg flag though that would duplicate the string we alredy have to parse. or i can move the source names into the visulizer and do the string check there below, the visualizer type check is gone the recorder asks |
||
| if not viz.has_tracking_view: | ||
| raise RuntimeError( | ||
| f"The {viz.cfg.backend.visualizer_type!r} visualizer has no tracking camera to record. Add a " | ||
| "TrackingCameraCfg to its cameras, on a visualizer that supports tracking cameras." | ||
| ) | ||
| self._capture = viz.render_tracking_rgb_array | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning · Implementation — Validate tracking sources at binding A Newton GL visualizer without a tracking camera binds successfully and raises only on the first captured frame. Resolve and validate the first tracking view when constructing the recorder.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already checked at construction: the recorder raises if the visualizer has no tracking view (
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning · Implementation — Validate tracking when binding A Newton GL visualizer without a tracking camera binds successfully, then raises on the first recorded frame. Check that the view exists during recorder construction, like other invalid sources.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already checked at construction: the recorder raises if the visualizer has no tracking view ( |
||
| else: | ||
| self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array | ||
|
|
||
| self.cfg = cfg | ||
| self._env = env | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recipe used to be Kit-specific (
KitBackendCfg(origin_type="asset", origin_track_path="robot")), and that still works:origin_type/origin_track_pathare still onKitBackendCfg, andmigrating.rst(around line 2747) still points users to them.The replacement uses
TrackingCameraCfg, which Kit ignores without a warning, so a Kit user following this recipe gets a camera that never moves. The recipe also doesn't say it's Newton GL only.Can we keep the Kit recipe next to this one, or label this one Newton GL only and link to the Kit option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Labeled the recipe as Newton GL only and put the Kit option next to it.