Rename "delay" buffer functions to "history" buffers.

The functions and associated tests related to managing time-stamped data buffers have been renamed from `mju_delay*` to `mju_history*` to better reflect their general purpose beyond just handling delays.

PiperOrigin-RevId: 866978339
Change-Id: I8655e91bce783287ad2adc412d13a1c39aa2c322
This commit is contained in:
Yuval Tassa
2026-02-07 14:09:27 -08:00
committed by Copybara-Service
parent e6639f1e29
commit d680b3d234
5 changed files with 130 additions and 130 deletions
+7 -7
View File
@@ -89,7 +89,7 @@ MJAPI size_t mju_isValidBase64(const char* s);
// returns number of bytes decoded (upper limit of 3 * (strlen(s) / 4))
MJAPI size_t mju_decodeBase64(uint8_t* buf, const char* s);
//------------------------------ delay buffers -----------------------------------------------------
//------------------------------ history buffers ---------------------------------------------------
// buffer layout: [user(1), cursor(1), times(n), values(n*dim)]
// - user: 1 mjtNum reserved for user data (ignored by these functions)
@@ -98,20 +98,20 @@ MJAPI size_t mju_decodeBase64(uint8_t* buf, const char* s);
// - values: n*dim values, contiguous at buf[n+2..n+2+n*dim-1]
// total buffer size: 2 + n*(1 + dim)
// initialize delay buffer with given times and values; times must be strictly increasing
// initialize history buffer with given times and values; times must be strictly increasing
// values is size n x dim
MJAPI void mju_delayInit(mjtNum* buf, int n, int dim, const mjtNum* times,
const mjtNum* values, mjtNum user);
MJAPI void mju_historyInit(mjtNum* buf, int n, int dim, const mjtNum* times,
const mjtNum* values, mjtNum user);
// find insertion slot for sample at time t, maintaining sorted order
// returns pointer to value slot (size dim) where caller should write
MJAPI mjtNum* mju_delayInsert(mjtNum* buf, int n, int dim, mjtNum t);
MJAPI mjtNum* mju_historyInsert(mjtNum* buf, int n, int dim, mjtNum t);
// read vector value at time t; interp: 0=zero-order-hold, 1=linear, 2=cubic spline
// returns pointer to sample in buffer on exact match (res untouched)
// returns NULL and writes interpolated result to res otherwise
MJAPI const mjtNum* mju_delayRead(const mjtNum* buf, int n, int dim,
mjtNum* res, mjtNum t, int interp);
MJAPI const mjtNum* mju_historyRead(const mjtNum* buf, int n, int dim,
mjtNum* res, mjtNum t, int interp);
//------------------------------ miscellaneous -----------------------------------------------------