Logs not started on all CFs in swarm #732
-
Hi! I'm trying to write a simple test for our test lab to verify the broadcast functionality of the radio. I have added a simple function to the firmware where I have connected a parameter to a log, that is the value written to the parameter ( It sort of works, but I see a weird behavior. We have 10 Roadrunners in the swarm and the log seems to be set up only on the 5 last members in the swarm. This seems to be true also if I remove a couple of members, and with 5 members all of them get the log. Is this an expected behavior or am I doing something wrong? The relevant code looks something like this:
In the python test def log_callback(value):
rospy.loginfo(value)
# Works for nr 7 but I get no logging for nr 0
cf_id_to_get_logs_from = 7
rospy.Subscriber('/cf' + str(swarm.allcfs.crazyflies[cf_id_to_get_logs_from].id) + '/log1', GenericLogData, log_callback, queue_size=1)
swarm.allcfs.setParam('system/testLogParam', value)
rospy.sleep(10)
Any help is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Crazyswarm1 is not very well behaved when using logging for more than 1 CF (it was essentially only tested for debugging issues with a single CF). One thing to be careful about is the "genericLogTopicFrequencies" - from the name one would guess that this is Hz, but in reality it's the period in 10ms increments, so in this case you would get new data every 10s, which is perhaps not what you expect. There are also issues with fairness - it's entirely possible that some CFs are "starved" if you use a single radio. In theory, Crazyswarm2 is better in all these regards, but I think it's not set up in your test lab yet. |
Beta Was this translation helpful? Give feedback.
-
That's the feeling I got :-) The main purpose was to verify that broadcast works on the Crazyradio2. It has been tested manually and I think I'll wait with the automated test until we switch to CS2. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello @krichardsson, I have a similiar problem at the moment, I want to get the log1 topic via ROS. I´d be glad if you could tell me the import directive you´ve used to get the GenericLogData datatype. Thanks in advance Flo |
Beta Was this translation helpful? Give feedback.
Crazyswarm1 is not very well behaved when using logging for more than 1 CF (it was essentially only tested for debugging issues with a single CF). One thing to be careful about is the "genericLogTopicFrequencies" - from the name one would guess that this is Hz, but in reality it's the period in 10ms increments, so in this case you would get new data every 10s, which is perhaps not what you expect. There are also issues with fairness - it's entirely possible that some CFs are "starved" if you use a single radio.
In theory, Crazyswarm2 is better in all these regards, but I think it's not set up in your test lab yet.