Code for the FRI haptic device project
NOTE: When launching the program, you may need to calibrate the device by pushing it in and out until it is recognized.
Specify the # of atoms at launch like so:
./haptic-device 38
If you don't pass in anything, the default is five.
You can also read in an existing configuration:
./haptic-device example.con
Make sure the .con file is in ../resources/data.
Choose the potential energy surface by adding a second argument:
./haptic-device 25 morse
The default is Lennard-Jones(lj). Other options are morse, ase, pyamff.
Windows development temporarily halted (unable to compile on Visual Studio). Check WINDOWS.md for details on installation.
Download the multiplatform release from chai3d
Run the following commands
sudo add-apt-repository universe
sudo apt update
Install the required packages using the command
sudo apt-get install libusb-1.0-0-dev libasound2-dev freeglut3-dev xorg-dev python3-dev gfortran
Run "make" in the chai3d-3.2.0 directory
Clone this repo into the chai3d-3.2.0 directory
Create the directory data
in bin/resources
and move the file global_minima.txt
there
Run make
in the haptic-device/PyAMFF
folder
Run make
in the haptic-device
folder
Your directory structure should look like so:
chai3d-3.2.0/ ├── bin │ ├── lin-x86_64 │ ├── mac-i386 │ ├── mac-x86_64 │ ├── resources │ └── data │ └── global_minima.txt │ │ ├── win-Win32 │ └── win-x64 └── haptic-device ├── LJ.cpp ├── Makefile ├── obj ├── PyAMFF └── README.md
At this point, the software should run with mouse and keyboard. The following steps are for setting up the haptic device
You may to change lines involving the relative file path
bool fileload = texture->loadFromFile(RESOURCE_PATH("../resources/images/spheremap-3.jpg"));
to the absolute file path.
Run the following commands while in chai3d-3.20/:
sudo cp ./external/DHD/doc/linux/51-forcedimension.rules /etc/udev/rules.d
sudo udevadm control --reload-rules && udevadm trigger
The textbook is too big to upload so here's the link: http://www.charleshouserjr.com/Cplus2.pdf
In order to use pyamff, you will need to have the following files in the lin-x86_64 folder:
q
or ESC
f
u
s
SPACE
c
a
ARROW KEYS
[
and ]
r
CTRL