clydemcqueen / tello_ros

C++ ROS2 driver for DJI Tello drones
BSD 3-Clause "New" or "Revised" License
193 stars 65 forks source link

tello_ros gazebo errors #45

Closed AleBurzio closed 4 years ago

AleBurzio commented 4 years ago

I am running ros2 Dashing and I get this error whenever I try to simulate the drone in gazebo. I am able to control the actual tello drone through teleop, this problem arises only when i run the gazebo simulation. I followed every step in the readme file but there is always the possibility I might have missed something

alessandro@alessandro-K501UX:~/projects/ros_tello$ ros2 launch tello_gazebo simple_launch.py
[INFO] [launch]: All log files can be found below /home/alessandro/.ros/log/2019-12-09-18-44-13-280853-alessandro-K501UX-10266
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [gazebo-1]: process started with pid [10276]
[INFO] [inject_entity.py-2]: process started with pid [10277]
[ERROR] [inject_entity.py-2]: process has died [pid 10277, exit code 1, cmd '/home/alessandro/projects/ros_tello/install/tello_gazebo/lib/tello_gazebo/inject_entity.py /home/alessandro/projects/ros_tello/install/tello_description/share/tello_description/urdf/tello_1.urdf 0 0 1 0'].
[INFO] [robot_state_publisher-3]: process started with pid [10278]
[INFO] [joy_node-4]: process started with pid [10279]
[INFO] [tello_joy-5]: process started with pid [10280]
[ERROR] [launch]: Caught exception in launch (see debug for traceback): I/O operation on closed file
[INFO] [tello_joy-5]: sending signal 'SIGINT' to process[tello_joy-5]
[INFO] [joy_node-4]: sending signal 'SIGINT' to process[joy_node-4]
[INFO] [robot_state_publisher-3]: sending signal 'SIGINT' to process[robot_state_publisher-3]
[INFO] [gazebo-1]: sending signal 'SIGINT' to process[gazebo-1]
[robot_state_publisher-3] Initialize urdf model from file: /home/alessandro/projects/ros_tello/install/tello_description/share/tello_description/urdf/tello_1.urdf
[robot_state_publisher-3] Parsing robot urdf xml string.
[robot_state_publisher-3] The root link base_link_1 has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[robot_state_publisher-3] Link camera_link_1 had 0 children
[robot_state_publisher-3] got segment base_link_1
[robot_state_publisher-3] got segment camera_link_1
[robot_state_publisher-3] Adding fixed segment from base_link_1 to camera_link_1
[gazebo-1] Gazebo multi-robot simulator, version 9.0.0
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1]
[gazebo-1] Gazebo multi-robot simulator, version 9.0.0
[gazebo-1] Copyright (C) 2012 Open Source Robotics Foundation.
[gazebo-1] Released under the Apache 2 License.
[gazebo-1] http://gazebosim.org
[gazebo-1]
[tello_joy-5] [INFO] [rclcpp]: signal_handler(signal_value=2)
[INFO] [tello_joy-5]: process has finished cleanly [pid 10280]
[robot_state_publisher-3] [INFO] [rclcpp]: signal_handler(signal_value=2)
[INFO] [robot_state_publisher-3]: process has finished cleanly [pid 10278]
[joy_node-4] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[joy_node-4]   what():  Failed to create interrupt guard condition in Executor constructor: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at /tmp/binarydeb/ros-dashing-rcl-0.7.7/src/rcl/guard_condition.c:69
[gazebo-1] [Msg] Waiting for master.
[gazebo-1] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gazebo-1] [Msg] Publicized address: 192.168.1.37
[ERROR] [joy_node-4]: process has died [pid 10279, exit code -6, cmd '/opt/ros/dashing/lib/joy/joy_node __ns:=/drone1'].
[INFO] [gazebo-1]: process has finished cleanly [pid 10276]
[gazebo-1]
[gazebo-1]
alessandro@alessandro-K501UX:

I will provide any further information if needed

clydemcqueen commented 4 years ago

Sorry, I left the "dashing" branch in a poor state. I just pushed several fixes. Please try again.

AleBurzio commented 4 years ago

It still did not work, but I've got a few different errors this time:

robot_state_publisher-3] Initialize urdf model from file: /home/alessandro/projects/tello_ros/install/tello_description/share/tello_description/urdf/tello_1.urdf
[robot_state_publisher-3] Parsing robot urdf xml string.
[robot_state_publisher-3] The root link base_link_1 has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF

These lines have me particularly suspicious because when i do colcon build I get an stderr message from the tello_description package

Furthermore, I had to change the names of two files in the install/tello_driver/lib/tello_driver folder: tello_joy_main -> tello_joy tello_driver_main -> tello_driver

because I was getting the following error message:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable 'tello_joy' not found on the libexec directory '/home/alessandro/projects/tello_ros/install/tello_driver/lib/tello_driver'

and a similar one for the tello_driver executable

Lastly, I get this error again:

[INFO] [inject_entity.py-2]: process started with pid [11478]
[ERROR] [inject_entity.py-2]: process has died [pid 11478, exit code 1, cmd '/home/alessandro/projects/tello_ros/install/tello_gazebo/lib/tello_gazebo/inject_entity.py /home/alessandro/projects/tello_ros/install/tello_description/share/tello_description/urdf/tello_1.urdf 0 0 1 0'].

just like before, however this time the gazebo app opens with an empty map

clydemcqueen commented 4 years ago

Again, I apologize... and thank you for continuing to debug this.

Are you on the 'dashing' branch or the 'master' branch? Master includes a number of changes related to IPC that weren't fully tested. The 2 branches that should be stable are 'dashing' and 'eloquent'. I will merge eloquent into master to avoid confusion.

The stderr output from tello_description can be ignored. But it's poor practice for the build process to generate output on stderr, so I'll open an issue to fix this.

clydemcqueen commented 4 years ago

I just merged the eloquent branch into master, so master is now officially on Eloquent. The documentation has been updated to reflect this. Please git checkout dashing to test on Dashing.

AleBurzio commented 4 years ago

Ok, that seems to have solved the issue! On top of that, to solve this problem

INFO] [inject_entity.py-2]: process started with pid [11478]
[ERROR] [inject_entity.py-2]: process has died [pid 11478, exit code 1, cmd '/home/alessandro/projects/tello_ros/install/tello_gazebo/lib/tello_gazebo/inject_entity.py /home/alessandro/projects/tello_ros/install/tello_description/share/tello_description/urdf/tello_1.urdf 0 0 1 0'].

I had to change in the inject_entity.py file the python environment to python3 in the first line as it seems my system was using python 2 as the default python installation

Thank you very much!

AleBurzio commented 4 years ago

my bad

PS: I would like to write a small script for the drone to fly in a predefined pattern (eg takeoff, move right 10 m, move forward 10 m, then land), what should I be looking into to do something like this?