Closed medioman22 closed 4 years ago
rosrun crazyflie_tools comCheck --uri <yourURI>
, which measures a lot of statistics for link quality. I don't think there is often an issue with USB3, and if there is it is HW-related and you would have trouble with the cfclient as well.Thank you for such a quick reply.
rosrun crazyflie_tools comCheck --uri <yourURI>
which gives me very good results.
rosrun crazyflie_tools comCheck --uri radio://0/80/2M/E7E7E7E701
numPacketsReceived: 95.6 %
Avg. roundtrip time: 20.7856 ms
751.88 packets/s sent
link quality: 1
After investigating, I managed to get satisfying results by sending several time the same high-level command. Basically, I update the command I send at a rate of 2 Hz, but i send the same command at a rate of 25 Hz to make sure the drone executes it. However, for my specific application I would need to update the command at a frequency of about 10-15 Hz. I am using the Melinger controller as it is very stable, but I am aware that it means that the crazyflie has to recompute a trajectory onboard for each new command. For this reason, I have observed that the crazyflie can't remain stable if I send a new command at a higher rate.
For my application, I need to send continuously position setpoints to the drone, and the setpoints are not changing drastically but they are not known in advance (i.e. I cannot just update a trajectory and ask the drone to follow it). Basically instead of asking the drone to move 0.5m in 1second (which is suited for the high-level ROS services), I would rather like to ask it to move 5cm in 0.1second. However, I have issues with the two options that seem suited for this task:
Finally, I still have the same question about the enable_logging
parameter. When it is set to false, the drone does not respond at all to any command. Is that the intended behavior ?
Thanks
PID controller: Not sure, but it should actually behave similarly to the mellinger controller. The performance might depend on which state estimator you use. The PID controller is optimized for Kalman, while mellinger has been optimized for KalmanUSC.
Commands: Ideally you should send cmd_position or cmd_full_state, and not goTo commands for your application. Both of those do not do any onboard planning and use the provided setpoint directly instead. You do need to send the commands fairly frequently - there is a timeout on-board that is triggered after 500ms of no command received (at which point it will try to hover; after 2s the motors shut off). You are correct that mixing low- and high-level commands does not fully work yet. You can take-off using high-level, then moving using low-level, and land using low-level. You cannot switch from low-level to high-level, but you can switch from high-level to low-level.
Enable_logging should only have an effect on streaming data from the CF to the basestation. What you describe sounds like a bug to me. Do you have any more details on that?
Hello !
Thank you very much for your answer. I have looked into it, and manage to get something satisfying for my application:
PID controller: indeed after switching the estimator to Kalman (not KalmanUSC) the result is quite good. I have been able to send high-level commands at my desired rate and am quite happy with the results, as the drone trajectory is quite smooth even when I change the setpoints.
Thank you for the explanation, it did not understand that the low-level command had to be sent continuously. I will stick with the high-level commands for now as they provide a neat interface for take-off and landing, and I obtained satisfying results.
Basically, whenever l set Enable_logging to False, hover_swarm.launch works as usual and I can see all the commands being sent, however the drone nerver takes off. In fact, the LED "M4" which usually is green or flickering green does not light up, except at startup. Looking at the source code of the server, I noticed that at startup, a ping message is sent 50 times to each drone listed in the config file. This corresponds to the quick flickering of LED "M4" that I notice when I launch hover_swarm.launch. Here are the corresponding lines in crazyswarm_server.cpp, in CrazyflieGroup::readObjects():
// Turn all CFs on
for (const auto& config : cfConfigs) {
Crazyflie cf(config.uri);
cf.syson();
for (size_t i = 0; i < 50; ++i) {
cf.sendPing();
}
}
However, I noticed that when logging is disabled, no ping is sent at all. I read somewhere (forgot where) that a ping should be sent regularly to the cf to keep the connection working. However, in CrazyflieGroup::runSlow():
while(ros::ok() && !m_isEmergency) {
if (enableLogging) {
for (const auto& cf : m_cfs) {
cf->sendPing();
}
}
m_slowQueue.callAvailable(ros::WallDuration(0));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
the ping is not sent at all if Enable_logging is false.
About 3: Since the crazyswarm is mostly using broadcast, it is actually intended to not send a ping if enable_logging is set to false. What is not intended is that your CF is not doing anything in that particular case - this does sound like a bug. Note that for a larger swarm, you will need to set enable_logging to false, otherwise you can only control a few (~4) CFs/radio.
Hello,
I have followed the instructions for using crazyswarm with OptiTrack but I am running through some issues.
Let me first describe my setup:
After some efforts I managed to make the drone take off with hover_swarm.launch, and I am quite satisfied by the stabilization achieved. However, there seems to be a communication problem between the cf and the crazyradio, because the drone does not execute all the instructions sent.
When I pressed start on the controller to take off, I always get the output on the console, but the drone actually takes off sometimes and not always.
Here is the output of the terminal:
I sometimes get the message "[cf1] Link Quality low" even though I have only one cf, about 3 meters away (and I also get this message when I have the cf next to the crazyradio). What is strange is that using the python client app, I always have a perfect link quality.
I also noticed that when I set logging_enabled to false in the launch file, the drone does not respond to any command at all. Checking in the source of crazy_server I noticed that when logging is disabled, no ping is sent to the cf in the runSlow() function of CrazyflieGroup.
I have spent a lot of time trying to figure out how to use crazyswarm but I am not sure what to do now.
I have tried to use the python API in vain. I have tried using the ROS services for high-level commands as well as the topics for low-level commands also in vain. I experience the same issues, the ROS part works fine and I always get the output about the commands I send, but the cf does not always execute the commands.
What could be the problem ?
If someone has similar issues, did you find any workaround. There should be no such issue for controlling only one drone right ?
Best,