I am working in Olympe and I want to send PCMD commands in 20 Hz to ANAFI. When I use ROS to control an AR DRONE 2.0 for example, I can specify the frequency as 50 Hz and create a while loop like while not rospy.is_shutdown(). Then the time interval of each step in this loop is 0.02 seconds. But for Olympe, right now I only have a rough demo like below. Does anyone have any thoughts or ideas?
idx = 0 t_begin = time.time() while idx < 50: t_start = time.time() drone(PCMD(1, 50, 0, 0, 10, 0)) idx += 1 t_exc_end = time.time() - t_start time.sleep(0.05 - t_exc_end) t_end = time.time() - t_start print("execute time") print(t_exc_end) print("time interval for each step") print(t_end)
And I don’t understand the explanation for PCMD’s parameter timestampAndSeqNum. Can anyone post an example for this?