You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We now have a parameter set_value that sets the parameter value on the crazyflie. Currently it is blocked until the crazyflie not only received the full toc but also has downloaded all the values, as it technically doesn't send the parameter directly, but the parameter set that has been downloaded in the cflib.
Technically we could set the parameter after the TOC has been received, as that is faster since TOC can be cached but the values can not. The chance is only that there is a change that the value downloaded on the cflib can be overwritten while it is has been downloaded which could cause issues if not handled properly.
logger.warning("Cannot set value for [%s], it's not in the TOC!",
complete_name)
raiseKeyError('{} not in param TOC'.format(complete_name))
elifelement.access==ParamTocElement.RO_ACCESS:
logger.debug('[%s] is read only, no trying to set value',
complete_name)
raiseAttributeError('{} is read-only!'.format(complete_name))
else:
varid=element.ident
pk=CRTPPacket()
pk.set_header(CRTPPort.PARAM, WRITE_CHANNEL)
ifself._useV2:
pk.data=struct.pack('<H', varid)
else:
pk.data=struct.pack('<B', varid)
ifelement.pytype=='<f'orelement.pytype=='<d':
value_nr=float(value)
else:
value_nr=int(value)
pk.data+=struct.pack(element.pytype, value_nr)
self.param_updater.request_param_setvalue(pk)
Either two ways we can solve this:
Have a block of the set_value, that checks if the setting is happening simultaneously or if it has been set by the cflib upon startup (such that it ignores the value of the crazyflie and sets the cflib one, or whoever we think has higher authorization)
Have a function that is between set_value and set_value_raw, which is basically set_value_raw but it wait until the toc such that you don't have assume the type.
This might improve the appeared connection speed for swarms significantly.
The text was updated successfully, but these errors were encountered:
We now have a parameter set_value that sets the parameter value on the crazyflie. Currently it is blocked until the crazyflie not only received the full toc but also has downloaded all the values, as it technically doesn't send the parameter directly, but the parameter set that has been downloaded in the cflib.
Technically we could set the parameter after the TOC has been received, as that is faster since TOC can be cached but the values can not. The chance is only that there is a change that the value downloaded on the cflib can be overwritten while it is has been downloaded which could cause issues if not handled properly.
This is the set_value for params:
crazyflie-lib-python/cflib/crazyflie/param.py
Lines 332 to 367 in be04130
Either two ways we can solve this:
This might improve the appeared connection speed for swarms significantly.
The text was updated successfully, but these errors were encountered: