USC-ACTLab / crazyswarm

A Large Quadcopter Swarm
MIT License
319 stars 317 forks source link

"Exception thrown while processing service call: timeout” error #272

Open manikamakam opened 3 years ago

manikamakam commented 3 years ago

Hello,

I am trying to use the crazyswarm repo to fly two crazyflies (for now) using VICON system. I have gotten to a place where our ROS system recognizes the existence of crazyflies. I verified this with the provided chooser.py script.

First issue: If I click reboot, I can observe the crazyflies switching off and turning back on, thus proving that the connection is established. However, if I click on battery, I see 0.00V for both of them though their batteries are charged. I'm not sure why reboot is working but not the battery option. Screenshot from 2020-11-06 12-11-48

Second issue: I've selected only one crazyflie from the chooser.py. Before going to VICON, I want to fly the crazyflie with joystick. When I run roslaunch crazyflie_demo teleop_xbox360.launch uri:=radio://0/100/2M, it throws an error saying “Exception thrown while processing service call: timeout”. No values were found in the IMU topic and we can’t see the crazyflie on the RViz display. The uri is correct as I cross-verified by running rosrun crazyflie_tools scan -v. I think the connection is established as the reboot is working in chooser.py script. But I'm unsure on why I'm facing this error.

Screenshot from 2020-11-06 12-13-18

Any suggestions to solve these issues would be greatly appreciated. Thank you.

whoenig commented 3 years ago
  1. Did you update your NRF firmware as well as the Crazyradio firmware? Wrong battery measurements usually indicate that there is a mismatch in the versions (the communication protocol changed slightly over the versions).
  2. Teleoperation is (currently) not supported with the Crazyswarm. You should use hover_swarm.launch instead and navigate using trajectories or waypoints. It would be easy to add Joystick control, but there is just no out-of-the-box example, yet.
manikamakam commented 3 years ago

Thank you for your response. I've previously updates crazyflies but not the radio. By updating radio, I'm able to get battery values. I have two other issues now.

  1. While I'm building the repository, I get the following arm-none-eabi-size cf2_nrf.elf text data bss dec hex filename 63924 604 4888 69416 10f28 cf2_nrf.elf S110 Activated BLE Disabled Built for platform cf2 fatal: reference is not a tree: 82e80521124c6e96e5fdb3538a2533f994e2db8f Unable to checkout '82e80521124c6e96e5fdb3538a2533f994e2db8f' in submodule path 'vendor/FreeRTOS

I'm able to run all the codes but I was just wondering why is it not able to checkout that specific sub-module. All the other sub-modules are updated.

  1. I'm running the roslaunch crazyswarm hover_swarm.launch command. But I get the below output:

... logging to /home/ottelab/.ros/log/03bada0c-25da-11eb-8272-9cefd5fcd5b4/roslaunch-ottelab-Precision-Tower-3620-24472.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ottelab-Precision-Tower-3620:43053/

SUMMARY

PARAMETERS

NODES / crazyswarm_server (crazyswarm/crazyswarm_server) crazyswarm_teleop (crazyswarm/crazyswarm_teleop) joy (joy/joy_node) rviz (rviz/rviz)

auto-starting new master process[master]: started with pid [24482] ROS_MASTER_URI=http://localhost:11311

setting /run_id to 03bada0c-25da-11eb-8272-9cefd5fcd5b4 process[rosout-1]: started with pid [24495] started core service [/rosout] process[crazyswarm_server-2]: started with pid [24512] process[joy-3]: started with pid [24513] process[crazyswarmteleop-4]: started with pid [24515] process[rviz-5]: started with pid [24541] [ INFO] [1605290386.724675646]: Wait for services... [ INFO] [1605290386.725184977]: waitForService: Service [/emergency] has not been advertised, waiting... [ INFO] [1605290386.746116698]: waitForService: Service [/emergency] is now available. [ INFO] [1605290386.747331887]: Manager ready. ch: 1 [ INFO] [1605290386.758435146]: Adding CF: cf1 (radio://0/100/2M/E7E7E7E701, cf1)... [ INFO] [1605290386.774208498]: CF ctor: 0.015711 s [ INFO] [1605290386.778600407]: [cf1] SYS: ---------------------------- [ INFO] [1605290386.780854452]: [cf1] SYS: Crazyflie 2.1 is up and running! [ INFO] [1605290386.782920460]: [cf1] SYS: Production release 2020.09 [ERROR] [1605290386.784447408]: Couldn't open joystick force feedback! [ INFO] [1605290386.784484552]: Opened joystick: /dev/input/js0. deadzone: 0.050000. [ INFO] [1605290386.786371345]: [cf1] SYS: I am 0x203937434848501700330052 and I have 1024KB of flash! [ INFO] [1605290386.788508045]: [cf1] DECK_CORE: 0 deck(s) found [ INFO] [1605290386.790798374]: [cf1] IMU: BMI088 Gyro I2C connection [OK]. [ INFO] [1605290386.792580968]: [cf1] on [OK] [ INFO] [1605290386.794724972]: [cf1] IMU: BMP388 I2C connection [OK] [ INFO] [1605290386.797108764]: [cf1] ESTIMATOR: Using Complementary (1) estimator [ INFO] [1605290386.799377230]: [cf1] CONTROLLER: Using PID (1) controller [ INFO] [1605290386.803022758]: [cf1] MTR-DRV: Using brushed motor dEEPROM: I2C connection [OK]. [ INFO] [1605290386.805177575]: [cf1] IMU: BMI088 gyro self-test [OK] [ INFO] [1605290386.807404536]: [cf1] STAB: Wait for sensor calibration... [ INFO] [1605290386.808746265]: [cf1] SYS: Free heap: 13216 bytes [ INFO] [1605290386.809909333]: [cf1] STAB: Ready to fly. [ INFO] [1605290386.810650375]: [cf1] Requesting parameters... [ INFO] [1605290386.831014107]: Found variables in cache. [ WARN] [1605290387.032906070]: [cf1] Link Quality low (0.680000) [ WARN] [1605290387.117544339]: [cf1] Link Quality low (0.330000) [ WARN] [1605290387.204665980]: [cf1] Link Quality low (0.170000) [ WARN] [1605290387.291808531]: [cf1] Link Quality low (0.140000) [ INFO] [1605290387.394887943]: [cf1] reqParamTOC: 0.620640 s (201 params) [ INFO] [1605290387.394914133]: Requesting memories... [ INFO] [1605290387.410716625]: Memories: 9 [ INFO] [1605290387.455907274]: [cf1] Ready. Elapsed: 0.681630 s [ INFO] [1605290387.455983607]: CF run: 0.681770 s update commander/enHighLevel to 1 update kalman/resetEstimation to 1 update locSrv/extPosStdDev to 0.001 update locSrv/extQuatStdDev to 0.05 update ring/effect to 16 update ring/headlightEnable to 0 update ring/solidBlue to 255 update ring/solidGreen to 0 update ring/solidRed to 0 update stabilizer/controller to 2 update stabilizer/estimator to 2 update ctrlMel/i_range_m_z to 1500 update ctrlMel/i_range_xy to 2 update ctrlMel/i_range_z to 0.4 update ctrlMel/kR_xy to 70000 update ctrlMel/kR_z to 60000 update ctrlMel/kd_omega_rp to 200 update ctrlMel/kd_xy to 0.2 update ctrlMel/kd_z to 0.4 update ctrlMel/ki_m_z to 500 update ctrlMel/ki_xy to 0.05 update ctrlMel/ki_z to 0.05 update ctrlMel/kp_xy to 0.4 update ctrlMel/kp_z to 1.25 update ctrlMel/kw_xy to 20000 update ctrlMel/kw_z to 12000 update ctrlMel/mass to 0.032 update ctrlMel/massThrust to 132000 [ INFO] [1605290387.478725571]: [cf1] Update parameters [ WARN] [1605290387.500919177]: [cf1] Link Quality low (0.230000) [ INFO] [1605290387.509614304]: [cf1] , resetting [ WARN] [1605290387.588336129]: [cf1] Link Quality low (0.380000) [ INFO] [1605290387.613173172]: Update params: 0.157125 s [ INFO] [1605290387.613378673]: Started 1 threads crazyswarm_server: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:109: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 16>::plain_array() [with T = float; int Size = 4; int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast(eigen_unaligned_array_assert_workaround_gcc47(array)) & (15)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " READ THIS WEB PAGE !!! "' failed. [crazyswarm_server-2] process has died [pid 24512, exit code -6, cmd /home/ottelab/crazyswarm/ros_ws/devel/lib/crazyswarm/crazyswarm_server __name:=crazyswarm_server __log:=/home/ottelab/.ros/log/03bada0c-25da-11eb-8272-9cefd5fcd5b4/crazyswarm_server-2.log]. log file: /home/ottelab/.ros/log/03bada0c-25da-11eb-8272-9cefd5fcd5b4/crazyswarm_server-2*.log

Actually, one time, I could run without any errors and when I hit the start button in joystick, it did takeoff. But I'm not able to do that again. I end up with above output. I do kill the crazyswarn_server and all other nodes before every run.

My crazyflies.yaml is as follows crazyflies:

allCrazyflies.yaml is as follows: crazyflies:

hower_swarm.launch is as follows: Screenshot from 2020-11-13 13-09-53

My crazyflie name in vicon is cf1 and tracking is enabled in vicon. Because I'm using 'motionCapture', I believe I need not set the markers position or anything in this mode. Please let me know why I'm facing the Eigen Assertion error mentioned above. As I was able to fly once and I can see cf1 parameters being loaded, I'm assuming the communication between vicon and my ROS system is established.

whoenig commented 3 years ago
  1. I don't think you have to worry about that if the compilation works. You can always switch to the latest firmware version, too (git checkout master, git pull in the crazyflie-firmware folder).

  2. I have not seen that before. Which OS version and compiler are you using? From the link in the error message it sounds like an incorrect usage of Eigen somewhere in the code.

jpreiss commented 3 years ago

I had this submodule error too under Crazyswarm, but I couldn't reproduce it in a standalone clone of bitcraze/crazyflie-firmware. I don't know what is going on.

manikamakam commented 3 years ago

@whoenig I am using Ubuntu 16.04 with ROS kinetic. I am getting the eigen value error sometimes, but not always. Now, the crazyflie takes off but doesn't hover, instead it's just crashing. What can be the possible issues for this behaviour?

Also, you mentioned previously, that I can navigate using waypoints. Can you please let me know how to do that? It would help even if you can point me towards an existing tutorial for this. Thanks a lot for the help!

whoenig commented 3 years ago

Crashes are mostly related to tracking issues. Make sure all firmwares (radio + NRF + STM) were updated. Make sure the coordinate system is correct by moving the drone manually and looking and the stateEstimate.x/y/z logging variables.

Perhaps https://drive.google.com/file/d/15favAyrLLpC_O6nrAp-eIbZijFUMLgwV/view helps? There is an example on slide 9 for a simple script. The function you are looking for is called goTo.

manikamakam commented 3 years ago

Thank you that helps! I'm trying to do it first in simulation but I have two errors.

If I do cd ros_ws/src/crazyswarm/scripts/pycrazyswarm/cfsim make I get the following error: swig -python -I../../../../../../crazyflie-firmware/src/modules/interface cffirmware.i setup.py build_ext --inplace make: setup.py: Command not found Makefile:6: recipe for target 'swig' failed make: *** [swig] Error 127 And if I do cd ros_ws/src/crazyswarm/scripts python figure8_csv.py --sim I get following error: Traceback (most recent call last): File "figure8_csv.py", line 9, in <module> swarm = Crazyswarm() File "/home/ottelab/crazyswarm/ros_ws/src/crazyswarm/scripts/pycrazyswarm/crazyswarm.py", line 39, in __init__ from .crazyflieSim import TimeHelper, CrazyflieServer File "/home/ottelab/crazyswarm/ros_ws/src/crazyswarm/scripts/pycrazyswarm/crazyflieSim.py", line 7, in <module> from .cfsim import cffirmware as firm File "/home/ottelab/crazyswarm/ros_ws/src/crazyswarm/scripts/pycrazyswarm/cfsim/cffirmware.py", line 28, in <module> _cffirmware = swig_import_helper() File "/home/ottelab/crazyswarm/ros_ws/src/crazyswarm/scripts/pycrazyswarm/cfsim/cffirmware.py", line 20, in swig_import_helper import _cffirmware ImportError: No module named _cffirmware I refrred to https://github.com/USC-ACTLab/crazyswarm/issues/47 and https://github.com/USC-ACTLab/crazyswarm/issues/95 but nothing worked. There is no crazyswarm-next branch in crazyflie-firmware.

jpreiss commented 3 years ago

We have now added mixed python 2/3 support so you must specify the environment variable: CSW_PYTHON=python2 make

manikamakam commented 3 years ago

Thanks for he help!

I observe the crazyflie crashing with both motionCapture and libobjecttracker modes. With motioncapture, after the crazyflie takes off, I get a warning saying that "No pose updated" and with libobjecttracker, it says "ICP did not converge" and "[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters."

I have seen in one of the forums that "libobjecttrcaker" is preferred. If so, can you address the error mentioned above. If not, can you give some suggestions on how to fix the motioncapture error?

I have ensured that NRF+STM+radio are all updated. The coordinate system matches with the VICON. And I also updated the marker positions in crazyflieTypes.yaml for libobjecttracker mode. Tracking is enabled for motioncapture and disabled for libobjecttracker.

MauroPfister commented 3 years ago

I had this submodule error too under Crazyswarm, but I couldn't reproduce it in a standalone clone of bitcraze/crazyflie-firmware. I don't know what is going on.

TL;DR Update your Git version (using Git PPA) if you are on Ubuntu 16.04.

We could reproduce the same problem on Ubuntu 16.04 but not on Ubuntu 18.04. Turns out that it is an issue related to the Git version. Ubuntu 16.04 ships with Git 2.7 while Ubuntu 18.04 has Git 2.17. As far as I understand the behavior of git submodule update --depth slightly changed after Git 2.8 making it possible to fetch a commit that previous to Git 2.8 could not be accessed (see https://stackoverflow.com/a/17692710). After updating the Git version to the newest one available from the Git PPA, everything is working as expected.

@jpreiss If you can confirm this it might be worth adding a note to the documentation or pinning an issue so people find it easily. Also, sorry for being slightly off-topic here.

whoenig commented 3 years ago

@MauroPfister Thanks for the fix! Yes, adding that to the documentation might help many other people who are using the Crazyswarm on 16.04.

@manikamakam The errors you mention indicate that the tracking didn't work. Usually the key question is if the tracking issues occur before or after the crash. One thing to note is that if you operate right at the limit of your mocap (e.g., markers too small, cameras far away etc.) tracking can be very difficult. The best solution in that case is to use single-marker-mode (with libobjecttracker) and put a single, larger marker on top. Make sure that whatever marker you use, that the marker appears at least as 3 pixels on each relevant motion capture camera. Also can you confirm that you verified the tracking and communication by logging stateEstimate.x/y/z?

ZimingR commented 3 years ago

Dear @whoenig,

I am trying to run a python script to control 4 crazyflies. When I `roslaunch crazyflie_demo a_multi_position1119.launch‘, I encountered the same problem: ’Exception thrown while processing service call: timeout Service call failed: service [/add_crazyflie] responded with an error: timeout‘ In fact, I can connect to crazyflies through cfclient. When I try to run this script on collegue's system, it succeeded. Any suggestions to solve this issue would be greatly appreciated. Thank you very much!

whoenig commented 3 years ago

@ZimingR Please open a new discussion topic for your problem. When you do, make sure you include your crazyflies.yaml, as well as the URI (rate, address, channel) of your Crazyflies.

ZimingR commented 3 years ago

Thanks a lot!

hit-JB commented 2 years ago

@ZimingR Have you solved the problem that the service throws exception "time out" when launch the razyflie_demo multi_teleop_xbox360.launch file

ZimingR commented 2 years ago

Sorry, not yet.

hit-JB @.***>于2021年12月6日 周一下午8:48写道:

@ZimingR https://github.com/ZimingR Have you solved the problem that the service throws exception "time out" when launch the razyflie_demo multi_teleop_xbox360.launch file

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/USC-ACTLab/crazyswarm/issues/272#issuecomment-986744506, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVFE3U4DYHUOVXRMAXRFQ4LUPSWKHANCNFSM4TOVXTPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.