I'm trying to write a python code, that controls a drone. I receive the position from a Rigid-body trough a rostopic, and I want to use that data in my code. How can i access it in my python code?
#!/usr/bin/env python
import numpy as np
from pycrazyswarm import *
Z = 1.0
if __name__ == "__main__":
swarm = Crazyswarm()
timeHelper = swarm.timeHelper
allcfs = swarm.allcfs
allcfs.takeoff(targetHeight=Z, duration=1.0+Z)
timeHelper.sleep(1.5+Z)
print("press button to continue...")
swarm.input.waitUntilButtonPressed()
# After the button is pressed, I want, that the drone is aligned by a rigid body.
# Means if the rigid body moves 1m left the drone should follow
allcfs.land(targetHeight=0.02, duration=1.0+Z)
timeHelper.sleep(1.0+Z)
So after the button is pressed, I would like to use the data of the rostopic. On the host i send the data over the VRPN client of ROS http://wiki.ros.org/vrpn_client_ros I want to compute the data of the "tracker name"/pose topic