arunniddish / API

0 stars 0 forks source link

API_Msoro.ino: gait definition comprising arbitrary length state sequences #4

Open achang46 opened 2 years ago

achang46 commented 2 years ago

"cycle_defn()" permits a gait to be defined as an arbitrary length state sequence (via serial input). This sequence is stored in the variable, 'cycle1'. But 'cycle1' is defined as a fixed length int8_t array (i.e. length 3) and, as result, doesn't appear to support storing arbitrary length sequences.

The Matlab demo script, API.m, actually sends a "define" (gait) command that defines a 4-state long sequence (even though 'cycle1' is only defined as a 3 length int8_t array). If API.m still ran fine and API_Msoro.ino never resulted in runtime errors (i.e. didn't guard against this assignment based on the variable definition), it seems the program could be writing that 4th state value (int8_t) to an unintended memory location.

Suggest restructuring such that gaits are stored in appropriately sized variables (i.e. able to support up to theoretical maximum state sequence length, given 4 binary actuators).

achang46 commented 2 years ago

[Meeting, Alex-Arun, 4/15/22]

Per input from Caitlin:

Began an interface description document that we can collaboratively finalize: https://docs.google.com/document/d/1NhcKvrKJ3Sy_6hmfkjQHOzd4s-_9TxEv1JlvnkAAXpk/edit#

achang46 commented 2 years ago

Arun implemented capability -> action on Alex to verify via Matlab MSoRo interface