Ask Your Question
0

control toolbox pid

asked 2020-10-17 14:07:14 -0500

dinesh gravatar image

updated 2020-10-17 14:07:28 -0500

Here is the pid controller code i used in hardware inteface of my diff drive controller:

RRBotHWInterface::RRBotHWInterface(ros::NodeHandle &nh, urdf::Model *urdf_model)
  : ros_control_boilerplate::GenericHWInterface(nh, urdf_model)
{
    ROS_INFO_NAMED("rrbot_hw_interface", "RRBotHWInterface Ready.");
    pid1.initPid(0.1, 0.01, 0.01, 255.0, -255.0);
    pid2.initPid(0.1, 0.01, 0.01, 255.0, -255.0);
    Setup();
}
  double vel_err1 = joint_velocity_[0] - joint_velocity_command_[0];
  double vel_err2 = joint_velocity_[1] - joint_velocity_command_[1];
  double joint1_vel = pid1.updatePid(vel_err1, elapsed_time); 
  double joint2_vel = pid2.updatePid(vel_err2, elapsed_time);

But whenever i run this code the jonit1_vel and joint2_vel are only coming at max 2. The max velocity thaat i provide is 10.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-10-18 10:01:04 -0500

Is it possible that you have max_velocity set to 2.0?

  linear:
    x:
      has_velocity_limits    : true
      max_velocity           : 2.0   # m/s

ref : http://wiki.ros.org/diff_drive_contro...

edit flag offensive delete link more

Comments

yes it is possible. now what? does it solves my problem?

dinesh gravatar image dinesh  ( 2020-10-18 11:51:29 -0500 )edit

Changing max_velocity from 2.0 to 10.0 may help.

miura gravatar image miura  ( 2020-10-18 20:20:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-10-17 14:07:14 -0500

Seen: 55 times

Last updated: Oct 18