Meilleure réactivité du drone.

This commit is contained in:
Hugo LEVY-FALK 2019-03-22 15:58:24 +01:00
parent 23cc4f11f6
commit f5d3507ecf
6 changed files with 30 additions and 30 deletions

View file

@ -605,7 +605,7 @@ TriangleParamConfig::GroupDescription<TriangleParamConfig::DEFAULT, TrianglePara
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__max__.linear_z_Kp = 10.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__default__.linear_z_Kp = 0.1;
__default__.linear_z_Kp = 0.01;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
Default.abstract_parameters.push_back(TriangleParamConfig::AbstractParamDescriptionConstPtr(new TriangleParamConfig::ParamDescription<double>("linear_z_Kp", "double", 0, "linear.z controller Kp", "", &TriangleParamConfig::linear_z_Kp)));
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
@ -615,7 +615,7 @@ TriangleParamConfig::GroupDescription<TriangleParamConfig::DEFAULT, TrianglePara
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__max__.linear_z_Ki = 10.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__default__.linear_z_Ki = 0.1;
__default__.linear_z_Ki = 0.01;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
Default.abstract_parameters.push_back(TriangleParamConfig::AbstractParamDescriptionConstPtr(new TriangleParamConfig::ParamDescription<double>("linear_z_Ki", "double", 0, "linear.z controller Ki", "", &TriangleParamConfig::linear_z_Ki)));
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
@ -625,7 +625,7 @@ TriangleParamConfig::GroupDescription<TriangleParamConfig::DEFAULT, TrianglePara
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__max__.linear_z_Kd = 10.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__default__.linear_z_Kd = 0.1;
__default__.linear_z_Kd = 0.01;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
Default.abstract_parameters.push_back(TriangleParamConfig::AbstractParamDescriptionConstPtr(new TriangleParamConfig::ParamDescription<double>("linear_z_Kd", "double", 0, "linear.z controller Kd", "", &TriangleParamConfig::linear_z_Kd)));
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
@ -643,7 +643,7 @@ TriangleParamConfig::GroupDescription<TriangleParamConfig::DEFAULT, TrianglePara
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__min__.angular_z_Kp = 0.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__max__.angular_z_Kp = 1.0;
__max__.angular_z_Kp = 10.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__default__.angular_z_Kp = 0.01;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
@ -653,7 +653,7 @@ TriangleParamConfig::GroupDescription<TriangleParamConfig::DEFAULT, TrianglePara
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__min__.angular_z_Ki = 0.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__max__.angular_z_Ki = 1.0;
__max__.angular_z_Ki = 10.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__default__.angular_z_Ki = 0.01;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
@ -663,7 +663,7 @@ TriangleParamConfig::GroupDescription<TriangleParamConfig::DEFAULT, TrianglePara
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__min__.angular_z_Kd = 0.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__max__.angular_z_Kd = 1.0;
__max__.angular_z_Kd = 10.0;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
__default__.angular_z_Kd = 0.01;
//#line 291 "/opt/ros/melodic/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"

View file

@ -14,9 +14,9 @@
<param name="linear_y_Ki" type="double" value="0.01" />
<param name="linear_y_Kd" type="double" value="0.01" />
<param name="control_linear_y" type="bool" value="True" />
<param name="linear_z_Kp" type="double" value="0.1" />
<param name="linear_z_Ki" type="double" value="0.1" />
<param name="linear_z_Kd" type="double" value="0.1" />
<param name="linear_z_Kp" type="double" value="0.01" />
<param name="linear_z_Ki" type="double" value="0.01" />
<param name="linear_z_Kd" type="double" value="0.01" />
<param name="control_linear_z" type="bool" value="True" />
<param name="angular_z_Kp" type="double" value="0.01" />
<param name="angular_z_Ki" type="double" value="0.01" />

View file

@ -15,12 +15,12 @@ Reads and maintains the following parameters on the ROS server
- \b "~linear_y_Ki" : \b [double] linear.y controller Ki min: 0.0, default: 0.01, max: 1.0
- \b "~linear_y_Kd" : \b [double] linear.y controller Kd min: 0.0, default: 0.01, max: 1.0
- \b "~control_linear_y" : \b [bool] Controls the facing to target min: False, default: True, max: True
- \b "~linear_z_Kp" : \b [double] linear.z controller Kp min: 0.0, default: 0.1, max: 10.0
- \b "~linear_z_Ki" : \b [double] linear.z controller Ki min: 0.0, default: 0.1, max: 10.0
- \b "~linear_z_Kd" : \b [double] linear.z controller Kd min: 0.0, default: 0.1, max: 10.0
- \b "~linear_z_Kp" : \b [double] linear.z controller Kp min: 0.0, default: 0.01, max: 10.0
- \b "~linear_z_Ki" : \b [double] linear.z controller Ki min: 0.0, default: 0.01, max: 10.0
- \b "~linear_z_Kd" : \b [double] linear.z controller Kd min: 0.0, default: 0.01, max: 10.0
- \b "~control_linear_z" : \b [bool] Controls the facing to target min: False, default: True, max: True
- \b "~angular_z_Kp" : \b [double] angular.z controller Kp min: 0.0, default: 0.01, max: 1.0
- \b "~angular_z_Ki" : \b [double] angular.z controller Ki min: 0.0, default: 0.01, max: 1.0
- \b "~angular_z_Kd" : \b [double] angular.z controller Kd min: 0.0, default: 0.01, max: 1.0
- \b "~angular_z_Kp" : \b [double] angular.z controller Kp min: 0.0, default: 0.01, max: 10.0
- \b "~angular_z_Ki" : \b [double] angular.z controller Ki min: 0.0, default: 0.01, max: 10.0
- \b "~angular_z_Kd" : \b [double] angular.z controller Kd min: 0.0, default: 0.01, max: 10.0
- \b "~control_angular_z" : \b [bool] Controls the facing to target min: False, default: True, max: True

View file

@ -56,15 +56,15 @@ desc=See the [[dynamic_reconfigure]] package for details on dynamically reconfig
12.type= bool
12.desc=Controls the facing to target
13.name= ~linear_z_Kp
13.default= 0.1
13.default= 0.01
13.type= double
13.desc=linear.z controller Kp Range: 0.0 to 10.0
14.name= ~linear_z_Ki
14.default= 0.1
14.default= 0.01
14.type= double
14.desc=linear.z controller Ki Range: 0.0 to 10.0
15.name= ~linear_z_Kd
15.default= 0.1
15.default= 0.01
15.type= double
15.desc=linear.z controller Kd Range: 0.0 to 10.0
16.name= ~control_linear_z
@ -74,15 +74,15 @@ desc=See the [[dynamic_reconfigure]] package for details on dynamically reconfig
17.name= ~angular_z_Kp
17.default= 0.01
17.type= double
17.desc=angular.z controller Kp Range: 0.0 to 1.0
17.desc=angular.z controller Kp Range: 0.0 to 10.0
18.name= ~angular_z_Ki
18.default= 0.01
18.type= double
18.desc=angular.z controller Ki Range: 0.0 to 1.0
18.desc=angular.z controller Ki Range: 0.0 to 10.0
19.name= ~angular_z_Kd
19.default= 0.01
19.type= double
19.desc=angular.z controller Kd Range: 0.0 to 1.0
19.desc=angular.z controller Kd Range: 0.0 to 10.0
20.name= ~control_angular_z
20.default= True
20.type= bool

View file

@ -22,14 +22,14 @@ gen.add("linear_y_Ki", double_t, 0, "linear.y controller Ki", .01, 0, 1)
gen.add("linear_y_Kd", double_t, 0, "linear.y controller Kd", .01, 0, 1)
gen.add("control_linear_y", bool_t, 0, "Controls the facing to target", True)
gen.add("linear_z_Kp", double_t, 0, "linear.z controller Kp", .1, 0, 10)
gen.add("linear_z_Ki", double_t, 0, "linear.z controller Ki", .1, 0, 10)
gen.add("linear_z_Kd", double_t, 0, "linear.z controller Kd", .1, 0, 10)
gen.add("linear_z_Kp", double_t, 0, "linear.z controller Kp", .01, 0, 10)
gen.add("linear_z_Ki", double_t, 0, "linear.z controller Ki", .01, 0, 10)
gen.add("linear_z_Kd", double_t, 0, "linear.z controller Kd", .01, 0, 10)
gen.add("control_linear_z", bool_t, 0, "Controls the facing to target", True)
gen.add("angular_z_Kp", double_t, 0, "angular.z controller Kp", .01, 0, 1)
gen.add("angular_z_Ki", double_t, 0, "angular.z controller Ki", .01, 0, 1)
gen.add("angular_z_Kd", double_t, 0, "angular.z controller Kd", .01, 0, 1)
gen.add("angular_z_Kp", double_t, 0, "angular.z controller Kp", .01, 0, 10)
gen.add("angular_z_Ki", double_t, 0, "angular.z controller Ki", .01, 0, 10)
gen.add("angular_z_Kd", double_t, 0, "angular.z controller Kd", .01, 0, 10)
gen.add("control_angular_z", bool_t, 0, "Controls the facing to target", True)

View file

@ -51,7 +51,8 @@ class Publisher:
component_center(x=pub_R[0], y=pub_R[1], nb_vertex=1, label=3),
]
if self.draw_targets:
self.pub.publish(self.centers)
if self.img_pub.get_num_connections() > 0:
for i in range(-20, 20):
for j in range(-20, 20):
try:
@ -61,8 +62,7 @@ class Publisher:
except Exception:
pass
self.pub.publish(self.centers)
if self.img_pub.get_num_connections() > 0:
self.img_pub.publish(self.bridge.cv2_to_imgmsg(img, "rgb8"))