Skip to content

jhu-dvrk/drac-util

Repository files navigation

dRAC utilities

dractest: Manufacturing test software to test dRAC PCBA and dVRK-Si controller. Requires a test board or equivalent loopback connectors. Do not use with robot connected.

dractune: Current loop tuning tool for dRAC. Not maintained and probably does not work.

dractweak: View and control the low level states of the robot. Not maintained and probably does not work.

Linux build dependencies

sudo apt install build-essential cmake git libraw1394-dev libglfw3-dev libglew-dev

Linux build

Clone the repository and initialize the submodules:

git clone https://github.com/jhu-dvrk/drac-util.git
cd drac-util
git submodule update --init --recursive

List the available presets, then configure and build with the Linux preset. This preset enables Amp1394_HAS_RAW1394=ON by default.

cmake --list-presets
cmake --preset linux-gcc
cmake --build --preset linux-release --parallel

Linux AppImage release

To build a dractest AppImage release:

./scripts/build-linux-appimage.sh

That stages a dractest AppDir from the CMake install component, downloads linuxdeploy if needed, and writes the release artifact to:

build/linux-gcc/release/dractest-1.0.0-x86_64.AppImage

Windows bootstrap

Use the bootstrap script below on a fresh Windows machine to install the Microsoft C++ toolchain, set up vcpkg, install glfw3 and glew, sync submodules, and validate the repo helper.

.\scripts\bootstrap-windows.ps1

By default it installs Visual Studio 2022 Community. For a lighter tool-only setup:

.\scripts\bootstrap-windows.ps1 -VisualStudioEdition BuildTools

It can also persist VCPKG_ROOT for the current user:

.\scripts\bootstrap-windows.ps1 -PersistVcpkgRoot

The Visual Studio installer may prompt for elevation and can report that a reboot is needed before the full toolchain is usable.

After bootstrap, use the helper below to enter a Visual Studio x64 shell with MSVC, CMake, and an optional vcpkg root added to PATH.

. .\scripts\enter-windows-toolchain.ps1
cmake --list-presets
cmake --preset windows-msvc-x64

Running the script without dot-sourcing launches a child PowerShell that already has the toolchain activated:

.\scripts\enter-windows-toolchain.ps1

The helper script looks for vcpkg in VCPKG_ROOT, C:\dev\vcpkg, and C:\lib\vcpkg. If it finds one, it also sets CMAKE_TOOLCHAIN_FILE.

cmake --preset windows-msvc-x64
cmake --build --preset windows-release

Windows manual install

There are two variations: VCPKG classic mode and manifest mode. Classic mode uses the globally installed libraries (in the vcpkg directory), whereas manifest mode installs the libraries (specified in vcpkg.json) in the project build tree.

  1. Install a C++ compiler, with support for C++20. The code has been tested with Visual Studio 2022. Also, note that this compiler has been specified in CMakePresets.json.
  2. Install vcpkg. Typically, this is done by cloning the GitHub repository and then running the appropriate bootstrap-vcpkg script (e.g., bootstrap-vcpkg.bat).
  3. Set an environment variable VCPKG_ROOT to specify the vcpkg root directory, and then add %VCPKG_ROOT% to your PATH. This step is not strictly required, but if not done, paths will need to be specified in some of the following steps.
  4. If using VCPKG in classic mode, install glfw3 and glew: vcpkg install glfw3 glew (skip this step if using VCPKG manifest mode).
  5. Clone this repository, e.g., git clone https://github.com/jhu-dvrk/drac-util.git
  6. This repository has submodules for imgui, implot, and mechatronics-software, so the submodules must be initialized and updated: git submodule update --init
  7. Run CMake, specifying the source and build directories. Choose the desired "Manual Setup" preset (VCPKG classic or manifest)
  8. Configure and generate the CMake project. If using VCPKG manifest mode, the glfw3 and glew libraries will be installed during CMake configuration.
  9. Open the project file and build the desired configuration (e.g., Debug or Release).
  10. If you want to build an installer package (PACKAGE target), you will need to install NSIS.

Windows dractest release (alternative to NSIS installer)

To stage a portable dractest bundle without the rest of the repo install tree:

cmake --install build\windows-msvc-x64 --config Release --component dractest-runtime --prefix build\dractest-stage

To stage and zip the release in one step:

cmake --build --preset windows-release --target dractest_package

That creates:

build\windows-msvc-x64\release\dractest-Release-windows-x64.zip

GitHub Actions can generate the same Windows release zip automatically using windows-dractest-release.yml.

Manual trigger:

  1. Open the repository on GitHub.
  2. Open the Actions tab.
  3. Select Windows dractest release.
  4. Click Run workflow.
  5. Download the dractest-windows-x64 artifact from that workflow run.

Tagged release trigger:

git tag v1.0.0
git push origin v1.0.0

Pushing a tag matching v* runs the same Windows build and uploads the zip to the corresponding GitHub Release.

About

Tuning and testing software for dRAC

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors