Skip to content

[Server|Client]: Figure out show playback #217

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

Open
jasonappah opened this issue Mar 26, 2025 · 1 comment · May be fixed by #220
Open

[Server|Client]: Figure out show playback #217

jasonappah opened this issue Mar 26, 2025 · 1 comment · May be fixed by #220
Assignees
Labels
approved This issue has passed the draft stage, and is ready to be assigned D3 Hard Difficulty P3 High Priority

Comments

@jasonappah
Copy link
Member

jasonappah commented Mar 26, 2025

Task Description:

Code needs to be written to go from a show file to robot commands that are executable. This is all rough thoughts, but the show file will likely be a JSON file that roughly looks like this:

// JSON file would use the Showfile type.

type Showfile = {
  version: 1;
  timeline: RobotTimelineLayer[];

  // uhhhh I had not thought about audio much before this point ngl.
  audio?: {
    startMs: number;
    // maybe we use something like capnproto, msgpack, or protobuf so we could 
    // include an audio file in the showfile. if we really wanted to use JSON we'd
    // probably have to base64 encode the file 💀. would work, just feels a little scuffed.
    // plus I've always wanted an excuse to use msgpack or capnproto lol
    data: string;
  }
}

type RobotTimelineLayer = MovementEvent[]

type MovementEvent = {
  // time since the beginning of the show that this action should be executed
  startMs: number

  // how long it should take to reach this point
  durationMs: number

  // see PointSchema in `src/common/spline.ts` on PR #216
  target: Point
}

I'm kind of just yapping/thinking out loud here so sry if any of this doesn't make sense

New commands and packets probably need to be added on both the embedded and server side to support this. We've briefly discussed some ideas for this, like sending the full 'timeline' of splines for a robot in one packet from the server, and sending another packet from the server telling a robot to 'execute' the timeline it was sent. The server should probably be able to pause execution of a timeline. More thought needs to be put into how we're going to run all this at the same time. AFAIK because we communicate between robots with TCP, there's not really a way for us to broadcast one packet to multiple robots, which would ensure that they all receive their 'execute' pacet at the same time. We may just have to hope that all the robots receive their execute packets at the same time, otherwise they won't be moving in sync.

We'll probably need some sort of interface to control show playback.

When we playback, we need to map an actual robot ID to one of the robots in the show file since the file doesn't specify specific robot IDs (should it?).

Implementation Details:

@jasonappah jasonappah added the approved This issue has passed the draft stage, and is ready to be assigned label Mar 26, 2025
@jasonappah jasonappah changed the title [<Server|Client]: Figure out show playback [Server|Client]: Figure out show playback Mar 26, 2025
@jasonappah
Copy link
Member Author

Once this gets figured out and the schema is set/agreed on (should be done in #215), we should create separate issues for the server (creating the commands and packets to send to robots to facilitate playback), embedded (implementing packets), and client (building playback interface)

@xXDMOGXx xXDMOGXx added P3 High Priority D3 Hard Difficulty labels Apr 7, 2025
@ymmot239 ymmot239 self-assigned this Apr 7, 2025
@ymmot239 ymmot239 linked a pull request Apr 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue has passed the draft stage, and is ready to be assigned D3 Hard Difficulty P3 High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants