ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

controller_interface frequency rate

asked 2015-12-10 06:47:39 -0500

gpldecha gravatar image

I have been using the ros_control interface to implement a position controller to use both in Simulation (Gazebo) and on a real robot. My implementation inherits from control_base.h and I implement hardware_interface::PositionJointInterface.

My problem is that I would like to know the frequency of the update rate (base class code shown below) such to perform interpolation between desired and target joint positions such to follow a desired velocity.

 /// Calls \ref update only if this controller is running.
 void updateRequest(const ros::Time& time, const ros::Duration& period)
if (state_ == RUNNING)
  update(time, period);

Is there a method that gives me back the update rate of this function (above). Is it in the Time and Duration variables ? I have so fare failed to find a good tutorial which explains in detail the usage of control_base.h etc.. any pointers would be welcome.

edit retag flag offensive close merge delete


I may be misunderstanding you, but isn't period the inverse of what you are asking?

gvdhoorn gravatar image gvdhoorn  ( 2015-12-10 07:44:47 -0500 )edit

yes, it is have just figured it out.. was not use to using ros::time and ros::Duration

gpldecha gravatar image gpldecha  ( 2015-12-10 08:15:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-12-10 08:17:12 -0500

gpldecha gravatar image

Simply can get the frequency by doing period.toSec();

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-12-10 06:47:39 -0500

Seen: 393 times

Last updated: Dec 10 '15