Skip to content

Commit

Permalink
adding ROS files
Browse files Browse the repository at this point in the history
  • Loading branch information
mchenryc committed Apr 10, 2014
1 parent 9b835b2 commit bae11db
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.3)
project(cfclient)
find_package(catkin REQUIRED)
catkin_package()
catkin_python_setup()
install(PROGRAMS bin/cfclient bin/cfheadless
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
25 changes: 25 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<package>
<!-- Changed the name to cfclient to avoid '_', as, when installed,
python converts them to '-' which are not allowed in catkin pkgs.
This prevents get_distribution from working, and retriving version
as specified in setup.py -->
<name>cfclient</name>
<version>2014.04.9001</version>
<description>Bitcraze Cazyflie nano quadcopter client</description>

<url type="website">https://github.com/mchenryc/crazyflie_clients_python</url>
<license>GPL</license>

<author email="[email protected]">Bitcraze team</author>
<maintainer email="[email protected]">Chadwick McHenry</maintainer>

<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- Use test_depend for packages you need only for testing: -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>

</package>
27 changes: 20 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@
setup_args=dict(
scripts=['bin/cfclient', 'bin/cfheadless'])

with open(os.path.join(os.path.dirname(__file__),
"lib",
"cfclient",
"version.py"), "w") as versionpy:
versionpy.write("VERSION='{}'".format(VERSION))

setup(name='cfclient',
#Initial parameters
setup_args=dict(name='cfclient',
description='Bitcraze Cazyflie nano quadcopter client',
version=VERSION,
author='Bitcraze team',
Expand Down Expand Up @@ -83,6 +78,24 @@
glob.glob('lib/cfclient/*.png'))],
**setup_args)

#Fetch values from package.xml when using catkin
import os
if os.getenv('CATKIN_TEST_RESULTS_DIR'):
from catkin_pkg.python_setup import generate_distutils_setup
#Delete keys which should not match catkin packaged variant
for k in ('version', 'url'):
setup_args.pop(k, None)
setup_args=generate_distutils_setup(**setup_args)

#Write a temp file to pass version into script
with open(os.path.join(os.path.dirname(__file__),
"lib",
"cfclient",
"version.py"), "w") as versionpy:
versionpy.write("VERSION='{}'".format(VERSION))

setup(**setup_args)

os.remove(os.path.join(os.path.dirname(__file__),
"lib",
"cfclient",
Expand Down

0 comments on commit bae11db

Please sign in to comment.