Commit b0ee60af authored by michaero's avatar michaero
Browse files

added missing bits and instructions for enabling logging once uwb is working

parent d2944ce7
......@@ -220,6 +220,7 @@ class PPSRadioClient:
xyzrpy_polling_period = rospy.get_param(ros_namespace + "/CrazyRadio/xyzrpy_polling_period")
self.xyzrpy = LogConfig("XYZRPYLog", xyzrpy_polling_period)
#TODO: where are coordinates published?
#self.xyzrpy.add_variable("xxx.x", "float");
#self.xyzrpy.add_variable("xxx.y", "float");
#self.xyzrpy.add_variable("xxx.z", "float");
......@@ -270,6 +271,23 @@ class PPSRadioClient:
#self.init_log_anchordist() #TODO: test
def _stop_logging(self):
self.batLog.stop()
rospy.loginfo("batLog stopped")
self.batLog.delete()
rospy.loginfo("batLog deleted")
self.xyzrpy.stop()
rospy.loginfo("xyzrpy stopped")
self.xyzrpy.delete()
rospy.loginfo("xyzrpy deleted")
#self.anchorDist.stop()
#rospy.loginfo("anchorDist stopped")
#self.anchorDist.delete()
#rospy.loginfo("anchorDist deleted")
def _connected(self, link_uri):
"""
This callback is executed as soon as the connection to the
......@@ -283,9 +301,6 @@ class PPSRadioClient:
# Config for Logging
self._start_logging()
def _connection_failed(self, link_uri, msg):
"""Callback when connection initial connection fails (i.e no Crazyflie
at the specified address)"""
......@@ -306,15 +321,7 @@ class PPSRadioClient:
# change state to motors OFF
self.PPSClient_command_pub.publish(CMD_CRAZYFLY_MOTORS_OFF)
self.batLog.stop()
rospy.loginfo("batLog stopped")
self.batLog.delete()
rospy.loginfo("batLog deleted")
self.xyzrpy.stop()
rospy.loginfo("xyzrpy stopped")
self.xyzrpy.delete()
rospy.loginfo("xyzrpy deleted")
self._stop_logging()
def _send_to_commander_motor(self, cmd1, cmd2, cmd3, cmd4):
pk = CRTPPacket()
......@@ -403,9 +410,11 @@ if __name__ == '__main__':
global rpy_pub
rpy_pub = rospy.Publisher(node_name + '/RPY', Float32MultiArray, queue_size=10)
#TODO: To publish position, fix _xyzrpy_received_callback and _init_log_xyzrpy
#global xyz_pub
#xyz_pub = rospy.Publisher(node_name + '/XYZ', Float32MultiArray, queue_size=10)
#TODO: To publish distances, uncomment these lines, uncomment self.init_log_anchordist() in _start_logging, uncomment stop functions in _stop_logging
#global distances_pub
#distances_pub = rospy.Publisher(node_name + '/distances', Float32MultiArray, queue_size=10)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment