I know there's a question which is almost the same as mine somewhere on the forum, but it still has not solved my problem...
I am currently trying to change the value of just the attitude pitch kd value, and for that I have been following the instructions provided in the wiki and followed the logic in the basicparam.py example. This is the code that I am currently using (extract of the relevant bits):
Code: Select all
def _param_update_kd(self):
param_name = "pid_attitude.pitch_kd"
param_value = "10000"
self._cf.param.set_value(param_name,param_value)
self._cf.param.add_update_callback(group = "pid_attitude",name = "pitch_kd",cb =self._readparam)
self._cf.param.request_param_update("pid_attitude.pitch_kd")
# run cf for 5s to check if parameters have changed
self._cf.commander.send_setpoint(0, 0, 0, 0)
the_time = time.time()
while the_time + 5 > time.time():
self._cf.commander.send_setpoint(0, 0, 0, 1000)
# Close link
self._cf.close_link()
def _readparam(self,name,value):
print("%s has value %d" % (name,value))
f-