280 模型跟随增加异常处理机制

This commit is contained in:
wangWking 2024-12-04 15:21:41 +08:00
parent 25a3fdc95a
commit f00bbb2258
3 changed files with 93 additions and 86 deletions

View file

@ -59,6 +59,7 @@ def talker():
while not rospy.is_shutdown():
joint_state_send.header.stamp = rospy.Time.now()
try:
angles = mycobot.get_radians()
data_list = []
for index, value in enumerate(angles):
@ -94,6 +95,8 @@ def talker():
pub_marker.publish(marker_)
rate.sleep()
except Exception as e:
print(e)
if __name__ == "__main__":

View file

@ -65,7 +65,7 @@ def talker():
print("publishing ...")
while not rospy.is_shutdown():
joint_state_send.header.stamp = rospy.Time.now()
try:
angles = mycobot.get_radians()
print('angles:',angles)
data_list = []
@ -102,6 +102,8 @@ def talker():
pub_marker.publish(marker_)
rate.sleep()
except Exception as e:
print(e)
if __name__ == "__main__":

View file

@ -59,7 +59,7 @@ def talker():
print("publishing ...")
while not rospy.is_shutdown():
joint_state_send.header.stamp = rospy.Time.now()
try:
angles = mycobot.get_radians()
data_list = []
for index, value in enumerate(angles):
@ -95,6 +95,8 @@ def talker():
pub_marker.publish(marker_)
rate.sleep()
except Exception as e:
print(e)
if __name__ == "__main__":