Skip to content

DIARC ROS

Evan Krause edited this page Aug 6, 2025 · 8 revisions

ROS Java

In order to use ROS with DIARC, Java files must be autogenerated from your local ROS packages.

  1. Source your ROS workspaces

source /my/catkin/ws/devel/setup.bash

  1. Clone diarcros_core (which includes rosjava)

git clone https://github.com/hrilabtufts/diarcros_core.git

  1. In the diarcros_core repo, run the following command:

./gradlew buildAndPublishDiarcRos

You should now be able to use ROS packages in DIARC.

Enabling diarcRos

By default, using ROS with DIARC is disabled. In order to enable it, edit your personal gradle.properties (in ~/.gradle/gradle.properties) to have the following properties:

diarc.rosVersion=yourRosDistro 
diarc.enableRos=true

If your project uses ROS out of the box (i.e. no third party packages, no custom messages), you can now run DIARC components and DIARC configurations that use ROS using the method outlined in the top-level readme (i.e., ./gradlew launch -Pmain=<>).

Using third party packages

If your project uses third party ROS packages such as kortex, fetch, ihmc, etc, you can specify these dependencies in two ways:

  1. When running launch, add the -Pdiarc.rosPackages flag, followed by a list of the packages you need, e.g.:

    ./gradlew launch -Pmain=example.config -Pdiarc.rosPackages="rospackage1, rospackage2, rospackage3"

  2. Add the packages you want to your personal gradle.properties, e.g.:

    diarc.rosPackages=rospackage1, rospackage2, rospackage3

    Dependencies added this way will be applied to ALL configs on run in this project, but are overridden by method 1.

See the list below for a list of supported packages.

  1. moveit

  2. map

  3. movebase

  4. kortex

  5. fetch

  6. lidar

  7. imu

  8. pr2

  9. spot

  10. tower

  11. vision

Adding new source sets

In the build.gradle.kts in the diarcRos subproject, add your new package and its sources like so:

addRosSource("examplePackageName", listOf(
    "edu/tufts/hrilab/examplePackage/*",
    "edu/tufts/hrilab/diarcros/examplePackage/*",
), listOf("exampleDependencyName1", "exampleDependencyName2"))

The final argument can be fully omitted if your package has no dependencies.

Clone this wiki locally