AnimatLab SDK On NVIDIA Jetson TK1

If you want to run AnimatLab simulations using the Bullet physics engine on your NVIDIA Jetson TK1 then please read through this follow this page to get the base Ubuntu operating system running, and then follow the full Linux SDK documentation. This page is for those who just want to build and run the robotics framework to use the Jetson to control robots using neural networks.

The SDK source code for AnimatLab can be downloaded here (AnimatLabSDK.tar.gz). Please note that at the moment you must use the Grinch custom kernel 19.3.6 in order to run AnimatLab on the Jetson. The base 19.3 kernel available directly from NVIDIA has too many missing drivers to be usable out of the box. If you want to use that base NVIDIA kernel you will need to recompile it to add a lot of drivers including wireless capability, GPIO, and FTDI so you can talk to an Arduino. The instructions for uploading the Grinch kernel are very straightforward. (PS: If you use the Grinch then please donate a little something to Santyago at paypal@jarzebski.pl. He did an awesome job and really saved me a lot of effort.)

In the directions below the terminal commands are shown with a grey background and are preceded with a command line prompt >, while packages that need to be installed are shown in light blue.

Initial Setup
1.  Flash the Grinch custom kernel 19.3.6. Instructions are provided in the link.
2.  Install synaptic from software center. (Or whatever package manager you prefer.)
3. Install build-essentials
>sudo apt-get install build-essential linux-source
>sudo apt-get install linux-headers-`uname -r`
4.  Use software center to install git, Cola git GUI (or whatever git GUI you want to use)
git
Cola git GUI
5.  Use software center to install CMake 2.8.12.2 or later
CMake 2.8.12.2
6.   Install Code blocks from the software center, do not forget to include the extras.
Codeblocks
7.  Install boost packages using synaptics
libboost1.55-dbg
libboost1.55-all-dev
libboost1.55-dev
8.  Download and extract AnimatLabSDK.tar.gz. You can place this anywhere you want it. 
9.  Get the latest maintenance code. In a terminal, cd into AnimatLabSDK/AnimatLabPublicSource and run:
>git pull Maintenance


Build OpenSceneGraph
Unfortunately, The Jeston does not have an OSG package that can be easily installed using Synaptic. So you will need to build and install it manually. The robotics framework does not use any graphics, but it does use the high precision timing libraries. 
2.  Download OSG 3.0.1 from http://www.openscenegraph.org/index.php/download-section/stable-releases/145-openscenegraph-3-0-1-release-downloads
3.  Download OSG data from http://trac.openscenegraph.org/projects/osg//wiki/Downloads/SampleDatasets
3.  Extract both archive packages to your home folder and CD into OpenSceneGraph-3-0-1.
3.  Open the CMakeLists.txt file in gedit and remove the FIND_PACKAGE(FFMPEG) line. Trying to compile FFMEP always fails for me and I have found it is easier to just remove it. If you need FFMPEG Then you will need to investigate how to get this to compile correctly on your system.
3. 
>sudo cmake ../
>sudo make -j4
>sudo make install
>sudo ldconfig


Build Dynamixel SDK
This SDK allows you to control Dynamixel servos using the Usb2Dynamixel control board
Open /AnimatLabSDK/3rdParty/DynamixelSDK/linux/src/dxl.workspace in Codeblocks
Rebuild the workspace in both debug and release mode
Run the UpdateBin.sh file in that same folder


Build opeFrameworksArduino
This project allows you to control robot parts using an Arduino board using the Firmata protocol. It is typically targeted to the ArbotixFirmata sketch to allow you to control Dynamixel servos. 
Open /AnimatLabSDK/3rdParty/openFrameworksArduino/linux/openFrameworksArduino.workspace in Codeblocks
Rebuild the workspace in both debug and release mode
Run the UpdateBin.sh file in that same folder


Build AnimatSimulator
1.  Go to AnimatLabSDK/AnimatLabPublicSource/Projects_CodeBlocks and open RoboticsAnimatSimCode.workspace file in Codeblocks.
2.  Make sure the configuration is set to debug and then do a rebuild all. All should succeed.
4. Change configuration to release and rebuild all.
6. Open /AnimatLabPublicSource/Documentation/Ubuntu_help/AnimatLab.conf file in gedit.
7. Edit the file path to point to the location where you installed AnimatLabSDK/AnimatLabPublicSource/bin. Make sure you use the correct path. It should relative to the root user. For example, you should use /home/user/AnimatLabSDK as opposed to ~/AnimatLabSDK. 
8. Cd to AnimatLabSDK/AnimatLabPublicSource/Documents/Ubuntu_Help
and Copy AnimatLab.conf into ld config folder.
>sudo cp Animatlab.conf /etc/ld.so.conf.d/AnimatLab.conf
9. Refresh shared library list
>sudo ldconfig
11. You should be ready to run AnimatLab on the NVidia Jetson now. Download a robotics project from the AnimatLab warehouse, or build one of your own to test it.You can debug through Codeblocks, or run the example command line below to run a robotics project directly from the command line.
>./animatsimulator_debug  PathToProject/Project.asim
>./animatsimulator  PathToProject/Project.asim

Please see the AnimatLab robotics help pages for documentation on how the Robotics system works and how to use it, and watch the robotics video tutorials that provide a step-by-step guide on how to use the robotics framework to build a robotic arm system.