Expose cliff sensor data via /api-sdk/{begin,get,stop}_cliff_stream#508
Open
KuriGohan-Kamehameha wants to merge 717 commits into
Open
Expose cliff sensor data via /api-sdk/{begin,get,stop}_cliff_stream#508KuriGohan-Kamehameha wants to merge 717 commits into
KuriGohan-Kamehameha wants to merge 717 commits into
Conversation
Added docker-compose and docker image.
…ulls a few times until he sends the right one
Update compose.yaml. Left host network in for development by accident.
Added Turkish language [tr-TR] for STT configuration
…ent_system_noaudio intent if there is an EOF error in a regular Intent request
…I streaming API to make the speech-to-response appear faster despite the slower model. This is done by splitting the response at punctuation marks and having the robot speak each split string one at a time. Get rid of DDL's intent-graph implementation, use mine instead (via SDK, faster). JWT token expires after one month instead of one day.
…be used with it as well. Fix Together AI in initial setup page
…tion models dont work anymore
Russian language support for voice model Vosk-model-small-ru-0.22
…0.22" This reverts commit bd5fbe4. This reverted my Together/OpenAI changes
Playing Audio (WAV) through Vector
Fix - convert stereo to mono - ok
Fix for accelerated audio in stereo WAV
…mpatible vic-cloud
Update isMn func retain the tonal marks and diacritics such as the circumflex, ơ, and ư in Vietnamese.
style: revamp navigation items with modern interactions and interactive hover effects and improve navigation experience
…now disconnected, remove charging bolt.
Supporting opensource multimodal LLMs such as Llama3.2 11B or Llama3.2 90B
Add ARM64 Support for Docker Image to Enable Raspberry Pi 5 Compatibility
Adds three new SDK HTTP endpoints that mirror the existing
begin_event_stream / get_stim_status / stop_event_stream pattern, so
callers can poll Vector's cliff-detected status from open-loop motor
control scripts (move_wheels, drive_wheels) without writing their own
gRPC client.
* robot.go: add CliffStreaming, CliffStatus, CliffDetected, CliffStampMs
fields on the Robot struct; reset CliffStreaming in removeRobot.
* server.go: three new cases in the SdkapiHandler switch.
- begin_cliff_stream subscribes to the 'robot_state' event stream
(the only place the DDL gRPC interface exposes cliff data) in a
goroutine and decodes the CLIFF_DETECTED bit (16384) from
RobotState.Status.
- get_cliff_status returns JSON {sensors, detected, any_detected,
status, stamp_ms}; arrays are length 4 to match the physical
sensor layout but currently mirror the aggregate bit because
DDL's external interface does not expose per-sensor raw values.
- stop_cliff_stream clears the streaming flag and resets state.
No existing code paths are touched; the change is purely additive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three HTTP endpoints to the SDK app that let callers poll Vector's cliff-detection state, mirroring the existing
begin_event_stream/get_stim_status/stop_event_streampattern. This is purely additive — no existing endpoint or behavior is touched.User need
Open-loop motor control via wire-pod (
drive_wheels,move_wheels, lua scripts that issue raw chassis commands) is unsafe near table edges because there is no SDK-side way to check whether the bot is currently sensing a cliff. Today every consumer that wants to gate movement on cliff state has to write its own gRPC client, duplicate auth, and join the event stream. These three endpoints let any HTTP client do the same with a single curl.Implementation
robot_stateevent type (the only place DDL's external gRPC interface exposes cliff data; there is nocliff_eventand no raw per-sensor field inRobotState).ROBOT_STATUS_CLIFF_DETECTEDbit (16384) is decoded fromRobotState.Statuson each event and cached on theRobotstruct.get_cliff_statusreturns JSON shaped{sensors[4], detected[4], any_detected, status, stamp_ms}. The arrays are length 4 to match the physical sensor layout (FL/FR/BL/BR) but currently mirror the aggregate bit, since DDL's external interface does not expose per-sensor raw values. The rawstatusbitmask is included verbatim for callers that want it.New endpoints
GET /api-sdk/begin_cliff_stream?serial=ESNdoneGET /api-sdk/get_cliff_status?serial=ESNerror: must start cliff streamGET /api-sdk/stop_cliff_stream?serial=ESNdoneSmoke test
Built on real escapepod hardware (Go 1.19.4, Pi 4, vosk STT) and tested against a paired Vector at serial
00509655:Five consecutive polls at 1Hz showed
stamp_msadvancing in real time (1778543246537 → 1778543250923) with the bot parked on the charger, confirming the goroutine is live-decoding events rather than returning stale state.status: 1056512lacks theCLIFF_DETECTEDbit (16384), soany_detected: falseis correct for the parked-on-charger condition.Test plan
nolibopusfiletag)begin_cliff_streamreturnsdoneand spawns one goroutine per serialget_cliff_statusreturns the documented JSON shape with livestamp_msget_cliff_statusreturnserror: must start cliff streamwhen not started, including afterstop_cliff_streamstop_cliff_streamreturnsdoneand clears cached state/api-sdk/*endpoints (conn_test, etc.) still workany_detectedflips totruewhen the bot is physically lifted off a surface (reviewer-side, requires hands on hardware)Notes
This change does not touch any existing code path; the patch is purely additive (one new field block on
Robot, three new cases in the handler switch, one extra flag-reset inremoveRobot). 89 lines added, 0 removed.