control toolbox pid
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 jonit1vel and joint2vel are only coming at max 2. The max velocity thaat i provide is 10.
Asked by dinesh on 2020-10-17 14:07:14 UTC
Answers
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_controller
Asked by miura on 2020-10-18 10:01:04 UTC
Comments
yes it is possible. now what? does it solves my problem?
Asked by dinesh on 2020-10-18 11:51:29 UTC
Changing max_velocity
from 2.0 to 10.0 may help.
Asked by miura on 2020-10-18 20:20:55 UTC
Comments