This is an old revision of the document!
Creating and Using a flatpak of arsandbox
Debug
Fail and check
flatpak-builder --run build-dir-arsandbox org.arsandboxg.ARSandbox.yml sh
the --run flat causes flatpak-builder to ignore the build instructions in the yaml. Instead it will setup /app and /usr folders then execute the sh command given. (bash might be a better choice)
Now you can look around to figure out where files are so you can add the right stuff to the yml file
When debugging –run is your best friend
Offline
opening another terminal window after the fail and cding into the build-dir directory might show you the file structure but commands like make will not behave the same as they will use the host OS tools instead of the flatpak tools.
Create
Create the repo
flatpak-builder --repo=repo --force-clean --state-dir=build-cache-arsandbox build-dir-arsandbox org.arsandboxg.ARSandbox.yml
- put the finished build in a folder called
repo - do not use any part of any previous build
- provide a cache folder so flatpak-builder doesn't have to redownload stuff every build
- give a temp directory for the build
bundle the repo as one file
flatpak build-bundle repo arsandbox_g.flatpak org.arsandboxg.ARSandbox
- the name of file
- app ID
Give user permission to access Kinect
sudo sh -c 'printf "# Kinect v1\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"02b0\",
MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"02ad\",
MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"02ae\",
MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"02c2\", MODE=\"0666\"\n\n# Kine
v2\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"02c4\", MODE=\"0666\"\nSUBSYSTEM==\"usb\",
ATTR{idVendor}==\"045e\", ATTR{idProduct}==\"02d8\", MODE=\"0666\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"045e\
ATTR{idProduct}==\"02d9\", MODE=\"0666\"\n" > /etc/udev/rules.d/55-kinect.rules'
sudo udevadm control --reload-rules && sudo udevadm trigger
# if Kinect is already plugged into the computer, unplug and replug
Usage
- See list of commands inside flatpak:
flatpak run --command=ls org.arsandboxg.ARSandbox /app/bin. Will return:
AlignPoints EyeCalibrator MeasurePoints RunVRCompositor.sh TransformCalculator AlignTrackingMarkers FindHMD OculusCalibrator SampleTrackerField VRCompositingServer CalibrateCameras KinectServer OnHMD SARndbox VRDeviceDaemon CalibrateProjector KinectUtil PrintInputDeviceDataFile SARndboxClient VruiSoundConfig CalibrateTouchscreen KinectViewer RawKinectViewer ScreenCalibrator VruiSoundConfigTest DeviceTest MeasureEnvironment RoomSetup TrackingTest XBackground
- Run Calibrate Projector utility:
flatpak run --command=CalibrateProjector org.arsandboxg.ARSandbox - See what the Kinect sees:
flatpak run --command=RawKinectViewer org.arsandboxg.ARSandbox