Conversation
scripts/foot_pedal/README.md
Outdated
| @@ -0,0 +1,51 @@ | |||
| # Foot Pedal Control System | |||
There was a problem hiding this comment.
No need for a READ here. can be a short description in the script docstring
| @@ -0,0 +1,9 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
as discussed offline, to be deleted
| @@ -0,0 +1,341 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
As discussed offline, we will remove this for now
examples/common/data_manager.py
Outdated
| with self._ik_state._lock: | ||
| return self._ik_state.success | ||
|
|
||
| # ============================================================================ |
There was a problem hiding this comment.
not needed after removing example 10
examples/common/data_manager.py
Outdated
| self.rgb_image: np.ndarray | None = None | ||
|
|
||
|
|
||
| class LeaderMappedState: |
There was a problem hiding this comment.
not needed after removing example 10
examples/7_teleop_with_pedal.py
Outdated
| from common.threads.joint_state import joint_state_thread | ||
| from common.threads.quest_reader import quest_reader_thread | ||
| from meta_quest_teleop.reader import MetaQuestReader | ||
| from neuracore.core.input_devices.foot_pedal import FootPedal |
There was a problem hiding this comment.
Neuracore should never have hardware devices.
the foot pedal class should be here inside this example.
examples/7_teleop_with_pedal.py
Outdated
| # Foot Pedal Initialization | ||
| print("\n⌨️ Initializing Foot Pedals...") | ||
| pedal = FootPedal() | ||
| pedal.on("activate", toggle_robot_state) |
There was a problem hiding this comment.
Better event naming would be
button_a
button_b
button_c
as this keeps them task-agnostic, making the FootPedal class more useful for any task.
scripts/foot_pedal/pedal_demo.py
Outdated
| sys.path.insert(0, str(Path(__file__).parent.parent.parent)) | ||
|
|
||
| import neuracore as nc | ||
| from neuracore.core.input_devices.foot_pedal import FootPedal |
There was a problem hiding this comment.
Neuracore should never have hardware devices.
the foot pedal class should be here inside this example.
scripts/foot_pedal/pedal_demo.py
Outdated
| print("\n⌨️ Initializing Foot Pedal...") | ||
| pedal = FootPedal() | ||
|
|
||
| if not any(pedal.mappings.values()): |
There was a problem hiding this comment.
What is this checking and what is run_pedal_config.sh
scripts/foot_pedal/pedal_demo.py
Outdated
| @@ -0,0 +1,113 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
I think the script is obsoleted by the example 7 as it is doing a very similar job. might not be needed
…cripts per PR review
f98f447 to
f78d085
Compare
…nd dashboard sync - Final Lint Clean
Pruthvi-Neuracore
left a comment
There was a problem hiding this comment.
Integrated the foot pedal into the standard thread system, and removed the discussed Leader arm files for now. the Foot_pedal.py acts as the main class and the 7_teleop_with_pedal.py imports from this class to follow the threads, Ready for review again!
Key Changes:
Architectural Alignment: Moved the FootPedal logic from the core neuracore package into example_agilex/examples/common/threads/.
Threaded Implementation: Refactored the FootPedal from a heavy class into a lightweight thread function. This matches our standard pattern: threads are plain functions that use the DataManager for shutdown signaling and accept callbacks directly.
Robust Imports: Implemented an importlib-based solution in 9_leader_arm_teleop_agilex.py to bypass the common namespace collision between the AgileX and SO-101 repos, ensuring both can be used together reliably.
New Unified Teleop: Created 9_leader_arm_teleop_agilex.py for SO-101 leader + PiPER teleoperation, incorporating the new pedal logic (A: Enable, B: Home, C: Record).
Driver Fixes: Optimized the foot pedal driver to use evdev for exclusive device access on Linux, preventing key leakage to the terminal, with a pynput fallback.