ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Thanks, Guido. I followed your recommendation but still have error due to no changes made in the parts of Controller startup in realtime and Controller update loop in realtime in the my_controller_file.cpp. Could you let me know how to change the below codes in the cpp file ?
/// Controller startup in realtime void MyControllerClass::starting() { init_pos_ = joint_state_->position_; }
/// Controller update loop in realtime void MyControllerClass::update() { double desired_pos = init_pos_ + 15 * sin(ros::Time::now().toSec()); double current_pos = joint_state_->position_; joint_state_->commanded_effort_ = -10 * (current_pos - desired_pos); }