Skip to content

Commit

Permalink
Use rospy and setup.py to manage shebangs for Python 2 and Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
robustify committed Oct 14, 2020
1 parent 7bb50c5 commit f3a5618
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(CMAKE_BUILD_TYPE "RELEASE")

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
pcl_ros
geodesy
nmea_msgs
Expand All @@ -21,6 +22,7 @@ find_package(catkin REQUIRED COMPONENTS
ndt_omp
fast_gicp
)
catkin_python_setup()

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
Expand Down Expand Up @@ -124,3 +126,10 @@ target_link_libraries(hdl_graph_slam_nodelet
)
add_dependencies(hdl_graph_slam_nodelet ${PROJECT_NAME}_gencpp)

catkin_install_python(
PROGRAMS
src/${PROJECT_NAME}/bag_player.py
src/${PROJECT_NAME}/ford2bag.py
src/${PROJECT_NAME}/map2odom_publisher.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
25 changes: 16 additions & 9 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package>
<package format="3">
<name>hdl_graph_slam</name>
<version>0.0.0</version>
<description>The hdl_graph_slam package</description>
Expand All @@ -13,21 +13,28 @@
<build_depend>fast_gicp</build_depend>
<build_depend>pcl_ros</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>nodelet</build_depend>
<build_depend>geodesy</build_depend>
<build_depend>nmea_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>libg2o</build_depend>

<run_depend>ndt_omp</run_depend>
<run_depend>fast_gicp</run_depend>
<run_depend>pcl_ros</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>geodesy</run_depend>
<run_depend>nodelet</run_depend>
<run_depend>nmea_msgs</run_depend>
<run_depend>sensor_msgs</run_depend>
<exec_depend>ndt_omp</exec_depend>
<exec_depend>fast_gicp</exec_depend>
<exec_depend>pcl_ros</exec_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>geodesy</exec_depend>
<exec_depend>nodelet</exec_depend>
<exec_depend>nmea_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>

<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-scipy</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-scipy</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-progressbar</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-progressbar</exec_depend>

<export>
<nodelet plugin="${prefix}/nodelet_plugins.xml" />
Expand Down
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from setuptools import setup
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['hdl_graph_slam'],
package_dir={'': 'src'})

setup(**setup_args)

Empty file added src/hdl_graph_slam/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f3a5618

Please sign in to comment.