Closed santiagorg2401 closed 3 years ago
For your first problem, make sure you source your ROS workspace (source ~/crazyswarm/ros_ws/source/devel.sh
) in every terminal that you use. For your second problem, there seems to be an issue with the formatting of your configuration files (either hover_swarm.launch
or crazyflies.yaml
) -- please post/attach the files here.
crazyflies.yaml crazyflies:
-hover_swarm.launch
<?xml version="1.0"?>
Please use "insert code" in the toolbar, or upload the files somewhere and share the link. The configuration is whitespace sensitive, so I can't tell if there is an issue from your previous comment.
The only thing I spot is the initialPosition in crazyflies.yaml
. I remember there being a parsing bug in ROS that requires this to be a floating point number, i.e., [0.0, 0.0, 0.0]
rather than [0, 0, 0.0]
.
Terminal 1.
santiagorg2401@santiagorg2401-G7-7588:~$ source crazyflie/crazyswarm/ros_ws/devel/setup.bash santiagorg2401@santiagorg2401-G7-7588:~$ python crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/chooser.py timeout Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__ return self.func(*args) File "crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/chooser.py", line 213, in checkBattery voltage = subprocess.check_output(["rosrun crazyflie_tools battery --uri " + uri], shell=True) File "/usr/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['rosrun crazyflie_tools battery --uri radio://0/80/2M/E7E7E7E706']' returned non-zero exit status 1 6 timeout timeout Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in __call__ return self.func(*args) File "crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/chooser.py", line 213, in checkBattery voltage = subprocess.check_output(["rosrun crazyflie_tools battery --uri " + uri], shell=True) File "/usr/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['rosrun crazyflie_tools battery --uri radio://0/80/2M/E7E7E7E706']' returned non-zero exit status 1 Flash STM32 FW to radio://0/80/2M/E7E7E7E706 timeout santiagorg2401@santiagorg2401-G7-7588:~$ python crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/chooser.py
Terminal 2.
`santiagorg2401@santiagorg2401-G7-7588:~$ source crazyflie/crazyswarm/ros_ws/devel/setup.bash
santiagorg2401@santiagorg2401-G7-7588:~$ roslaunch crazyswarm hover_swarm.launch
... logging to /home/santiagorg2401/.ros/log/3456f9ce-cdbb-11ea-ab55-181deab367da/roslaunch-santiagorg2401-G7-7588-5535.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://santiagorg2401-G7-7588:46631/
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 [5547] ROS_MASTER_URI=http://localhost:11311
setting /run_id to 3456f9ce-cdbb-11ea-ab55-181deab367da
process[rosout-1]: started with pid [5558]
started core service [/rosout]
process[crazyswarm_server-2]: started with pid [5565]
ERROR: cannot launch node of type [joy/joy_node]: joy
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/santiagorg2401/crazyflie/crazyswarm/ros_ws/src
ROS path [2]=/opt/ros/melodic/share
process[crazyswarm_teleop-4]: started with pid [5566]
process[rviz-5]: started with pid [5568]
[ INFO] [1595601452.053808269]: Wait for services...
[ INFO] [1595601452.055580089]: waitForService: Service [/emergency] has not been advertised, waiting...
[ INFO] [1595601452.206348997]: waitForService: Service [/emergency] is now available.
[ INFO] [1595601452.221361957]: Manager ready.
ch: 1
[ INFO] [1595601452.235945328]: Adding CF: cf6 (radio://0/80/2M/E7E7E7E706, cf6)...
terminate called after throwing an instance of 'std::runtime_error'
what(): timeout
[crazyswarm_server-2] process has died [pid 5565, exit code -6, cmd /home/santiagorg2401/crazyflie/crazyswarm/ros_ws/devel/lib/crazyswarm/crazyswarm_server name:=crazyswarm_server __log:=/home/santiagorg2401/.ros/log/3456f9ce-cdbb-11ea-ab55-181deab367da/crazyswarm_server-2.log].
log file: /home/santiagorg2401/.ros/log/3456f9ce-cdbb-11ea-ab55-181deab367da/crazyswarm_server-2*.log
Terminal 3
santiagorg2401@santiagorg2401-G7-7588:~$ source crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/niceHover.py
import-im6.q16: not authorized np' @ error/constitute.c/WriteImage/1037. from: can't read /var/mail/pycrazyswarm Z: orden no encontrada bash: crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/niceHover.py: línea 9: error sintáctico cerca del elemento inesperado
('
bash: crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/niceHover.py: línea 9: ` swarm = Crazyswarm()'
santiagorg2401@santiagorg2401-G7-7588:~$ source crazyflie/crazyswarm/ros_ws/devel/setup.bash
santiagorg2401@santiagorg2401-G7-7588:~$ python crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/niceHover.py
Traceback (most recent call last):
File "crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/niceHover.py", line 9, in
radio://0/80/2M/E7E7E7E706
and that you can connect to that CF with other means, such as the cfclient
.I will try again when being in the lab and I will post the results. My brother is covid-19 suspect, so I have to wait for his results. Thank you for answering Mr. Whönig
Hi, I re-installed all the packages, and this is what happens: Checking the address witch cfclient:
Update: The battery button is still not working but I could make them fly, but there are 2 problems, sometimes Rviz does not connect to the Crazyflie and it takes several tries until it connects, and many times when the Crazyflie starts flying, it just goes anywhere out the trajectory and crashes
stateEstimate.x
, stateEstimate.y
, stateEstimate.z
, run hover_swarm.launch
(but do not attempt to fly), and move the Crazyflie manually in the space. If you use rosecho /cf8/log1
, you should see the correct coordinates. Also keep in mind that there seem to be problems with the state estimator, see this issue.Also, I hope both you and your brother are fine and Covid-free!
Hi, For the firmware updating I am using the cfclient GUI app, is that ok? For the estimators, do I have to type them on the Python code in crazyswarm/ros_ws/src/crazyswarm/scripts ? I will attach a screenshot (of the Rviz issue) when being in the laboratory. Thank you for your hopes, and yes, we are covid free.
Hi, I followed the steps in https://crazyswarm.readthedocs.io/en/latest/usage.html, but I have a problem, by the moment I am using Flow Deck but the goal is to use LPS, so after tagging the Crazyflies with 1,2,3,4,..., A, B, and writing them in allCrazyflies.yaml crazyflies:1 ... crazyflies : 10 ... and so on The GUI chooser.py shows me this error when clicking any button: [rospack] Error: package 'crazyflie_tools' not found Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1550, in call return self.func(*args) File "chooser.py", line 213, in checkBattery voltage = subprocess.check_output(["rosrun crazyflie_tools battery --uri " + uri], shell=True) File "/usr/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['rosrun crazyflie_tools battery --uri radio://0/80/2M/E7E7E7E708']' returned non-zero exit status 2
Then, when I try to fly the drone with (for example) niceHover.py, first I run the crayswarm server auto-starting new master process[master]: started with pid [9403] ROS_MASTER_URI=http://localhost:11311
setting /run_id to d6b7ebd0-c611-11ea-bc79-181deab367da process[rosout-1]: started with pid [9414] started core service [/rosout] process[crazyswarm_server-2]: started with pid [9421] ERROR: cannot launch node of type [joy/joy_node]: joy ROS path [0]=/opt/ros/melodic/share/ros ROS path [1]=/home/santiagorg2401/crazyflie/crazyswarm/ros_ws/src ROS path [2]=/opt/ros/melodic/share process[crazyswarm_teleop-4]: started with pid [9422] process[rviz-5]: started with pid [9423] [ INFO] [1594759051.849131804]: Wait for services... [ INFO] [1594759051.851109082]: waitForService: Service [/emergency] has not been advertised, waiting... [ INFO] [1594759051.918606844]: waitForService: Service [/emergency] is now available. ch: 1 [ INFO] [1594759051.932975640]: Manager ready. terminate called after throwing an instance of 'XmlRpc::XmlRpcException' [crazyswarm_server-2] process has died [pid 9421, exit code -6, cmd /home/santiagorg2401/crazyflie/crazyswarm/ros_ws/devel/lib/crazyswarm/crazyswarm_server __name:=crazyswarm_server __log:=/home/santiagorg2401/.ros/log/d6b7ebd0-c611-11ea-bc79-181deab367da/crazyswarm_server-2.log]. log file: /home/santiagorg2401/.ros/log/d6b7ebd0-c611-11ea-bc79-181deab367da/crazyswarm_server-2*.log
And finally in another terminal window, the niceHover.py Traceback (most recent call last): File "niceHover.py", line 9, in
swarm = Crazyswarm()
File "/home/santiagorg2401/crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/pycrazyswarm/crazyswarm.py", line 43, in init
import crazyflie
File "/home/santiagorg2401/crazyflie/crazyswarm/ros_ws/src/crazyswarm/scripts/pycrazyswarm/crazyflie.py", line 12, in
from crazyflie_driver.srv import *
ImportError: No module named crazyflie_driver.srv
I do not really know why is those errors happening, please let me know if I am forgetting to do/execute something or if you have any idea to help. Thank you all, have a nice day