To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a73bab51 authored by michaero's avatar michaero
Browse files

Added param command to enable ranging on CF

parent c8c63e13
......@@ -53,6 +53,9 @@ from cflib.crazyflie.log import LogConfig
# Logging settings
logging.basicConfig(level=logging.ERROR)
# enableUWB parameter import
from cflib.crazyflie.param import Param
# CONTROLLER_MOTOR = 2
# CONTROLLER_ANGLE = 1
# CONTROLLER_RATE = 0
......@@ -145,6 +148,8 @@ class PPSRadioClient:
self.init_log_uwb()
self.UWBUpdateCallback(1)
# if enableUWB:
# self.init_log_uwb()
......@@ -312,6 +317,12 @@ class PPSRadioClient:
self.rpyLog.delete()
rospy.loginfo("[CrazyRadio] rpyLog deleted")
### enableUWB parameter on CF
def init_params(self):
self.params = Param(self._cf)
"""
---------------------------------------
......@@ -368,11 +379,13 @@ class PPSRadioClient:
self.stop_log_uwb()
if (self.rpyLog._get_started):
self.stop_log_rpy()
self.params.set_value(activate_anchors.enable,0)
else:
if not (self.anchorLog._get_started()):
self.start_log_uwb()
if not (self.rpyLog._get_started()):
self.start_log_rpy()
self.params.set_value(activate_anchors.enable,1)
except rospy.ServiceException, e:
rospy.logerr("[CrazyRadio] Unable to activate Loggings from Service");
......
Markdown is supported
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