Add mj_setKeyframe function to save current state in k-th model keyframe.
Fixes #1719. Also improve documentation of `mju_sigmoid`, was previously only documented in changelog. PiperOrigin-RevId: 642637458 Change-Id: I811a0bf8f881c8b76c9a62d2faec8fdec4e7585b
This commit is contained in:
committed by
Copybara-Service
parent
f37f840880
commit
c9bcf8371e
@@ -1978,14 +1978,7 @@ void Simulate::Sync() {
|
||||
}
|
||||
|
||||
if (pending_.save_key) {
|
||||
int i = this->key;
|
||||
m_->key_time[i] = d_->time;
|
||||
mju_copy(m_->key_qpos + i*m_->nq, d_->qpos, m_->nq);
|
||||
mju_copy(m_->key_qvel + i*m_->nv, d_->qvel, m_->nv);
|
||||
mju_copy(m_->key_act + i*m_->na, d_->act, m_->na);
|
||||
mju_copy(m_->key_mpos + i*3*m_->nmocap, d_->mocap_pos, 3*m_->nmocap);
|
||||
mju_copy(m_->key_mquat + i*4*m_->nmocap, d_->mocap_quat, 4*m_->nmocap);
|
||||
mju_copy(m_->key_ctrl + i*m_->nu, d_->ctrl, m_->nu);
|
||||
mj_setKeyframe(m_, d_, this->key);
|
||||
pending_.save_key = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user