hw: make SlateBaseComponent a base-velocity teleop follower#258
hw: make SlateBaseComponent a base-velocity teleop follower#258abhichothani42 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates SlateBaseComponent to participate in the teleoperation system as a base-velocity-space component by implementing teleop::BaseSpaceTeleop, allowing it to read current base velocity and accept [linear_mps, angular_rps] velocity commands.
Changes:
- Make
SlateBaseComponentinherit fromteleop::BaseSpaceTeleop. - Add
read(),write(), andend_teleop()implementations that bridge teleop IO to the SLATE driver velocity APIs. - Update header documentation to describe the base-space teleop contract.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/hw/base/slate_base_component.cpp |
Implements BaseSpaceTeleop IO (read/write) and teleop shutdown behavior (end_teleop). |
include/trossen_sdk/hw/base/slate_base_component.hpp |
Adds teleop interface inheritance, includes, and public API declarations/docs for the teleop IO contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fd24c80 to
4dc5808
Compare
0a67445 to
2629656
Compare
| } | ||
|
|
||
| std::vector<float> SlateBaseComponent::read() { | ||
| if (!driver_) return {0.0f, 0.0f}; |
There was a problem hiding this comment.
This should trigger some error. The user might not be able to debug this in case the driver is missing. Or just return {}. Fail early so it's easy to debug.
There was a problem hiding this comment.
Done — read() logs and returns {} now, so a missing driver fails loudly instead of silently.
d072bda
| } | ||
|
|
||
| void SlateBaseComponent::write(const std::vector<float>& cmd) { | ||
| if (!driver_ || cmd.size() < 2) return; |
There was a problem hiding this comment.
Should warn here. Else, it would be difficult to debug
There was a problem hiding this comment.
Done, write() logs on this path now. d072bda
| return info; | ||
| } | ||
|
|
||
| std::vector<float> SlateBaseComponent::read() { |
There was a problem hiding this comment.
If we don't call update state we won't be able to get the latest state. Are we calling it anywhere else?
There was a problem hiding this comment.
Good catch, added driver_->update_state() before reading so we return the current state, not a stale one.
|
|
||
| void SlateBaseComponent::write(const std::vector<float>& cmd) { | ||
| if (!driver_ || cmd.size() < 2) return; | ||
| driver_->set_cmd_vel(cmd[0], cmd[1]); |
There was a problem hiding this comment.
We are ignoring the bool return, might be a good idea to use it for erro logging.
There was a problem hiding this comment.
Fixed we check the return and log on failure. d072bda
|
|
||
| void SlateBaseComponent::end_teleop() { | ||
| if (driver_) { | ||
| driver_->set_cmd_vel(0.0f, 0.0f); |
There was a problem hiding this comment.
use return value for error logging
There was a problem hiding this comment.
Done, logs if stopping the base fails. d072bda
shantanuparab-tr
left a comment
There was a problem hiding this comment.
There's no base-space leader yet at this point in the stack, so I don't see how this ran end to end as a follower. What does "tested on hardware" cover here?
|
unchecked tested on hardware |
Implement teleop::BaseSpaceTeleop on SlateBaseComponent so the SLATE mobile base can be driven as a teleop follower. - write([linear_mps, angular_rps]) forwards the command to TrossenSlate::set_cmd_vel(); the driver clamps to its velocity limits. - read() returns the base's current body-frame velocity, used once by the teleop controller to seed leader alignment. - end_teleop() commands zero velocity so the base halts on shutdown; idempotent. Purely additive: the base only acts as a follower when a teleop pair targets it with space "base". Existing flows that record the base as a producer are unaffected. Depends on the Base teleop space added in the previous PR.
d072bda to
efc7944
Compare
2629656 to
6791e23
Compare

Summary
Implements
teleop::BaseSpaceTeleoponSlateBaseComponentso the SLATE mobile base can be driven as a teleop follower by any base-space leader. Without this, a base teleop pair silently runs leader-only and the base never moves.Changes
write([linear_mps, angular_rps])forwards the command toTrossenSlate::set_cmd_vel(); the driver applies its own velocity limits.read()returns the base's current body-frame velocity, used once by the teleop controller to seed leader alignment.end_teleop()commands zero velocity so the base halts on shutdown (idempotent).Test Plan
make build)make test)pre-commit run --all-files)Breaking Changes
None. Purely additive — the base only acts as a follower when a teleop pair targets it with
"space": "base"; flows that record the base as a producer are unaffected.Related Issues
N/A — part of the VR teleoperation feature stack.