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

Simulating the COEX Pix #12

Open
Danealor opened this issue Oct 4, 2021 · 1 comment
Open

Simulating the COEX Pix #12

Danealor opened this issue Oct 4, 2021 · 1 comment

Comments

@Danealor
Copy link

Danealor commented Oct 4, 2021

After playing a bit with the COEX Pix simulation, I wanted to post here to help others start out. I've tried the native installation but I've still not ironed out all the errors, so I'll be using the virtualbox method in this post. I may post here again once I figured out native installation.

The instructions for the virtualbox installation were taken from their website.

First, download the virtualbox .ova here.
Note that it is 5.5GB so ensure that you have ample download speed/time and disk space.

Then, open VirtualBox and import the application as you did with the class VM.
In the settings:

  • Set RAM to at least 4GB
  • Set graphics to VMSVGA and enable 3D acceleration
  • We will also install the Guest Additions for convenience:
    • Under "Storage", use the CD with plus icon next to "IDE Controller" to add an optical drive.
    • Choose "VBoxGuestAdditions.iso" and click OK.

Boot the virtual machine.
Username: clover
Password: clover

To finish installing the guest additions:

  • Open the CD on the desktop of Xubuntu
  • Right-click and choose "open Terminal here"
  • sudo ./autorun.sh

To set the display resolution:

  • Click the Xubuntu icon at the top right and open "Settings"->"Display"
  • Under resolution, change the value to something just below your own screen's resolution so that it will comfortably fit inside your window. For example, on my 1920x1080 monitor I chose 1440x900.

To run:

  • catkin_make in ~/catkin_ws
  • roslaunch clover_simulation simulation.launch
  • Check rqt_graph to see the node graph

Get position:

  • rostopic echo -n 1 /mavros/local_position/pose

To test simple flight:

  • Open QGroundControl from desktop.
  • Confirm parameters as they are.
  • Check that "Ready To Fly" appears in the top left, and click Takeoff.
    • Slide to confirm at the bottom.
    • Keep an eye on Gazebo; the simulated drone should start up its rotors and then slowly rise up.
  • Click Land to touch back town.
    • Slide to confirm again.

Programming: The simple_offboard node is a high-level navigation and telemetry node that simplifies all the programming into a few easy to use services.

  • Check that is exists:
    • rosnode info simple_offboard
    • Note all the topics it publishes and subscribes to in /mavros
    • The important part is under "Services:", which lists all our callable functions for this node. See reference and usage here.
  • Check out the navigation service:
    • rosservice type /navigate | rossrv show
  • Takeoff to 1.5m at 0.5m/s (keep an eye on Gazebo)
    • rosservice call /navigate 0.0 0.0 1.5 0.0 0.0 0.5 body true
    • "body" means relative coordinates
  • Fly to (2m,2m) at 1.0m/s
    • rosservice call /navigate 2.0 2.0 1.5 0.0 0.0 1.0 map true
    • "map" means global coordinates
  • Land
    • rosservice call /land
@Danealor
Copy link
Author

Danealor commented Oct 7, 2021

For the installation in our own already created environments, I followed the native build instructions on their website. In fact, it seems that just last week they updated that page from Ubuntu 18.04 to instructions for ROS Noetic in Ubuntu 20.04, so that's quite lucky!

Following those new instructions, I was able to build Clover and PX4 and simulate the drone like the above post, right inside of our existing workspace.

A few notes for the installation:

  • I had to run sudo apt-get upgrade in order to update a library that I had installed through the previous instructions, though that may not be necessary anymore.
  • They instruct you to clone the PX4 library to your home directory and then create some symlinks from ~/catkin_ws/src to that directory, to have it picked up by catkin. I at first chose to clone it into /usr/lib as per the previous instructions, but that caused some permissions problems and I eventually moved it to the home directory after some troubleshooting. If that happens:
    • The two symlinks would have to be removed and relinked when that directory moves.
    • The ~/catkin_ws/src/build directory would have to be deleted so that catkin can remake it and link to the new directory.
  • There was a permission problem copying a file to a directory that may or may not have been related to my previous blunder, but if a configure_file Problem configuring file error comes up, run sudo chmod a+w ~/catkin_ws/src/PX4-Autopilot/.vscode to fix it.
    • I also had to run sudo chmod -R a+w ~/catkin_ws/src/sitl_gazebo

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

No branches or pull requests

1 participant