ArmarX Developer CLI

ArmarX provides a python tool for ArmarX developer to conventiently build a package and all its depedencies. It provides further utility commands for fixing errors like locating a package and finding a c++ symbol.

The ArmarX python tools are located in the Core build directory and in the python-armarx deb package. To retrieve the list of all commands with short explanations start the tools with the -h parameter.

Location of the developer cli tool:
${ArmarXHome}/ArmarXCore/build/bin/armarx-dev

build command

To run ArmarX programs it is necessary to compile several packages and their dependencies in the correct order. Although the normal C++ compiling procedure by calling cmake and make in the build directory works in ArmarX as well, it can be tedious.

Therefore ArmarX provides a tool, which can be used to build ArmarX packages including all its dependencies. The build tool is integrated into the armarx CLI tool located in the build binary directory of the ArmarXCore (e.g. ${ArmarXHome}/ArmarXCore/build/bin/armarx).

The following features are available at the moment:

  • Extracting the dependency graph and compiling in correct order
  • Force CMake to run before compilation (–cmake)
  • Interactive compilation if the packages cannot be found
  • Pulling from the Git repository before compiling (–pull).
  • Stash&Pulling from the Git repository before compiling (–stashnpull). This will perform stash, pull, stash pop on the git repository.
  • Multicore compilation (standard behavior is using as many cores as the CPU has) (-j X)
  • Compilation with Ninja (–ninja)

To pull and compile for example the RobotAPI, enter the following line (for this to work ArmarXCore needs to be cmaked before):

 ${ArmarXHome}/ArmarXCore/build/bin/armarx-dev build RobotAPI --pull

Running the script without parameters shows the usage information with all available parameters. The location from which the script is executed, does not matter.

Building of external dependencies

It is also possible to automatically build external dependencies, if the following criteria are met:

  • The source code is already checked out
  • It is a CMake project
  • CMake was already run once
  • The project writes the build directory into ~/.cmake/packages

You specify the dependency in ~/.armarx/armarx.ini:

 [Misc]
 dependencies = project_name1:dependency1,dependency2;project_name2:dependency3

For example:

 [Misc]
 dependencies = RobotAPI:Simox

Now, Simox will be always be build before RobotAPI is build. These dependency will also be included in the exec command.

exec command

With the exec command it is possible to execute shell commands in a given package and all its dependencies. The dependencies can be skipped with the parameter --nd. If the command contains spaces quotes must be used.

sync command

ArmarX provides a mechanism to synchronize an ArmarX package and all of its dependencies to remote PCs. Afterwards, ArmarX scenarios can be started remotely via IceGrid deployments (armarx deploy).

This command will install all mentioned ArmarX packages and all dependendent ArmarX packages into a local temporary directory and synchronize the contents of this directory to one or more remote hosts. Use the following command for synchronization:

${ArmarXHome}/ArmarXCore/build/bin/armarx-dev sync [parameters] package [package ...]

The most important parameters are:

  • –deployHosts: specify here which PCs the packages should be synced to
  • –username: specify which username to use for connecting to remote PCs (default: armar-user)

Additional paramters are:

  • –no-delete: don't remove the content of the local temporary directory before installation
  • –no-dep: don't install package dependencies (usefull if you are only changing a specific ArmarX package)
  • –compile: compile the packages before installation
  • –localSyncDir: if you want to specify which local temporary directory should be used for installation (default: $HOME/sync-armarx/)
  • –remoteSyncDir: which remote directory to synchronize ArmarX to (can be set via the environment variable ARMARX_REMOTE_SYNC_DIR and defaults to: armarx_$USER)

Commandline parameters can be stored in the file $HOME/.armarx/profiles/$PROFILE_NAME/armarx-sync.ini. Each commandline parameter is specified on a separate line in this file

--deployHosts=pc1,pc2
--no-delete

locatePackage command

Use the following command to locate and ArmarX package and print some of its properties:

${ArmarXHome}/ArmarXCore/build/bin/armarx-dev locatePackage packagename

The result for RobotAPI might look like this:

$ armarx-dev locatePackage RobotAPI   

ArmarX Package <RobotAPI>

        PACKAGE_CONFIG_DIR : ['/home/waechter/armarx/RobotAPI/build']

        PACKAGE_VERSION : ['0.9.1']

        PROJECT_BASE_DIR : ['/home/waechter/armarx/RobotAPI']

        BUILD_DIR : ['/home/waechter/armarx/RobotAPI/build']

        INCLUDE_DIRS : ['/home/waechter/armarx/RobotAPI/source', '/home/waechter/armarx/RobotAPI/build/source']

        LIBRARY_DIRS : ['/home/waechter/armarx/RobotAPI/build/lib']

        LIBRARIES : ['RobotAPIInterfaces RobotAPICore RobotAPIWidgets RobotAPIUnits RobotAPIUnitListenerRelays DebugDrawer RobotAPIRobotStateComponent EarlyVisionGraph ViewSelection WeissHapticSensor XsensIMU LibIMU RobotAPIOperations WeissHapticGroup StatechartProfilesTestGroup KinematicUnitGuiPlugin HandUnitGuiPlugin PlatformUnitGuiPlugin SensorActorWidgetsGuiPlugin HapticUnitGuiPlugin RobotViewerGuiPlugin DebugDrawerViewerGuiPlugin ViewSelectionGuiPlugin']

        CMAKE_DIR : ['/home/waechter/armarx/RobotAPI/etc/cmake']

        BINARY_DIR : ['/home/waechter/armarx/RobotAPI/build/bin']

        SCENARIOS_DIR : ['/home/waechter/armarx/RobotAPI/scenarios']

        DATA_DIR : ['/home/waechter/armarx/RobotAPI/data']

        EXECUTABLE : ['ForceTorqueObserverRun HeadIKUnitRun TCPControlUnitRun WeissHapticUnitAppRun HapticObserverAppRun RobotControlRun RobotControlUIRun KinematicUnitObserverRun KinematicUnitSimulationRun PlatformUnitSimulationRun PlatformUnitObserverRun RobotStateComponentRun HandUnitSimulationRun ForceTorqueUnitSimulationRun XsensIMUAppRun InertialMeasurementUnitObserverAppRun ViewSelectionAppRun']

        INTERFACE_DIRS : ['/home/waechter/armarx/RobotAPI/source']

        DEPENDENCIES : ['ArmarXCore', 'ArmarXGui']

        SOURCE_PACKAGE_DEPENDENCIES : ['ArmarXCore', 'ArmarXGui']

        PACKAGE_DEPENDENCY_PATHS : ['ArmarXCore:/home/waechter/armarx/ArmarXCore/build', 'ArmarXGui:/home/waechter/armarx/ArmarXGui/build']

findSymbol command

Use the following command to find a symbol in any of the ArmarX packages by specifying the top level package. ArmarX dependency will automatically searched as well. This command is useful if you are facing undefined reference. Just pass the undefined reference to this command (or a part of it) and all package libs will be searched for it.

${ArmarXHome}/ArmarXCore/build/bin/armarx-dev findSymbol -p packagename -s symbolname

For example:

armarx findSymbol -p VisionX -s "memoryx::ObjectInstance::ObjectInstance("

The result output might look like this:

Ice Config: /home/waechter/.armarx/default.cfg
Profile: default
Searching for memoryx::ObjectInstance::ObjectInstance(
Searching in the following projects: ['ArmarXCore', 'ArmarXGui', 'RobotAPI', 'MemoryX', 'VisionX']
Found 4 matching symbol(s) in package MemoryX in file /home/waechter/armarx/MemoryX/build/lib/libMemoryXMemoryTypes.so.0.6.0
#1: memoryx::ObjectInstance::ObjectInstance(memoryx::ObjectInstance const&)
#2: memoryx::ObjectInstance::ObjectInstance(std::string const&, std::string const&)
#3: memoryx::ObjectInstance::ObjectInstance(memoryx::ObjectInstance const&)
#4: memoryx::ObjectInstance::ObjectInstance(std::string const&, std::string const&)