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

Installing PX4-Autopilot for M1 Mac Users Running Parallels Ubuntu 20.04 Virtual Machine #21117

Open
OliverHeilmann opened this issue Feb 12, 2023 · 8 comments

Comments

@OliverHeilmann
Copy link

Description

As per the title, I have been trying to install PX4-Autopilot so that I can use the Gazebo Rover SITL environment with MavSDK. I am using a Macbook Pro with Apple Silicon (M1 chip) and have a Parallels VM instance running Ubuntu 20.04.

Linux ubuntu 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:27 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

I have managed to get the setup working, following issues including #19210 and #21014, but it was not as straight forward I was hoping.

I am opening up a Feature Request as a means to capture the steps I went through and link the associated resources I used, as well as to ask the PX4 developer community if we can have some clearer documentation for others in my situation. Hopefully, this post will help other developers experiencing the same issue in the meantime.

Installation

Note that this post assumes that readers already have a working Parallels (or similar) VM installed.

Clone the repository as normal into the desired location.

git clone https://github.com/PX4/PX4-Autopilot.git --recursive

Next, you need to delete two lines in the ubuntu.sh file located in the setup folder.

# delete the two lines (lines 125, 126) in ubuntu.sh
# 		g++-multilib \
#		gcc-multilib \
nano PX4-Autopilot/Tools/setup/ubuntu.sh

Install the ARM-Linux gcc and g++ multilib versions.

sudo apt-get install gcc-multilib-arm-linux-gnueabi gcc-multilib-arm-linux-gnueabihf g++-multilib-arm-linux-gnueabi g++-multilib-arm-linux-gnueabihf

The rest of the instructions shown below are as normal and described in the standard instructions here.

bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
sudo reboot

# in PX4-Autpilot directory
make px4_sitl gazebo_rover

Resources Used

  1. I found mengchaoheng's post to be useful in explaining how developers should 'delete g++-multilib and gcc-multilib lines'.
  2. I ended up following the steps from this YouTube video.
  3. Official PX4-Autopilot YouTube video describing the installation instructions.
  4. The PX4-Autopilot documentation instructions here
@Flyingtux
Copy link

Flyingtux commented Mar 25, 2023

Hello, Thanks for the tuto. I followed it on my M1 64GB with parallels pro 18 on a fresh ubuntu 18.04 32GB but I had some trouble.

which version did you checkout ?

on current version (25/03/2023), gazebo targets seem not work anymore and jmavsim targets crash
on previous versions like 1.13.2 I have this issue :

jpdumont@macuntu2004:~/PX4-Autopilot$make px4_sitl gazebo_rover
ninja: error: '../../src/modules/mavlink/mavlink/pymavlink/tools/mavgen.py', needed by 'mavlink/development/development.h', missing and no known rule to make it
make: *** [Makefile:235: px4_sitl] Error 1

Thanks in advance

@Flyingtux
Copy link

Flyingtux commented Mar 25, 2023

Hello,

Ok I solved my problem, I was using the v1.11.3.
My problem was a bad init of git when I did :

git clone https://github.com/PX4/PX4-Autopilot.git
cd PX4-Autopilot.git
git checkout v1.11.3
git submodule init
git submodule update --recursive

the good way is :

git clone https://github.com/PX4/PX4-Autopilot.git
cd PX4-Autopilot.git
git checkout v1.11.3
git submodule update --init --recursive

Regards,

@OliverHeilmann
Copy link
Author

Hi @Flyingtux, thanks for posting your solution! Answering your initial question anyway, I am using v1.11.3 as per the screenshot shown below.

Screenshot 2023-03-26 at 14 36 55

My experience of setting up the PX4 SITL environment didn't require me to checkout any specific version (I think the version I have was the default). One thing I did note was that you are using Ubuntu 18.04 whereas I was using 20.04. PX4 documentation says both should be fine but just wanted to highlight this difference.

Another noteworthy thing is that you might need to turn of 3D/ Graphics/ GPU Acceleration while using Gazebo. Some users experience a 'black screen' if not. Generally this slows down the SITL environment but, as you are using an M1 Pro, I am sure it will be fine regardless. See setting option below (click on Advanced and ensure that this is disabled).

Screenshot 2023-03-26 at 14 45 47

Can you confirm that the Gazebo and JMavSim simulators are working as you expect now?

I will keep this issue open to allow others to post if they had any other issues following these steps.

@Flyingtux
Copy link

Flyingtux commented Mar 27, 2023 via email

@Flyingtux
Copy link

Flyingtux commented Mar 27, 2023 via email

@OliverHeilmann
Copy link
Author

Hi @Flyingtux, if you're looking into simulators and concerned about performance, I'd have a look at WeBots. I've used it with good success and it uses much less compute power than other simulators such as Gazebo. I think the UI is quite intuitive, as is the nodal structure of all the in-world assets (docs are good too).

Look at this comparison between Gazebo, CoppeliaSim, MORSE and WeBots paper for some further insight.

@Flyingtux
Copy link

Hi Oliver,

Thanks, interesting for robotics application ;-)

@LongLiveForFreedom
Copy link

Description

As per the title, I have been trying to install PX4-Autopilot so that I can use the Gazebo Rover SITL environment with MavSDK. I am using a Macbook Pro with Apple Silicon (M1 chip) and have a Parallels VM instance running Ubuntu 20.04.

Linux ubuntu 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:27 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

I have managed to get the setup working, following issues including #19210 and #21014, but it was not as straight forward I was hoping.

I am opening up a Feature Request as a means to capture the steps I went through and link the associated resources I used, as well as to ask the PX4 developer community if we can have some clearer documentation for others in my situation. Hopefully, this post will help other developers experiencing the same issue in the meantime.

Installation

Note that this post assumes that readers already have a working Parallels (or similar) VM installed.

Clone the repository as normal into the desired location.

git clone https://github.com/PX4/PX4-Autopilot.git --recursive

Next, you need to delete two lines in the ubuntu.sh file located in the setup folder.

# delete the two lines (lines 125, 126) in ubuntu.sh
# 		g++-multilib \
#		gcc-multilib \
nano PX4-Autopilot/Tools/setup/ubuntu.sh

Install the ARM-Linux gcc and g++ multilib versions.

sudo apt-get install gcc-multilib-arm-linux-gnueabi gcc-multilib-arm-linux-gnueabihf g++-multilib-arm-linux-gnueabi g++-multilib-arm-linux-gnueabihf

The rest of the instructions shown below are as normal and described in the standard instructions here.

bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
sudo reboot

# in PX4-Autpilot directory
make px4_sitl gazebo_rover

Resources Used

  1. I found mengchaoheng's post to be useful in explaining how developers should 'delete g++-multilib and gcc-multilib lines'.
  2. I ended up following the steps from this YouTube video.
  3. Official PX4-Autopilot YouTube video describing the installation instructions.
  4. The PX4-Autopilot documentation instructions here

thank you for your sharing! It worked for me!

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

No branches or pull requests

3 participants