Add ctrl to attached keyframes.

PiperOrigin-RevId: 662878508
Change-Id: Ie273fae0220c8b257766cbbd90a880d44b901725
This commit is contained in:
Alessio Quaglino
2024-08-14 05:13:51 -07:00
committed by Copybara-Service
parent afd7c73f44
commit 7be4df7e03
6 changed files with 51 additions and 22 deletions
+10
View File
@@ -5394,6 +5394,7 @@ mjCActuator& mjCActuator::operator=(const mjCActuator& other) {
void mjCActuator::ForgetKeyframes() {
act_.clear();
ctrl_.clear();
}
@@ -5413,6 +5414,15 @@ std::vector<mjtNum>& mjCActuator::act() {
mjtNum& mjCActuator::ctrl() {
if (ctrl_.find(model->state_name_) == ctrl_.end()) {
ctrl_[model->state_name_] = mjNAN;
}
return ctrl_.at(model->state_name_);
}
void mjCActuator::PointToLocal() {
spec.element = static_cast<mjsElement*>(this);
spec.name = &name;