浏览代码

修改pid控制参数

corvin 5 年之前
父节点
当前提交
510bd8b6f6

+ 1 - 1
src/robot_calibration/launch/rviz_display.launch

@@ -7,5 +7,5 @@
 -->
 <launch>
   <!-- startup rviz with config file -->
-  <node name="rviz" type="rviz" pkg="rviz" args="-d $(find carebot_calibration)/config/rviz_config.rviz" />
+  <node name="rviz" type="rviz" pkg="rviz" args="-d $(find robot_calibration)/config/rviz_config.rviz" />
 </launch>

+ 5 - 6
src/ros_arduino_bridge/ros_arduino_python/config/my_arduino_params.yaml

@@ -7,15 +7,14 @@ port: /dev/ttyAMA0
 baud: 57600
 timeout: 0.5
 
-rate: 20
+rate: 25
 sensorstate_rate: 10
 
 cmd_topic: cmd_vel
 
-base_controller_rate: 14.0
+base_controller_rate: 20.0
 base_controller_timeout: 0.7
 
-
 # For a robot that uses base_footprint, change base_frame to base_footprint
 base_frame: base_footprint
 odom_name: odom
@@ -32,17 +31,17 @@ angular_scale_correction: 1.00
 # === PID parameters
 accel_limit: 0.05
 
-AWheel_Kp: 12
+AWheel_Kp: 15
 AWheel_Kd: 15
 AWheel_Ki: 0
 AWheel_Ko: 50
 
-BWheel_Kp: 12
+BWheel_Kp: 15
 BWheel_Kd: 15
 BWheel_Ki: 0
 BWheel_Ko: 50
 
-CWheel_Kp: 12
+CWheel_Kp: 15
 CWheel_Kd: 15
 CWheel_Ki: 0
 CWheel_Ko: 50

+ 5 - 5
src/ros_arduino_bridge/ros_arduino_python/src/ros_arduino_python/base_controller.py

@@ -39,7 +39,7 @@ class BaseController:
         self.base_frame = base_frame
         self.odom_name  = rospy.get_param("~odom_name", "odom")
         self.cmd_topic  = rospy.get_param("~cmd_topic", "cmd_vel")
-        self.rate       = float(rospy.get_param("~base_controller_rate", 15))
+        self.rate       = float(rospy.get_param("~base_controller_rate", 20))
         self.timeout    = rospy.get_param("~base_controller_timeout", 0.7)
 
         pid_params = dict()
@@ -47,24 +47,24 @@ class BaseController:
         pid_params['wheel_track']        = rospy.get_param("~wheel_track", 0.126)
         pid_params['encoder_resolution'] = rospy.get_param("~encoder_resolution", 11)
         pid_params['gear_reduction']     = rospy.get_param("~gear_reduction", 103)
-        pid_params['AWheel_Kp'] = rospy.get_param("~AWheel_Kp", 11)
+        pid_params['AWheel_Kp'] = rospy.get_param("~AWheel_Kp", 15)
         pid_params['AWheel_Kd'] = rospy.get_param("~AWheel_Kd", 15)
         pid_params['AWheel_Ki'] = rospy.get_param("~AWheel_Ki", 0)
         pid_params['AWheel_Ko'] = rospy.get_param("~AWheel_Ko", 50)
 
-        pid_params['BWheel_Kp'] = rospy.get_param("~BWheel_Kp", 11)
+        pid_params['BWheel_Kp'] = rospy.get_param("~BWheel_Kp", 15)
         pid_params['BWheel_Kd'] = rospy.get_param("~BWheel_Kd", 15)
         pid_params['BWheel_Ki'] = rospy.get_param("~BWheel_Ki", 0)
         pid_params['BWheel_Ko'] = rospy.get_param("~BWheel_Ko", 50)
 
-        pid_params['CWheel_Kp'] = rospy.get_param("~CWheel_Kp", 11)
+        pid_params['CWheel_Kp'] = rospy.get_param("~CWheel_Kp", 15)
         pid_params['CWheel_Kd'] = rospy.get_param("~CWheel_Kd", 16)
         pid_params['CWheel_Ki'] = rospy.get_param("~CWheel_Ki", 0)
         pid_params['CWheel_Ko'] = rospy.get_param("~CWheel_Ko", 50)
 
         self.debugPID     = rospy.get_param('~debugPID', False)
         self.accel_limit  = rospy.get_param('~accel_limit', 0.05)
-        self.linear_scale_correction  = rospy.get_param("~linear_scale_correction", 1.0)
+        self.linear_scale_correction  = rospy.get_param("~linear_scale_correction",  1.0)
         self.angular_scale_correction = rospy.get_param("~angular_scale_correction", 1.0)
 
         # Set up PID parameters and check for missing values