szebedy / autonomous-drone

This repository intends to enable autonomous drone delivery with the Intel Aero RTF drone and PX4 autopilot. The code can be executed both on the real drone or simulated on a PC using Gazebo. Its core is a robot operating system (ROS) node, which communicates with the PX4 autopilot through mavros. It uses SVO 2.0 for visual odometry, WhyCon for visual marker localization and Ewok for trajectoy planning with collision avoidance.
167 stars 73 forks source link

Simulation problem #4

Closed zxp771 closed 5 years ago

zxp771 commented 5 years ago

Hi @szebedy Thanks for your sharing. I have some question about the simulation.

  1. Your introduction(simulation launch everything in the same window with a launch file) said we need launch svo_ros intel_aero. launch like this: image I'm wondering could I use other algorithm's launch file(maybe I can write a new launch.file for my algorithm like yours) instead of it?
  2. For launch each component separately method. I tried to do the test step by step as your introduction but when I run the "source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default" it will show this error: image could you give me some advice to solve this problem?

Thanks for your sharing again It's really helpful!

szebedy commented 5 years ago

Hi @zxp771,

  1. My code is expecting the position updates from svo on the topic /svo/pose_imu, see https://github.com/szebedy/autonomous-drone/blob/746991207d4eed0af8cb27870ad4d74411fdd314/src/offboard_control/ros_client.cpp#L32 so if you want use an other visual odometry algorithm you're going to have to change this dependency
  2. Looks like the file is not there, maybe you missed initializing the submodules after cloning the repository?
    cd ~/catkin_ws
    git submodule update --init --recursive
zxp771 commented 5 years ago

Hi @szebedy Thanks for your reply. 1.thanks for your explanation. I will notice it when I use it.

  1. I tried your advice it still didn't work. Here are the folders in my workspace. image BTW all the code in your project has been compiled successfully.
szebedy commented 5 years ago

The command source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default executes the file Tools/setup_gazebo.bash in the px4 folder. The only reason I can think of not to have that file is that the px4 submodule has not been initialized.

zxp771 commented 5 years ago

Hi @szebedy I noticed that your introduction said:"Wait until downloading finish correctly, then run" image but when I run the "cd ~/catkin_ws git submodule update --init --recursive" there is nothing happened. image

BTW Could I install the PX4 in the same workspace which I install my v-slam algorithm?

zxp771 commented 5 years ago

Hi @szebedy I figure out the problem and tried to run the command in your introduction. When I run the "roslaunch px4 mavros_posix_sitl.launch" it will show this error: image Will it impact other processing?

BTW

  1. I'm confused with the whycon you use, what's the purpose do you use that?
  2. Could I install the PX4 in the same workspace which I install my v-slam algorithm?
szebedy commented 5 years ago

How did you figure out the problem? Do you have my px4 fork in the px4 folder?

  1. As stated in my description, my research paper and if you googled it, whycon is a visual marker tracker for localizing a visual marker
  2. You can do anything you please
zxp771 commented 5 years ago

Hi@szebedy

  1. I install the PX4 as https://github.com/UCM-M143/MavRos-takeoff-n-land said. I think maybe I just run the command in the wrong folder.
  2. Yes, I googled the whycon, but I think my problem is how to use it in the simulation environment. 3,Thanks for your reply.

Thanks for your help and share!It's really useful!

zxp771 commented 5 years ago

Hi @szebedy

I noted that you implemented the ewok for collision avoidance. But I haven't seen any installation introduction for it. Do you use the project in your code here? Should I install the ewok by myself first then run your project for simulation?

szebedy commented 5 years ago

Hi @zxp771,

A modified version of the ewok source code can be found in the trajectory planner folder of my repository. I basically took the classes (includes) from ewok and modified one of their example source files to work with my application.

zxp771 commented 5 years ago

Hi@szebedy Thanks for your reply. I checked your code and the example you added in the folder. Thanks for your sharing.

zxp771 commented 5 years ago

Hi @szebedy

I want to run the simulation environment on my computer But I check your intel_aero launch file. Do I need to install intel realsense package first then run the simulation test?

szebedy commented 5 years ago

Hi @zxp771

If you want to simulate, launch the simulation launch file. It is still not going to work if you have the official PX4 repository and not my PX4 fork, because I created a simulation environment dedicated for my autonomous drone repository.

Realsense package is only needed if you want to execute the code on the Intel Aero RTF drone. For that you can follow installation instructions here.

zxp771 commented 5 years ago

Hi @szebedy Thanks for your reply and sharing. One more question: How do you build the Gazebo simulation environment? I mean if I want to test the different simulation environment(not use your build but use my own one or change the target position on your simulation environment) which part should I modify by myself?

szebedy commented 5 years ago

Hi @zxp771,

You can change the models and worlds inside the sitl_gazebo submodule found in the folder px4/Tools/sitl_gazebo.

You can find some example commits here that show you how I did it.