Ros Installation In Virtualbox For Mac

With no doubt, VirtualBox is perhaps the most popular tool for running macOS Virtual Machine. The problem is, running macOS on VirtualBox comes with its fair share of challenges and bottlenecks. This is often the case if the VirtualBox does not enjoy full CPU support or does not use a graphics card. Consequently, the whole. But again you can install macOS Catalina on VMware, or VirtualBox on Windows PC. If you are satisfied with all macOS Catalina features then in few simple steps install it in VirtualBox with a new method. When it comes to the era of Virtual machines, VirtualBox is a complete Virtualization platform that everything is existing on that.

Background

In order to get up and running quickly with the CPS project, you can access a pre-packaged Docker container that has the required Robot Operating System (ROS) libraries and dependencies already installed. Docker is quickly becoming the industry standard for packaging and distributing software because it provides the ability to bundle and run an application in a loosely isolated environment called a container.

While virtual machines exist as complete standalone environments (virtual hardware), containers take virtualization a step further by abstracting the operating system. By using a shared OS, containers provide lightweight efficiency while still including everything needed to run an application (code, runtime, system tools, system libraries and settings).

ROS Kinetic only supports Ubuntu 15.10, Ubuntu 16.04 and Debian 8. We will use Ubuntu 16.04 (Xenial) to launch Ros Kinetic / Gazebo 7 inside the Docker image. Because the Docker Engine daemon uses Linux-specific kernel features, you can’t run Docker Engine natively on Windows. Instead, you must create a Linux Virtual Machine on your machine to host the Docker Engine on your Windows System. (Note: the Docker container will also work on macOS without a VM because it is based on the Unix operating system. If you are on Mac or Linux, you can skip steps 2-)

This configuration has been tested using a VirtualBox with Ubuntu 16.04.

Instructions

------------------------ FIRST TIME ONLY ------------------------

Install ros melo
  1. First, head over to the Docker website and create an account.

  2. Download and install VirtualBox. VirtualBox runs Windows, Mac and Linux machines, so choose the appropriate package for your platform.

  3. Download the Ubuntu 16.04.x ISO file from the releases archive. Determine if you are running 32-bit or 64-bit architecture and download the corresponding PC desktop image at the top of the page.

  4. Run VirtualBox and click the New icon on the upper-left side of the machine. From the screen that appears, type Xenial in the name field. Then from the Version drop-down box, select Ubuntu, and choose either the 32-bit or 64-bit version, depending on the ISO you downloaded.

  5. Select the amount of RAM: The recommended amount should suffice. You can always go back and increase the amount if performance is degraded. Click Continue.

  6. Create a Virtual Hard Drive: From the screen that appears after you've selected the amount of RAM, click 'Create a virtual hard drive.' Choose VDI (VirtualBox Disk Image) as the file type. For the type of drive, you'll have a choice between one that is a fixed size and one that dynamically allocates space, that is, it grows larger if the operating system needs it. Your best bet is to choose a fixed size, it offers better performance. Increase the size to ~15 GB to allow enough space for the Docker image (Ubuntu OS alone will consume about 8.6 GB). Click Create after you've made your choices.

  7. After you create the virtual hard drive, you'll be sent back to the VirtualBox main screen. Click the Start button. You'll be asked to Select start-up disk. Head to where you downloaded the Ubuntu 16.04 ISO file, click Start and the installation will begin.

  8. From the Install screen, select Install Ubuntu. On the next screen (below) you can leave both checkboxes unchecked and select Continue.

  9. For Installation type, leave the Erase disk and install Ubuntu radio button selected. Don't worry, the virtual machine has no access to your host's hardware. It will not affect your local files and the Ubuntu installer has absolutely no knowledge of the host system. Click Install Now and then Continue.

  10. Proceed to configure your timezone, keyboard layout and login credentials. When installation is complete, follow the prompt to Restart Now.

    TIP: Once you are running the virtual machine, if you find you cannot resize the window, select Install Guest Additions from the Device menu in the VirtualBox toolbar. Click on the Run VBox Windows Additions executable in the window that opens. Follow the steps in the installation wizard and restart the virtual machine for changes to take effect.

  11. From within the virtual machine, right click on the desktop and select Open Terminal. To install Docker, execute the following commands in the terminal window that appears.

    • Update the apt package index.
      • sudo apt-get update
    • Install packages to allow apt to use a repository over HTTPS.
      • sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    • Add Docker’s official GPG key.
      • curl -fsSL https://download.docker.com/linux/ubuntu/gpg sudo apt-key add -
    • Set up the stable repository.
      • sudo add-apt-repository 'deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable'
    • Update the apt package index again.
      • sudo apt-get update
    • Install the latest version of Docker CE.
      • sudo apt-get install docker-ce
    • Verify that Docker CE is installed correctly by running the hello-world image.
      • sudo docker run hello-world

    ------------------------ END FIRST TIME ONLY ------------------------

  12. Now that your environment is set up, you're ready to run access the Docker image.

    • Open Terminal and login to Docker Hub.
      • docker login
    • Start the Docker container.
      • docker run -itd -p 5901:5901 -p 6901:6901 -p 222:22 batrakunal/cps
    • Confirm the Docker container running status.
      • docker ps -a
      • Status should be “Up”
    • Login to the Xenial instance running in the docker container from web browser.
    • Go to URL http://localhost:6901/?password=vncpassword
  13. From within the Docker container, launch the simulation.

    • Open Terminal and Change directory.
      • cd /headless/Desktop/cps-project/CPS_ws
    • Setup devel environment.
      • source devel/setup.sh
    • Change directory to launch.
      • cd src/create_2/launch
    • Launch ROS and Gazebo.
      • roslaunch create_2_sim.launch
  14. To exit simulation, issue a signal interrupt with the following key combination in the terminal.

    • Ctrl + C

Additional Notes:The Docker image includes a ROS-Desktop-Full Install. This installation includes ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception (Gazebo 7). Supporting ROS Gazebo packages have already been installed in the container.

Here is a video illustration of this setup for your reference https://vimeo.com/364562554

Updated

2017

These instructions will install the ROS Melodic Morenia distribution, which is available for Ubuntu Artful (17.10), Bionic (18.04 LTS) and Debian Stretch, among other platform options.

To install our previous long-term support release, ROS Kinetic Kame, please see the Kinetic installation instructions.

The links below contain instructions for installing ROS Melodic Morenia on various operating systems.

Supported:

  • Artful

    amd64

    Bionic

    amd64

    armhf

    arm64

    10

    amd64

Experimental:

  • Any

    amd64

    i686

    arm

    armv6h

    armv7h

    aarch64

Construction zone

The following links are referring to previous ROS distributions installation instructions and have not been updated since.