Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Accessing install directory from a custom caktin tools verb

I would like to create my own verb called 'rsync' that deploys cross-compiled ROS packages on a destination target device using ssh over rsync. In order to do so, I need to access the install directory for my current build profile.

As per the instructions I have created a python script rsync.py that looks something like this.

#!/usr/bin/env python

import os

def main(opts):
  for target in opts.targets:
    os.system("rsync -avz -e ssh  " + install_dir + " " + target)
  return 0

def prepare_arguments(parser):
  add = parser.add_argument
  # What packages to build
  add('targets', nargs='*',
    help='List of target names to rsync the files to.')
  add('--no-bias', action='store_true', default=True,
    help='Don\'t copy the IMU bias file')
  return parser

description = dict(
  verb='rsync',
  description="Deploy products to the robot over rsync",
  main=main,
  prepare_arguments=prepare_arguments
)

My issue is that I cannot set the install_dir variable in the main function to the correct value for the current build profile. Does catkin tools provide a python module that I can get this information from?

Accessing install directory from a custom caktin tools verb

I would like to create my own verb called 'rsync' that deploys cross-compiled ROS packages on a destination target device using ssh over rsync. In order to do so, I need to access the install directory for my current build profile.

As per the instructions I have created a python script rsync.py that looks something like this.

#!/usr/bin/env python

import os

def main(opts):
  for target in opts.targets:
    os.system("rsync -avz -e ssh  " + install_dir + " " + target)
  return 0

def prepare_arguments(parser):
  add = parser.add_argument
  # What packages to build
  add('targets', nargs='*',
    help='List of target names to rsync the files to.')
  add('--no-bias', action='store_true', default=True,
    help='Don\'t copy the IMU bias file')
  return parser

description = dict(
  verb='rsync',
  description="Deploy products to the robot over rsync",
  main=main,
  prepare_arguments=prepare_arguments
)

My issue is that I cannot set the install_dir variable in the main function to the correct value for the current build profile. Does catkin tools provide a python module that I can get this information from?