From 953333647515737e835f0f7690829d73a0c85048 Mon Sep 17 00:00:00 2001 From: snktshrma Date: Sat, 9 Mar 2024 20:52:05 +0530 Subject: [PATCH 1/6] Updated gimbal 3d gimbal for yaw control --- models/iris_with_gimbal/model.sdf | 28 +++++++++++++++++++++++----- worlds/iris_runway.sdf | 2 +- worlds/iris_warehouse.sdf | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/models/iris_with_gimbal/model.sdf b/models/iris_with_gimbal/model.sdf index 94311401..ca2b643d 100755 --- a/models/iris_with_gimbal/model.sdf +++ b/models/iris_with_gimbal/model.sdf @@ -6,7 +6,7 @@ - model://gimbal_small_2d + model://gimbal_small_3d gimbal 0 -0.01 -0.124923 90 0 90 @@ -292,13 +292,24 @@ - gimbal::tilt_joint + gimbal::pitch_joint 3.14159265 -0.5 1100 1900 COMMAND - /gimbal/cmd_tilt + /gimbal/cmd_pitch + 3 + + + + gimbal::yaw_joint + 3.14159265 + -0.5 + 1100 + 1900 + COMMAND + /gimbal/cmd_yaw 3 @@ -314,8 +325,15 @@ - gimbal::tilt_joint - /gimbal/cmd_tilt + gimbal::pitch_joint + /gimbal/cmd_pitch + 2 + + + gimbal::yaw_joint + /gimbal/cmd_yaw 2 diff --git a/worlds/iris_runway.sdf b/worlds/iris_runway.sdf index 8f87d99e..259ac716 100755 --- a/worlds/iris_runway.sdf +++ b/worlds/iris_runway.sdf @@ -116,7 +116,7 @@ - model://iris_with_ardupilot + model://iris_with_gimbal 0 0 0.195 0 0 90 diff --git a/worlds/iris_warehouse.sdf b/worlds/iris_warehouse.sdf index 80010aca..a93cc61c 100644 --- a/worlds/iris_warehouse.sdf +++ b/worlds/iris_warehouse.sdf @@ -250,7 +250,7 @@ -6 0 0.25 0 0 0 - model://iris_with_ardupilot + model://iris_with_gimbal From 864358d894ebe63c0b97e21f8edc0505bb21c196 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Thu, 27 Jun 2024 15:32:21 +0100 Subject: [PATCH 2/6] Gimbal: match gimbal channels to wiki - Match gimbal channels to servo gimbal wiki. - Reduce gains on controllers. - Change direction of pitch and yaw. Signed-off-by: Rhys Mainwaring --- models/iris_with_gimbal/model.sdf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/models/iris_with_gimbal/model.sdf b/models/iris_with_gimbal/model.sdf index ca2b643d..73d12462 100755 --- a/models/iris_with_gimbal/model.sdf +++ b/models/iris_with_gimbal/model.sdf @@ -280,7 +280,7 @@ 1 - + gimbal::roll_joint 3.14159265 -0.5 @@ -288,29 +288,29 @@ 1900 COMMAND /gimbal/cmd_roll - 3 + 2 - + gimbal::pitch_joint - 3.14159265 + -3.14159265 -0.5 1100 1900 COMMAND /gimbal/cmd_pitch - 3 + 2 - + gimbal::yaw_joint - 3.14159265 + -3.14159265 -0.5 1100 1900 COMMAND /gimbal/cmd_yaw - 3 + 2 From b60e86eaef75d5e1a42a0a771eed9254591d2646 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Fri, 5 Jul 2024 12:03:58 +0100 Subject: [PATCH 3/6] Gimbal: increase possible range of all joints to -180 to 180 deg Signed-off-by: Rhys Mainwaring --- models/gimbal_small_1d/model.sdf | 4 ++-- models/gimbal_small_2d/model.sdf | 8 ++++---- models/gimbal_small_3d/model.sdf | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/models/gimbal_small_1d/model.sdf b/models/gimbal_small_1d/model.sdf index f449fae6..8ac8e725 100644 --- a/models/gimbal_small_1d/model.sdf +++ b/models/gimbal_small_1d/model.sdf @@ -143,8 +143,8 @@ 0.5 - -1.57079632 - 1.57079632 + -3.1415926 + 3.1415926 0 0 0.02 0 0 0 diff --git a/models/gimbal_small_2d/model.sdf b/models/gimbal_small_2d/model.sdf index cddceb05..9d85f868 100644 --- a/models/gimbal_small_2d/model.sdf +++ b/models/gimbal_small_2d/model.sdf @@ -79,8 +79,8 @@ 0.5 - -1.57079632 - 1.57079632 + -3.1415926 + 3.1415926 0.01 0 -0.04 0 0 0 @@ -179,8 +179,8 @@ 0.5 - -1.57079632 - 1.57079632 + -3.1415926 + 3.1415926 0 0 0.02 0 0 0 diff --git a/models/gimbal_small_3d/model.sdf b/models/gimbal_small_3d/model.sdf index d265f7ea..4e18a293 100644 --- a/models/gimbal_small_3d/model.sdf +++ b/models/gimbal_small_3d/model.sdf @@ -77,8 +77,8 @@ 0.5 - -1.57079632 - 1.57079632 + -3.1415926 + 3.1415926 0.0105 0.065 -0.002 0 0 0 @@ -125,8 +125,8 @@ 0.5 - -1.57079632 - 1.57079632 + -3.1415926 + 3.1415926 0.0099 0.002 -0.05 0 0 0 @@ -230,8 +230,8 @@ 0.5 - -1.57079632 - 1.57079632 + -3.1415926 + 3.1415926 0.045 0.0021 0.0199 0 0 0 From 0ed4cfb8d309247fb2fda32b086ed180fbd7bded Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Fri, 5 Jul 2024 12:04:20 +0100 Subject: [PATCH 4/6] Gimbal: reduce joint damping Signed-off-by: Rhys Mainwaring --- models/gimbal_small_1d/model.sdf | 2 +- models/gimbal_small_2d/model.sdf | 4 ++-- models/gimbal_small_3d/model.sdf | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/models/gimbal_small_1d/model.sdf b/models/gimbal_small_1d/model.sdf index 8ac8e725..4fefeb56 100644 --- a/models/gimbal_small_1d/model.sdf +++ b/models/gimbal_small_1d/model.sdf @@ -140,7 +140,7 @@ 1 0 0 - 0.5 + 0.01 -3.1415926 diff --git a/models/gimbal_small_2d/model.sdf b/models/gimbal_small_2d/model.sdf index 9d85f868..cf2af733 100644 --- a/models/gimbal_small_2d/model.sdf +++ b/models/gimbal_small_2d/model.sdf @@ -76,7 +76,7 @@ 0 0 1 - 0.5 + 0.01 -3.1415926 @@ -176,7 +176,7 @@ 1 0 0 - 0.5 + 0.01 -3.1415926 diff --git a/models/gimbal_small_3d/model.sdf b/models/gimbal_small_3d/model.sdf index 4e18a293..22a866ae 100644 --- a/models/gimbal_small_3d/model.sdf +++ b/models/gimbal_small_3d/model.sdf @@ -74,7 +74,7 @@ 0 1 0 - 0.5 + 0.01 -3.1415926 @@ -122,7 +122,7 @@ 0 0 1 - 0.5 + 0.01 -3.1415926 @@ -227,7 +227,7 @@ 1 0 0 - 0.5 + 0.01 -3.1415926 From af6337345e17babf4ce791a2e05abec8e7add92e Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Fri, 5 Jul 2024 12:45:30 +0100 Subject: [PATCH 5/6] Gimbal: update gimbal limits in controller settings Signed-off-by: Rhys Mainwaring --- models/iris_with_gimbal/model.sdf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/models/iris_with_gimbal/model.sdf b/models/iris_with_gimbal/model.sdf index 73d12462..70935b39 100755 --- a/models/iris_with_gimbal/model.sdf +++ b/models/iris_with_gimbal/model.sdf @@ -280,9 +280,10 @@ 1 + gimbal::roll_joint - 3.14159265 + 1.047197551196 -0.5 1100 1900 @@ -291,10 +292,11 @@ 2 + gimbal::pitch_joint -3.14159265 - -0.5 + -0.75 1100 1900 COMMAND @@ -302,9 +304,10 @@ 2 + gimbal::yaw_joint - -3.14159265 + -5.5850536 -0.5 1100 1900 From 5c1bf93373464bdb25d8efbce5e2c332587a589c Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Fri, 5 Jul 2024 12:46:01 +0100 Subject: [PATCH 6/6] Gimbal: update parameters to match plugin control settings Signed-off-by: Rhys Mainwaring --- config/gazebo-iris-gimbal.parm | 52 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/config/gazebo-iris-gimbal.parm b/config/gazebo-iris-gimbal.parm index 3cf5d186..f8154e85 100644 --- a/config/gazebo-iris-gimbal.parm +++ b/config/gazebo-iris-gimbal.parm @@ -2,29 +2,35 @@ FRAME_CLASS 1 FRAME_TYPE 1 -# IRLOCK FEATURE -RC8_OPTION 39 -PLND_ENABLED 1 -PLND_TYPE 3 +# Match servo out for motors +MOT_PWM_MIN 1100 +MOT_PWM_MAX 1900 -# SONAR FOR IRLOCK -SIM_SONAR_SCALE 10 -RNGFND1_TYPE 1 -RNGFND1_SCALING 10 -RNGFND1_PIN 0 -RNGFND1_MAX_CM 5000 +# Gimbal on mount 1 has 3 DOF +MNT1_TYPE 1 # Servo +MNT1_PITCH_MAX 45 +MNT1_PITCH_MIN -135 +MNT1_ROLL_MAX 30 +MNT1_ROLL_MIN -30 +MNT1_YAW_MAX 160 +MNT1_YAW_MIN -160 -# Gimbal on mount 1 has 2 DOF -MNT1_PITCH_MAX 90 -MNT1_PITCH_MIN -90 -MNT1_ROLL_MAX 90 -MNT1_ROLL_MIN -90 -MNT1_TYPE 1 +# Gimbal RC in +RC6_MAX 1900 +RC6_MIN 1100 +RC6_OPTION 212 # Mount1 Roll +RC7_MAX 1900 +RC7_MIN 1100 +RC7_OPTION 213 # Mount1 Pitch +RC8_MAX 1900 +RC8_MIN 1100 +RC8_OPTION 214 # Mount1 Yaw +RC8_REVERSED 0 # Normal +RC9_MAX 1900 +RC9_MIN 1100 +RC9_OPTION 0 # Do Nothing -# Gimbal roll and pitch RC -RC9_OPTION 212 -RC10_OPTION 213 - -# Gimbal roll and pitch servos -SERVO5_FUNCTION 8 -SERVO6_FUNCTION 7 +# Gimbal servo out +SERVO9_FUNCTION 8 # Mount1Roll +SERVO10_FUNCTION 7 # Mount1Pitch +SERVO11_FUNCTION 6 # Mount1Yaw \ No newline at end of file