Skip to content

Commit

Permalink
[Beetle][test] add servo test script
Browse files Browse the repository at this point in the history
  • Loading branch information
sugihara-16 committed Feb 19, 2024
1 parent f57d225 commit a12aff5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions robots/beetle/script/test/servo_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python

import rospy
import numpy as np
import math
import time
from modules.kondo_control import KondoControl

class GimbalTest():
def __init__(self):

self.kondo = KondoControl('beetle2',2, 1, False)

self.test_angle_max = 1.0

self.nav_rate = rospy.Rate(40)

self.t = 0

time.sleep(0.5)

def main(self):
while not rospy.is_shutdown():
self.t = self.t + 0.04
target_angle = self.test_angle_max * math.sin(self.t)
self.kondo.sendTargetAngle(target_angle)
self.nav_rate.sleep()

if __name__ == "__main__":

rospy.init_node("gimbale_test")

gimbal_test = GimbalTest()
gimbal_test.main()



0 comments on commit a12aff5

Please sign in to comment.