Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROSified all drone exercises #334

Merged
merged 22 commits into from Sep 17, 2019
Merged

ROSified all drone exercises #334

merged 22 commits into from Sep 17, 2019

Conversation

nkhedekar
Copy link
Contributor

@nkhedekar nkhedekar commented Aug 17, 2019

This pull request contains rosified versions of all exercises pertaining to drones. This close #328, closes #329, closed #330, fix #331, fixes #332, fixed #333, resolve #316, resolves #317 and in general, gives everyone an idea of some of the keywords one can use to auto close issues.

Disclaimer: This contains work completed as a part of my GSoC project.

@cawadall
Copy link
Contributor

Hi @nkhedekar,

First of all, Great Work! This is a great step towards a fully-ROS-based platform involving very hard work. I've been checking the functioning from the begining, includong the installation steps, and I have faced some problems and also wanted to make some minor suggestions:


SUGGESTIONS

  • Regarding the installation recipe placed on REAMDE.md files for each exercise, I found a typo in the name of one of the packages to be installed

sudo apt-get install ros-kinetic-dronewrapper ros-kinetic-rqt-drone-teleop ros-kinetic-jderobot-assets
should be
sudo apt-get install ros-kinetic-drone-wrapper ros-kinetic-rqt-drone-teleop ros-kinetic-jderobot-assets

  • Also, the catkin build command is part of the catkin_tools package, that is not installed by default when installing Catkin source packages. On apt-get the package is called python-catkin-tools, and maybe it should be included in the installation script or anywhere else to avoid problems during the process.

  • I checked the 'jderobot_assets' package after installing ros-kinetic-jderobot-assets and I found out that 'iris_drone_hangar.world' file is missing.

  • In the README file of position_control exercise, the launch file specified is not the correct one
    roslaunch visual_lander.launch
    must be:
    roslaunch position_control.launch


ERRORS

  • When trying to launch any exercise, I always get something similar to the following:
    unused args [world] for include of [/opt/ros/kinetic/share/drone_wrapper/launch/mavros_px4_sitl.launch]
    Some args seem to be unused and the launch process crashes.

  • By removing the unused args, I get Gazebo to work, this time showing another error:
    ERROR: cannot launch node of type [drone_wrapper/play_python_code]: can't locate node [play_python_code] in package [drone_wrapper]
    And the world showed doesn't include anything but the ground.

I'll continue trying to get it to work. Meanwhile, I've asked some other reviewers to take a look on it.
Do you have any idea on why am I having those problems?

@nkhedekar
Copy link
Contributor Author

Hi @cawadall ,

Thank you so much for your review and suggestions!

As per your suggestions, I have corrected the typo in the installation line, added catkin tools in the installation script and corrected the launch file name in the position control readme.

The reason for the hangar world missing is that the currently distributed version of jderobot_assets is an older version. The new version has been released into the build farm and should be synced soon. The status for the same can be seen here. The errors you mention is also due to the same reason of the new version not being synced yet.

@cawadall
Copy link
Contributor

Nice @nkhedekar !
Thanks for the quick response. Since you have already solved the minor suggestions, as soon as the new version gets synced I will try it again and then merge it.

@nkhedekar
Copy link
Contributor Author

Excellent, thank you @cawadall !

@cawadall
Copy link
Contributor

cawadall commented Aug 30, 2019

Hello again @nkhedekar ,

jderobot_assets was finally synced and this time I succesfully tried your patch. However, I have some more comments:

  • In README file of drone_cat_mouse exercise, there is an error:
    roslaunch drone_cat_and_mouse.launch should be roslaunch drone_cat_mouse.launch
  • One of the launch files uses xmlstarlet to manage some XML tools, that may not be installed in client's system. It maybe should be included as a requirement (sudo apt install xmlstarlet)
  • Finally, I'm not able to find models associated with iris_postion_control.world in the jderobot_assetspackage (ground_plane and construction_cone), so I'm not seeing anything but the default ground and the drone when I launch this exercise. Could it be that they are missing to be included in the package?

@diegomrt
Copy link
Contributor

Hi @nkhedekar. First, Iet me join @cawadall and congratulate you again on your great contribution during the GSoC'19 project. This migration would be really valuable for our Robotics Academy.

I've also being testing your patch and I've found what seems a new bug in the README.md file of many of the exercises. You have now duplicated the command to install the drone-wrapper and removed the one to install jderobot-assets. Now it says:

sudo apt-get install ros-kinetic-drone-wrapper ros-kinetic-rqt-drone-teleop ros-kinetic-drone-wrapper

And it should be:

sudo apt-get install ros-kinetic-drone-wrapper ros-kinetic-rqt-drone-teleop ros-kinetic-jderobot-assets

@diegomrt
Copy link
Contributor

Hi again @nkhedekar.

Please have also a look at this, extracted from executing one of the new exercises (follow_road). After an installation from scratch, it seems that there are missing dependencies of your rqt_drone_teleop plugin with the QFlightInstruments (qfi) widgets.

It seems that if qfi widgets are not installed, the plugin cannot be loaded:

PluginManager._load_plugin() could not load plugin "rqt_drone_teleop/DroneTeleop":
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/plugin_handler.py", line 99, in load
    self._load()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/plugin_handler_direct.py", line 54, in _load
    self._plugin = self._plugin_provider.load(self._instance_id.plugin_id, self._context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui_py/ros_py_plugin_provider.py", line 60, in load
    return super(RosPyPluginProvider, self).load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/ros_plugin_provider.py", line 86, in load
    raise e
ImportError: No module named qfi

Should qfi widgets be included in the installation recipe?

@nkhedekar
Copy link
Contributor Author

Hello again @nkhedekar ,

jderobot_assets was finally synced and this time I succesfully tried your patch. However, I have some more comments:

* In README file of drone_cat_mouse exercise, there is an error:
  `roslaunch drone_cat_and_mouse.launch` should be `roslaunch drone_cat_mouse.launch`

* One of the launch files uses `xmlstarlet` to manage some XML tools, that may not be installed in client's system. It maybe should be included as a requirement (sudo apt install xmlstarlet)

Hi @cawadall , thank you for finding these. I have corrected them

* Finally, I'm not able to find models associated with iris_postion_control.world in the `jderobot_assets`package (ground_plane and construction_cone), so I'm not seeing anything but the default ground and the drone when I launch this exercise. Could it be that they are missing to be included in the package?

As these models are already available through the official repository of gazebo models gazebo downloads them by default if they are not found in its paths and stores them in ~/.gazebo/models/ . Can you please check again with a dummy world with just these two models (and of course while being connected to the internet)?

@nkhedekar
Copy link
Contributor Author

Hi @nkhedekar. First, Iet me join @cawadall and congratulate you again on your great contribution during the GSoC'19 project. This migration would be really valuable for our Robotics Academy.

I've also being testing your patch and I've found what seems a new bug in the README.md file of many of the exercises. You have now duplicated the command to install the drone-wrapper and removed the one to install jderobot-assets. Now it says:

sudo apt-get install ros-kinetic-drone-wrapper ros-kinetic-rqt-drone-teleop ros-kinetic-drone-wrapper

And it should be:

sudo apt-get install ros-kinetic-drone-wrapper ros-kinetic-rqt-drone-teleop ros-kinetic-jderobot-assets

Thank you @diegomrt ! 😄

I have corrected this bug in the latest commit.

Hi again @nkhedekar.

Please have also a look at this, extracted from executing one of the new exercises (follow_road). After an installation from scratch, it seems that there are missing dependencies of your rqt_drone_teleop plugin with the QFlightInstruments (qfi) widgets.

It seems that if qfi widgets are not installed, the plugin cannot be loaded:

PluginManager._load_plugin() could not load plugin "rqt_drone_teleop/DroneTeleop":
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/plugin_handler.py", line 99, in load
    self._load()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/plugin_handler_direct.py", line 54, in _load
    self._plugin = self._plugin_provider.load(self._instance_id.plugin_id, self._context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui_py/ros_py_plugin_provider.py", line 60, in load
    return super(RosPyPluginProvider, self).load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/composite_plugin_provider.py", line 71, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/ros_plugin_provider.py", line 86, in load
    raise e
ImportError: No module named qfi

Should qfi widgets be included in the installation recipe?

I have added the installation in the bash script in the drones repository.

@fqez
Copy link
Member

fqez commented Aug 31, 2019

Hi @nkhedekar

I want to join also @cawadall and @diegomrt and congrats you for the job done, really impressive!
I managed to get it working properly doing some tricks. Whenever I sourced the catkin_ws from the drone repository script (from here ) Gazebo stopped working because it kept losing the path to its resouces (GAZEBO_RESOURCE_PATH) as it was being overwritten by the drone script. I solved that this way:

export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH}:/usr/share/gazebo-7

Also, as @cawadall mentioned, the drone cat and mouse exercise needed the xmlstarlet installed in order to make it work.

One more thing I had to do is to source the iris models to make gazebo find them. For that, just type:

export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/opt/ros/kinetic/share/jderobot_assets/models

Lastly, the geographiclib dataset was not automatically installed which I assumed it was going to be. So I had to launch the script manually to make it work.

With all that done, I got all the exercises working well, and I even teleoperated the drones, nicely done :)

@cawadall
Copy link
Contributor

cawadall commented Sep 1, 2019

As these models are already available through the official repository of gazebo models gazebo downloads them by default if they are not found in its paths and stores them in ~/.gazebo/models/ . Can you please check again with a dummy world with just these two models (and of course while being connected to the internet)?

Now I finally got it all working! It was my fault due to an older Gazebo version pointing the GAZEBO_MODEL_DATABASE_URI environment variable to a deprecated URL. Since you have already corrected the bugs and heeded to the suggestions made by our colleagues (@diegomrt , @fqez), let's wait for their final double-check before merging it.

Great Work!

@nkhedekar
Copy link
Contributor Author

Hi @fqez Thank you so much!

I managed to get it working properly doing some tricks. Whenever I sourced the catkin_ws from the drone repository script (from here ) Gazebo stopped working because it kept losing the path to its resouces (GAZEBO_RESOURCE_PATH) as it was being overwritten by the drone script. I solved that this way:

export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH}:/usr/share/gazebo-7

Can you please share the contents of your .bashrc file as the script is only run in the beginning for the installation and it adds a simple source command in the bashrc. The sourcing of the workspace should append the path instead of overwriting it.

Also, as @cawadall mentioned, the drone cat and mouse exercise needed the xmlstarlet installed in order to make it work.

Yep, I have added this in the next commit.

One more thing I had to do is to source the iris models to make gazebo find them. For that, just type:

export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/opt/ros/kinetic/share/jderobot_assets/models

This should not be required if the jderobot_assets package has been installed using the command sudo apt-get install ros-kinetic-jderobot-assets

Lastly, the geographiclib dataset was not automatically installed which I assumed it was going to be. So I had to launch the script manually to make it work.

This is actually the first line in the script 😅 . Can you please share your terminal output too so that I can help debug the issue?

@nkhedekar
Copy link
Contributor Author

As these models are already available through the official repository of gazebo models gazebo downloads them by default if they are not found in its paths and stores them in ~/.gazebo/models/ . Can you please check again with a dummy world with just these two models (and of course while being connected to the internet)?

Now I finally got it all working! It was my fault due to an older Gazebo version pointing the GAZEBO_MODEL_DATABASE_URI environment variable to a deprecated URL. Since you have already corrected the bugs and heeded to the suggestions made by our colleagues (@diegomrt , @fqez), let's wait for their final double-check before merging it.

Great Work!

Excellent! Thank you so much @cawadall !

@fqez
Copy link
Member

fqez commented Sep 5, 2019

Hi everyone!

for me this can be already merged, since those little details are almost solved. We can improve the installation and the setup in next iterations.

Good job!

@diegomrt
Copy link
Contributor

Hi all,

I just did again a fresh installation, and I can confirm that without adding the following lines mentioned by @fqez to the .bashrc file, Gazebo freezes or hangs at launching the exercises:

export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH}:/usr/share/gazebo-7
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/opt/ros/kinetic/share/jderobot_assets/models

I think we should solve this before merging.

@cawadall
Copy link
Contributor

As soon as @nkhedekar solves the problem shown in the previous comment this will be finally merged. Almost there!

@nkhedekar
Copy link
Contributor Author

Hi all,

I just did again a fresh installation, and I can confirm that without adding the following lines mentioned by @fqez to the .bashrc file, Gazebo freezes or hangs at launching the exercises:

export GAZEBO_RESOURCE_PATH=${GAZEBO_RESOURCE_PATH}:/usr/share/gazebo-7
export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/opt/ros/kinetic/share/jderobot_assets/models

I think we should solve this before merging.

Thanks @diegomrt

I can confirm this issue and have updated the installation script with the solution you have provided.

@cawadall
Copy link
Contributor

Checked and working. Merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants