From f5d3507ecf1ae1e30e4cdb4003979faf7d399efb Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Fri, 22 Mar 2019 15:58:24 +0100 Subject: [PATCH] =?UTF-8?q?Meilleure=20r=C3=A9activit=C3=A9=20du=20drone.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/detect_targets/TriangleParamConfig.h | 12 ++++++------ .../docs/TriangleParamConfig-usage.dox | 6 +++--- .../detect_targets/docs/TriangleParamConfig.dox | 12 ++++++------ .../detect_targets/docs/TriangleParamConfig.wikidoc | 12 ++++++------ .../src/detect_targets/cfg/triangle_control.cfg | 12 ++++++------ .../src/detect_targets/scripts/target_publisher.py | 6 +++--- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/workspace/devel/.private/detect_targets/include/detect_targets/TriangleParamConfig.h b/workspace/devel/.private/detect_targets/include/detect_targets/TriangleParamConfig.h index c7fd408..b1ba32b 100644 --- a/workspace/devel/.private/detect_targets/include/detect_targets/TriangleParamConfig.h +++ b/workspace/devel/.private/detect_targets/include/detect_targets/TriangleParamConfig.h @@ -605,7 +605,7 @@ TriangleParamConfig::GroupDescription("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("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("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 - - - + + + diff --git a/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.dox b/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.dox index 2e2b9a0..20fd123 100644 --- a/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.dox +++ b/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.dox @@ -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 diff --git a/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.wikidoc b/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.wikidoc index 1fe82ac..74410e8 100644 --- a/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.wikidoc +++ b/workspace/devel/.private/detect_targets/share/detect_targets/docs/TriangleParamConfig.wikidoc @@ -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 diff --git a/workspace/src/detect_targets/cfg/triangle_control.cfg b/workspace/src/detect_targets/cfg/triangle_control.cfg index d709189..e192354 100755 --- a/workspace/src/detect_targets/cfg/triangle_control.cfg +++ b/workspace/src/detect_targets/cfg/triangle_control.cfg @@ -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) diff --git a/workspace/src/detect_targets/scripts/target_publisher.py b/workspace/src/detect_targets/scripts/target_publisher.py index b81844a..fcab8cf 100755 --- a/workspace/src/detect_targets/scripts/target_publisher.py +++ b/workspace/src/detect_targets/scripts/target_publisher.py @@ -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"))