Skip to content

Commit

Permalink
[Command joint angles] Update the target angle of the neck joint.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmurooka committed Sep 10, 2023
1 parent 554854c commit 6832ff7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/HVACTutorialController.cpp
Expand Up @@ -13,6 +13,12 @@ HVACTutorialController::HVACTutorialController(mc_rbdyn::RobotModulePtr rm, doub

bool HVACTutorialController::run()
{
// Update time
t += solver().dt();

// Update the target angle of the neck joint
postureTask->target({{"NECK_Y", {mc_rtc::constants::toRad(45) * std::sin(0.5 * t)}}});

return mc_control::MCController::run();
}

Expand Down
6 changes: 5 additions & 1 deletion src/HVACTutorialController.h
Expand Up @@ -12,4 +12,8 @@ struct HVACTutorialController_DLLAPI HVACTutorialController : public mc_control:
bool run() override;

void reset(const mc_control::ControllerResetData & reset_data) override;
};

protected:
//! Current time [sec]
double t = 0.0;
};

0 comments on commit 6832ff7

Please sign in to comment.