Skip to content

Commit 4a6e98f

Browse files
committed
Initial Commit
0 parents  commit 4a6e98f

File tree

6 files changed

+293
-0
lines changed

6 files changed

+293
-0
lines changed

CMakeLists.txt

+197
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(ros-utils)
3+
4+
## Compile as C++11, supported in ROS Kinetic and newer
5+
# add_compile_options(-std=c++11)
6+
7+
## Find catkin macros and libraries
8+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
9+
## is used, also find other catkin packages
10+
find_package(catkin REQUIRED COMPONENTS
11+
rospy
12+
)
13+
14+
## System dependencies are found with CMake's conventions
15+
# find_package(Boost REQUIRED COMPONENTS system)
16+
17+
18+
## Uncomment this if the package has a setup.py. This macro ensures
19+
## modules and global scripts declared therein get installed
20+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
21+
catkin_python_setup()
22+
23+
################################################
24+
## Declare ROS messages, services and actions ##
25+
################################################
26+
27+
## To declare and build messages, services or actions from within this
28+
## package, follow these steps:
29+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
30+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
31+
## * In the file package.xml:
32+
## * add a build_depend tag for "message_generation"
33+
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
34+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
35+
## but can be declared for certainty nonetheless:
36+
## * add a run_depend tag for "message_runtime"
37+
## * In this file (CMakeLists.txt):
38+
## * add "message_generation" and every package in MSG_DEP_SET to
39+
## find_package(catkin REQUIRED COMPONENTS ...)
40+
## * add "message_runtime" and every package in MSG_DEP_SET to
41+
## catkin_package(CATKIN_DEPENDS ...)
42+
## * uncomment the add_*_files sections below as needed
43+
## and list every .msg/.srv/.action file to be processed
44+
## * uncomment the generate_messages entry below
45+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
46+
47+
## Generate messages in the 'msg' folder
48+
# add_message_files(
49+
# FILES
50+
# Message1.msg
51+
# Message2.msg
52+
# )
53+
54+
## Generate services in the 'srv' folder
55+
# add_service_files(
56+
# FILES
57+
# Service1.srv
58+
# Service2.srv
59+
# )
60+
61+
## Generate actions in the 'action' folder
62+
# add_action_files(
63+
# FILES
64+
# Action1.action
65+
# Action2.action
66+
# )
67+
68+
## Generate added messages and services with any dependencies listed here
69+
# generate_messages(
70+
# DEPENDENCIES
71+
# std_msgs # Or other packages containing msgs
72+
# )
73+
74+
################################################
75+
## Declare ROS dynamic reconfigure parameters ##
76+
################################################
77+
78+
## To declare and build dynamic reconfigure parameters within this
79+
## package, follow these steps:
80+
## * In the file package.xml:
81+
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
82+
## * In this file (CMakeLists.txt):
83+
## * add "dynamic_reconfigure" to
84+
## find_package(catkin REQUIRED COMPONENTS ...)
85+
## * uncomment the "generate_dynamic_reconfigure_options" section below
86+
## and list every .cfg file to be processed
87+
88+
## Generate dynamic reconfigure parameters in the 'cfg' folder
89+
# generate_dynamic_reconfigure_options(
90+
# cfg/DynReconf1.cfg
91+
# cfg/DynReconf2.cfg
92+
# )
93+
94+
###################################
95+
## catkin specific configuration ##
96+
###################################
97+
## The catkin_package macro generates cmake config files for your package
98+
## Declare things to be passed to dependent projects
99+
## INCLUDE_DIRS: uncomment this if your package contains header files
100+
## LIBRARIES: libraries you create in this project that dependent projects also need
101+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
102+
## DEPENDS: system dependencies of this project that dependent projects also need
103+
catkin_package(
104+
# INCLUDE_DIRS include
105+
# LIBRARIES ros-utils
106+
# CATKIN_DEPENDS rospy
107+
# DEPENDS system_lib
108+
)
109+
110+
###########
111+
## Build ##
112+
###########
113+
114+
## Specify additional locations of header files
115+
## Your package locations should be listed before other locations
116+
include_directories(
117+
# include
118+
${catkin_INCLUDE_DIRS}
119+
)
120+
121+
## Declare a C++ library
122+
# add_library(${PROJECT_NAME}
123+
# src/${PROJECT_NAME}/ros-utils.cpp
124+
# )
125+
126+
## Add cmake target dependencies of the library
127+
## as an example, code may need to be generated before libraries
128+
## either from message generation or dynamic reconfigure
129+
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
130+
131+
## Declare a C++ executable
132+
## With catkin_make all packages are built within a single CMake context
133+
## The recommended prefix ensures that target names across packages don't collide
134+
# add_executable(${PROJECT_NAME}_node src/ros-utils_node.cpp)
135+
136+
## Rename C++ executable without prefix
137+
## The above recommended prefix causes long target names, the following renames the
138+
## target back to the shorter version for ease of user use
139+
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
140+
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
141+
142+
## Add cmake target dependencies of the executable
143+
## same as for the library above
144+
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
145+
146+
## Specify libraries to link a library or executable target against
147+
# target_link_libraries(${PROJECT_NAME}_node
148+
# ${catkin_LIBRARIES}
149+
# )
150+
151+
#############
152+
## Install ##
153+
#############
154+
155+
# all install targets should use catkin DESTINATION variables
156+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
157+
158+
## Mark executable scripts (Python etc.) for installation
159+
## in contrast to setup.py, you can choose the destination
160+
# install(PROGRAMS
161+
# scripts/my_python_script
162+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
163+
# )
164+
165+
## Mark executables and/or libraries for installation
166+
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
167+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
168+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
169+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
170+
# )
171+
172+
## Mark cpp header files for installation
173+
# install(DIRECTORY include/${PROJECT_NAME}/
174+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
175+
# FILES_MATCHING PATTERN "*.h"
176+
# PATTERN ".svn" EXCLUDE
177+
# )
178+
179+
## Mark other files for installation (e.g. launch and bag files, etc.)
180+
# install(FILES
181+
# # myfile1
182+
# # myfile2
183+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
184+
# )
185+
186+
#############
187+
## Testing ##
188+
#############
189+
190+
## Add gtest based cpp test target and link libraries
191+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ros-utils.cpp)
192+
# if(TARGET ${PROJECT_NAME}-test)
193+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
194+
# endif()
195+
196+
## Add folders to be run by python nosetests
197+
# catkin_add_nosetests(test)

include/ros_utils/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .utils import *
824 Bytes
Binary file not shown.

include/ros_utils/utils.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import rospy
2+
3+
4+
def ROS_DEBUG( msg, *args ):
5+
return rospy.logdebug( msg, *args )
6+
7+
8+
def ROS_INFO( msg, *args ):
9+
return rospy.loginfo( msg, *args )
10+
11+
12+
def ROS_WARN( msg, *args ):
13+
return rospy.logwarn( msg, *args )
14+
15+
16+
def ROS_ERR( msg, *args ):
17+
return rospy.logerr( msg, *args )
18+
19+
20+
def ROS_FATAL( msg, *args ):
21+
return rospy.logfatal( msg, *args )

package.xml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>ros-utils</name>
4+
<version>0.0.0</version>
5+
<description>The ros-utils package</description>
6+
7+
<!-- One maintainer tag required, multiple allowed, one person per tag -->
8+
<!-- Example: -->
9+
<!-- <maintainer email="[email protected]">Jane Doe</maintainer> -->
10+
<maintainer email="[email protected]">ripl</maintainer>
11+
12+
13+
<!-- One license tag required, multiple allowed, one license per tag -->
14+
<!-- Commonly used license strings: -->
15+
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
16+
<license>TODO</license>
17+
18+
19+
<!-- Url tags are optional, but multiple are allowed, one per tag -->
20+
<!-- Optional attribute type can be: website, bugtracker, or repository -->
21+
<!-- Example: -->
22+
<!-- <url type="website">http://wiki.ros.org/ros-utils</url> -->
23+
24+
25+
<!-- Author tags are optional, multiple are allowed, one per tag -->
26+
<!-- Authors do not have to be maintainers, but could be -->
27+
<!-- Example: -->
28+
<!-- <author email="[email protected]">Jane Doe</author> -->
29+
30+
31+
<!-- The *depend tags are used to specify dependencies -->
32+
<!-- Dependencies can be catkin packages or system dependencies -->
33+
<!-- Examples: -->
34+
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
35+
<!-- <depend>roscpp</depend> -->
36+
<!-- Note that this is equivalent to the following: -->
37+
<!-- <build_depend>roscpp</build_depend> -->
38+
<!-- <exec_depend>roscpp</exec_depend> -->
39+
<!-- Use build_depend for packages you need at compile time: -->
40+
<!-- <build_depend>message_generation</build_depend> -->
41+
<!-- Use build_export_depend for packages you need in order to build against this package: -->
42+
<!-- <build_export_depend>message_generation</build_export_depend> -->
43+
<!-- Use buildtool_depend for build tool packages: -->
44+
<!-- <buildtool_depend>catkin</buildtool_depend> -->
45+
<!-- Use exec_depend for packages you need at runtime: -->
46+
<!-- <exec_depend>message_runtime</exec_depend> -->
47+
<!-- Use test_depend for packages you need only for testing: -->
48+
<!-- <test_depend>gtest</test_depend> -->
49+
<!-- Use doc_depend for packages you need only for building documentation: -->
50+
<!-- <doc_depend>doxygen</doc_depend> -->
51+
<buildtool_depend>catkin</buildtool_depend>
52+
<build_depend>rospy</build_depend>
53+
<build_export_depend>rospy</build_export_depend>
54+
<exec_depend>rospy</exec_depend>
55+
56+
57+
<!-- The export tag contains other, unspecified, tags -->
58+
<export>
59+
<!-- Other tools can request additional information be placed here -->
60+
61+
</export>
62+
</package>

setup.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
2+
3+
from distutils.core import setup
4+
from catkin_pkg.python_setup import generate_distutils_setup
5+
6+
# fetch values from package.xml
7+
setup_args = generate_distutils_setup(
8+
packages=['ros_utils'],
9+
package_dir={'': 'include'}
10+
)
11+
12+
setup(**setup_args)

0 commit comments

Comments
 (0)