Setting up Virtual Machine

For development we suggest using a virtual machine (VM) running debian (stretch) linux. Follow these steps to start running a pre-configured VM .ova file on your own machine. The pre-configured VM has been configured as outlined in the workbench setup section. Upon installation the user should have an environment capable of developing software, testing and cross-compiling to a real time linux OS on a Beagle Bone Black.

  1. Install virtual box version 6.0.4.
  2. Download and install the VirtualBox Oracle VM VirtualBox Extension Pack.
  3. Download workbench.ova: Currently hosted at the capstone google drive: workbench.ova

    • Google Drive Location: Capstone Project - LOWER LIMB EXOSKELETON FOR GAIT ASSISTANCE\Embedded Team\Virtual Machines Note: You may need a University of Melbourne email to access this link.
  4. In Virtual box file -> import appliance and enter the path to the .ova file

  5. Configure the environment .

    • Select 70mb or more of video ram.
  6. Make sure to select the reinitialize the MAC address of all the network cards option.

  7. Start your system and install virtual box Guest additions.

    • Login username is will
    • Login password is password

Guest additions for VM

On the Virtual box menu Choose “Devices”->”Insert Guest Additions CD image…”

If this does not automatically run then follow the below code on a terminal.

user@debian:~$ su -
root@debian:~# apt-get update
root@debian:~# apt-get install build-essential module-assistant
root@debian:~# m-a prepare
root@debian:~# cd /media/cdrom
root@debian:~# sh ./VBoxLinuxAdditions.run
root@debian:~# reboot

Testing the VM

You should now have a cloned VM with working Debian and cross compilation to BBB or any other armhf devices.

Alternative Setup with Docker

Rather than setting up a Virtual Machine, an alternative is to use a Docker container to simulate the BBB on the user's host OS in a terminal. This method utilises cross compilation for the BBB, then copying the compiled exo app or tests to the Docker container to be run. A recommended method for setting up the Docker workflow on a fresh computer is described below.

  1. Install VSCode.

  2. Install Git.

  3. Download the GNU Toolchain, selecting beaglebone-gcc6.3.0-r2.exe (361 MB) and install.

  4. Install Docker.

  5. Windows 10 Pro, Enterprise or Education are required for use. For University of Melbourne staff and students, a free upgrade to Windows 10 Education from Windows 10 Home can be accessed at this link.

  6. To learn some of the basics on getting started with Docker, this Youtube video may be useful.

  7. Checkout the code repository.

  8. Pull the armhf/Debian Docker image.

  9. Recommend using the VSCode terminals for simplicity, as multiple terminals will be required when the container is created. The following example was from a Powershell terminal within VSCode.

PS C:\Users\pc-user> docker pull armhf/debian

  1. Create a container based on the image.

  2. A container ID will be produced in the form of a long hexidecimal string.

  3. This will not start the container yet.

PS C:\Users\pc-user> docker create -it armhf/debian

  1. Build the desired app or test using the relevant Makefile and the "make" command.

PS C:\Users\pc-user\Documents\Github\exo\> make testJoints

  1. Copy the generated application on the local filesystem to the Docker container.

  2. Only enough characters of the container ID are needed to make it unique amoung created containers, so if only one container has been created, only one character of the container ID is needed.

PS C:\Users\pc-user\Documents\Github\exo\> docker cp <APPNAME> <CONTAINERID>:/<LOCATION>

  • For example:

``` PS C:\Users\pc-user\Documents\Github\exo> docker cp testJoints 93d5d:/testJoints ````

  1. Start the Docker container in interactive mode, using the flag '-i'.

PS C:\Users\pc-user\Documents\Github\exo\> docker start -i <CONTAINERID>

  1. Confirm that the application copied from the local filesystem is present in the container and can be run.

  2. For example, listing the present files, running testJoints and exiting the container:

root@93d5d77076e1:/exo# ls bin boot dev etc home lib media mnt opt proc root run sbin srv sys testJoints tmp usr var root@93d5d77076e1:/exo# ./testJoints This is a script to test the implementation of the Joints, ActuatedJoints and Drive Classes! 1. Construct a CopleyDrive Object (which implements Drive Class) 2. Construct a TestActJoint Object (Cast as a ActuatedJoint), using the testDrive Object MY JOINT ID: 1 Read the ID of the Joint (Expected Value 1): 1 Read Node ID of the Drive (Expected Value 100): 100 Read Value of the Joint (Expected Value 0): 0 Set the Joint into Position Control Mode: 1 Set the position of the Joint to 1 (expected result: true): Drive 100 Writing 1 to 0x607A 1 Read Value of the Joint (Expected Value 0): 0 Call a updateValue() defined in Joint: 1 Read Value of the Joint (Expected Value 1): 1 root@93d5d77076e1:/exo# exit NOTE: As Docker requires virtualization to be enabled in Windows, Virtual Machines like VirtualBox will not be able to be used. To enable/disable virtualization in Windows without using the BIOS, follow these steps:

  1. Run Command Prompt as administrator.

  2. Enter the following command.

  3. To enable virtualisation: C:\WINDOWS\system32> bcdedit /set hypervisorlaunchtype auto

  4. To disable virtualisation: C:\WINDOWS\system32> bcdedit /set hypervisorlaunchtype off

  5. Reboot your machine.