-
Notifications
You must be signed in to change notification settings - Fork 0
Installation & Setup
For macOS, search spotlight for terminal
or goto Utility folder in your Application folder.
For Linux, it depends on your distribution, but usually you can find terminal
app from the menu bar of your OS.
Node.JS is a Javascript framework. You can do many interesting thing with node
from web-app to robotics.
npm
is node
's package manager. Using npm
you can manage many libraries in your project. If you install node
, npm
will also be installed in your machine.
Installing node
requires a "packge manager" in your OS. (Linux: apt-get
, yum
, etc. macOS: brew
)
- Some of you guys may have
brew
already. In that case,brew update
now to buy some time while others are installing. - New to
brew
? Go to : https://brew.sh - copy-paste command to your terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Once installation finished, type
brew doctor
to check if it's working (it may give you some warning but that's fine for now)
- If you already know your package manager, you may proceed to the next step.
- If you are not sure about your package manager, tell your TA about your OS/version.
- Usually,
ubuntu
distribution hasapt-get
package installer. -
Arch Linux
haspacman
-
CentOS
hasyum
- etc...
- Usually,
git
is a version tracker.
Some of you may have git
already when you have your OS installed in your machine.
When you type git -v
then it returns an error, You need git
tools to clone and track the repository.
- macOS : type
brew install git
- Linux : type
sudo (YOUR_PACKAGE MANAGER) git
Type git --version
to check if it's working.
- macOS : type
brew install node
- Linux :
- type
cd ~
- type
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- type
sudo apt-get install -y nodejs
- type
- Type
node -v
(type node (space) hyphen v) - Also, type
npm -v
If there's no error for both, your node
is working nice. (Once node
installed, you will also have npm
: node package manager.)
- macOS : type
npm install -g node-gyp
- for macOS users : If you have not installed python 3.x, your default python should be
python 2.x
. Typepython --version
to check the version. - for Linux users : You may already have
python
. First, typepython --version
If your python is running and the version is 2.7.x
, skip to 4.
You may uninstalled your python 2.x for some reasons(classes or projects).
If your python is 3.x
, you may need to change the version. We recommend to use pyenv
which you can easily switch versions of your python
.
Important note : Below you are trying to install
pyenv
: python virtual environment. You may be usingpython
for a data-science class or an introduction to programming class.pyenv
is a great tool that you can switch between severalpython
version quickly. Just don't forget that you have installedpyenv
, so that you don't have to panic when you know yourpython
version changed in other classes.
- Type
brew install pyenv
- Type
cd ~
In your home directory, there should be a .bash_profile
shell script. This is the list of scripts executed if you start your terminal.
- Using any text editor, open
.bash_profile
.CMD + SHIFT + .
can visualize hidden file on your Finder (file and directory starting from period means it is hidden file). - Add scripts below:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
- Restart the terminal and type
pyenv -v
. If there's no error,pyenv
is ready. - Type
pyenv install 2.7.10
- After installation type
pyenv global 2.7.10
. This switches your python version. - Type
python --version
to check if the version switched to 2.7.x
- Type
cd ~
- Type
git clone https://github.com/yyuu/pyenv ~/.pyenv
Below is an example of Ubuntu distribution. Install these depencencies using your package manager.
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev
sudo apt-get install -y libreadline-dev libsqlite3-dev wget curl llvm
- Type
cd ~
In your home directory, there should be a .bash_profile
or .bashrc
shell script. This is the list of scripts executed if you start your terminal.
- Using any text editor, open
.bash_profile
or.bashrc
. - Add scripts below :
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
- Restart the terminal and type
pyenv -v
. If there's no error,pyenv
is ready. - Type
pyenv install 2.7.10
- After installation type
pyenv global 2.7.10
. This switches your python version. - Type
python --version
to check the version switched to 2.7.x
Clone means that you will download the repository in your PC. You may now proceed to the directory you want to working on.
- If you are familiar with the terminal, proceed to your desired working directory for DIS project.
cd (your DIS directory)
- If you are not familiar with the terminal, We recommend you to first clone in your home directory.
cd ~
(change directory to 'home directory' = ~
)
Then type
git clone https://github.com/HassoPlattnerInstituteHCI/dualpantoframework.git
Then if you type ls
, there should be dualpantoframework
directory in your workspace.
For macOS
:
You'll need the xcode command line tools installed.
`xcode-select --install``
Also check that xcodebuild
is set as a command.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- Type
cd dualpantoframework
- You are now in
dualpantoframework
directory. Typepwd
to make sure you are there. - Type
npm install
to install packages fordualpantoframework
If there's no error, your dualpantoframework
is all set for test.
After installation, You will have build
directory, which is originally not in the repository.
This directory is generated when you did npm install
. Go take a look inside the directory.
build
├── Makefile
├── Release
│ ├── obj.target
│ │ └── serial
│ │ └── serial.o
│ └── serial.node
├── binding.Makefile
├── config.gypi
├── gyp-mac-tool
└── serial.target.mk
In Release
directory there's serial.o
exec file. For Linux/macOS users, this is one you need to execute to communicate with the board.
In the most examples below, we call this exec file as an subprocess to keep connecting with the panto while other software is running.
(BTW, I used tree
command to generate above tree graph. You can do brew(or sudo apt-get) install tree
to try the same.)
https://forum.arduino.cc/index.php?topic=346956.0
On linux the serial USB port name may not be easily auto-detect.
Go search on your /dev/
directory to find which one is your Arduino serial port.
Node.JS is a Javascript framework. You can do many interesting thing with node
from web-app to robotics.
npm
is node
's package manager. Using npm
you can manage many libraries in your project. If you install node
, npm
will also be installed in your machine.
- Download the installer of the LTS version
- Run the installer (no settings need to be changed)
- To test if the installation was successful open the command line and execute
node -v
andnpm -v
. You should get the respective version numbers.
- Download the installer here: https://git-scm.com/downloads
- Run the installer; we suggest change the following options:
- Uncheck the "Windows Explorer Integration"
- Choose Notepad++ as the default editor
- You probaply want to install a GUI like GitKraken (https://www.gitkraken.com/) or TortoiseGit (https://tortoisegit.org/) too
- This readme will provide the command lines for what needs to be done in case you decide to use git on the command line.
- Download the python 2.7 installer here: https://www.python.org/downloads/release/python-2714/
- Run the installer (no settings need to be changed)
- NOTE: Python 3 will not work. If you already have python 3 thats fine, but you need to install python 2 too.
- Download the installer here: http://gnuwin32.sourceforge.net/downlinks/make.php
- Run the installer (no settings need to be changed)
- Add the
bin
(should beC:\Program Files (x86)\GnuWin32\bin
) folder to thePath
variable- Search for path in the windows search
- Select "Edit environment variables for your account" or "Umgebungsvariablen für dieses Konto bearbeiten"
- Select 'Path' and click edit
- Select add and insert the path
- if you have a Visual Studion version installed you may be able to skip this step
- Download Visual Studio 2017 Enterprise here: https://hpi.de/intern/studium/elms/authentication/
- Run the installer
- select at least the workload "Desktopentwicklung mit C++"
- Download it here: https://nodejs.org/dist/v8.11.1/node-v8.11.1.tar.gz
- Unpack the
node-v8.11.1.tar.gz
- Unpack the
node-v8.11.1.tar
toC:\Program Files\nodejs
- !!! don't work in a OneDrive folder - it creates major issues !!!
- Clone the repository https://github.com/HassoPlattnerInstituteHCI/dualpantoframework.git
- In you working directory run
git clone https://github.com/HassoPlattnerInstituteHCI/dualpantoframework.git
- In you working directory run
- Open
x64 Native Tools Command Prompt for VS 2017
orx64 Native Tools-Eingabeaufforderung für VS 2017
- Run
npm install -g node-gyp
- Change to the directory of the repository using
cd C:\path\to\my\clone\dualpantoframework
- Run
set INCLUDE=%INCLUDE%C:\Program Files\nodejs\node-v8.11.1\src\;
- Run
npm install
Assuming you have installed Node.JS, cloned the repository and built the serial.c process using make.
- Install Arduino IDE if not already installed
- on Windows use the normal Installer not the App
- Go to Tools > Board > Manage Boards: Install "Arduino SAM Boards (32-bits ARM Cortex-M3)" by Arduino
- Go to Sketch > Libraries > Manage Libraries: Install "Encoder" by Paul Stoffregen
- Edit the PWM Settings
- If you are using Mac you will find the file here:
/Users/[usrname]/Library/Arduino15/packages/arduino/hardware/sam/1.6.11/variants/arduino_due_x
- If you are using Windows you will find the file here:
C:\Users\[usrname]\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\variants\arduino_due_x
- If you are using Mac you will find the file here:
- Plug the USB cable in your computer
- Make sure the Arduino serial driver is installed (the serial port should be listed in your operating system). They should be installed automatically. Maybe you need to wait a few minutes
- Go to Tools > Port to select the right port
- Go to Tools > Board and select
Arduino Due (Native USB Port)
- Run
node Firmware/GenerateHardwareConfig.js LP_PCB
inside the dualpantoframework folder - Open the generated file in the Firmware folder with Arduino Studio
- Compile and upload the firmware using the Arduino IDE
- Press the orange reset button on the Arduino (using a small screw driver for example if you don't have a hole next to it)
- Go to Tools > Serial Monitor to test if you receive anything using the Arduino-"Serial Monitor" (set the baud rate in the bottom right to 115200)
- Run
./serial /dev/[your usb port]
on Linux and Mac or./serial //.//[your usb port]
to read values
For mac-users: You don't need to install a driver but may have to delete the "Arduino Due" in system preferences / network devices before replugging the device.
- move the handles between the motors, as close to the device as possible
- align the handles to the linkage it is mounted to pointing away from the linkage (the bottom one should point right and the upper one left)
- if you can't rotate a handle make sure the magnet of the encoder is not touching any components of the PCB
- press the reset button