Skip to content

Commit

Permalink
add error check for older firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
whoenig committed Dec 19, 2023
1 parent d5ff1a0 commit 4ee3c3b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crazyflie_py/crazyflie_py/crazyflie.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def __init__(self, node, cfname, paramTypeDict):
# self.cmdVelocityWorldMsg.header.frame_id = '/world'

def setGroupMask(self, groupMask):
"""Set the group mask bits for this robot.
"""
Set the group mask bits for this robot.
The purpose of groups is to make it possible to trigger an action
(for example, executing a previously-uploaded trajectory) on a subset
Expand All @@ -206,10 +207,14 @@ def setGroupMask(self, groupMask):
----
groupMask (int): An 8-bit integer representing this robot's
membership status in each of the <= 8 possible groups.
"""
# Note that this requires a recent firmware; older firmware versions
# do not have such a parameter.
self.setParam('hlCommander.groupmask', groupMask)
try:
self.setParam('hlCommander.groupmask', groupMask)
except KeyError:
self.node.get_logger().error('setGroupMask: Your firmware is too old - Please update.')

# def enableCollisionAvoidance(self, others, ellipsoidRadii):
# """Enables onboard collision avoidance.
Expand Down

0 comments on commit 4ee3c3b

Please sign in to comment.