Browse Source

根据最新版摄像头云台舵机来调整角度都为90度

corvin rasp melodic 3 years ago
parent
commit
00ef65bdb5
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/teleop_twist_keyboard/teleop_twist_keyboard.py

+ 7 - 7
src/teleop_twist_keyboard/teleop_twist_keyboard.py

@@ -56,10 +56,10 @@ speedBindings={
     }
 
 cameraUpBindings={
-        '1':(5),
+        '1':(-5),
     }
 cameraDownBindings={
-        '2':(-5),
+        '2':(5),
     }
 cameraLeftBindings={
         '3':(5),
@@ -107,7 +107,7 @@ if __name__=="__main__":
     z = 0
     th = 0
     status = 0
-    upDownAngle = 10
+    upDownAngle = 90
     leftRightAngle = 90
     command = 2
 
@@ -137,7 +137,7 @@ if __name__=="__main__":
                 print(angles(upDownAngle))
                 if (upDownAngle < 180 and upDownAngle >=0):
                     upDownAngle = upDownAngle + cameraUpBindings[key]
-                    client_srv(0, upDownAngle)
+                    client_srv(1, upDownAngle)
             elif key in cameraDownBindings.keys():
                 x = 0
                 y = 0
@@ -146,7 +146,7 @@ if __name__=="__main__":
                 print(angles(upDownAngle))
                 if (upDownAngle <= 180 and upDownAngle >0):
                     upDownAngle = upDownAngle + cameraDownBindings[key]
-                    client_srv(0, upDownAngle)
+                    client_srv(1, upDownAngle)
             elif key in cameraLeftBindings.keys():
                 x = 0
                 y = 0
@@ -155,7 +155,7 @@ if __name__=="__main__":
                 print(angles(leftRightAngle))
                 if (leftRightAngle < 180 and leftRightAngle >=0):
                     leftRightAngle = leftRightAngle + cameraLeftBindings[key]
-                    client_srv(1, leftRightAngle)
+                    client_srv(0, leftRightAngle)
             elif key in cameraRightBindings.keys():
                 x = 0
                 y = 0
@@ -164,7 +164,7 @@ if __name__=="__main__":
                 print(angles(leftRightAngle))
                 if (leftRightAngle <= 180 and leftRightAngle >0):
                     leftRightAngle = leftRightAngle + cameraRightBindings[key]
-                    client_srv(1, leftRightAngle)
+                    client_srv(0, leftRightAngle)
             else:
                 x = 0
                 y = 0