Skip to content

Commit 29bc545

Browse files
authored
port to ROS2 (#5)
fix ROS2 message type Make geometry_msgs findable by CMake update dependencies
1 parent a54be5c commit 29bc545

File tree

5 files changed

+36
-73
lines changed

5 files changed

+36
-73
lines changed

CMakeLists.txt

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,30 @@
1-
cmake_minimum_required(VERSION 3.0.2)
1+
cmake_minimum_required(VERSION 3.8)
22
project(cartesian_control_msgs)
33

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-
actionlib_msgs
12-
geometry_msgs
13-
message_generation
14-
)
15-
16-
################################################
17-
## Declare ROS messages, services and actions ##
18-
################################################
19-
20-
add_message_files(
21-
FILES
22-
CartesianPosture.msg
23-
CartesianTolerance.msg
24-
CartesianTrajectory.msg
25-
CartesianTrajectoryPoint.msg
26-
)
27-
28-
# add_service_files(
29-
# FILES
30-
# Service1.srv
31-
# Service2.srv
32-
# )
33-
34-
add_action_files(
35-
FILES
36-
FollowCartesianTrajectory.action
37-
)
38-
39-
## Generate added messages and services with any dependencies listed here
40-
generate_messages(
4+
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5+
add_compile_options(-Wall -Wextra -Wpedantic)
6+
endif()
7+
8+
find_package(ament_cmake REQUIRED)
9+
find_package(action_msgs REQUIRED)
10+
find_package(builtin_interfaces REQUIRED)
11+
find_package(geometry_msgs REQUIRED)
12+
find_package(rosidl_default_generators REQUIRED)
13+
find_package(std_msgs REQUIRED)
14+
15+
rosidl_generate_interfaces(${PROJECT_NAME}
16+
"action/FollowCartesianTrajectory.action"
17+
"msg/CartesianPosture.msg"
18+
"msg/CartesianTolerance.msg"
19+
"msg/CartesianTrajectory.msg"
20+
"msg/CartesianTrajectoryPoint.msg"
4121
DEPENDENCIES
42-
actionlib_msgs
22+
action_msgs
23+
builtin_interfaces
4324
geometry_msgs
25+
std_msgs
4426
)
4527

28+
ament_export_dependencies(rosidl_default_runtime)
4629

47-
###################################
48-
## catkin specific configuration ##
49-
###################################
50-
## The catkin_package macro generates cmake config files for your package
51-
## Declare things to be passed to dependent projects
52-
## INCLUDE_DIRS: uncomment this if your package contains header files
53-
## LIBRARIES: libraries you create in this project that dependent projects also need
54-
## CATKIN_DEPENDS: catkin_packages dependent projects also need
55-
## DEPENDS: system dependencies of this project that dependent projects also need
56-
catkin_package(
57-
# INCLUDE_DIRS include
58-
# LIBRARIES cartesian_control_msgs
59-
CATKIN_DEPENDS
60-
actionlib_msgs
61-
geometry_msgs
62-
message_runtime
63-
# DEPENDS system_lib
64-
)
30+
ament_package()

action/FollowCartesianTrajectory.action

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CartesianTrajectory trajectory
22
CartesianTolerance path_tolerance
33
CartesianTolerance goal_tolerance
4-
duration goal_time_tolerance
4+
builtin_interfaces/Duration goal_time_tolerance
55

66
---
77

@@ -18,7 +18,7 @@ string error_string
1818

1919
---
2020

21-
Header header
21+
std_msgs/Header header
2222
string tcp_frame
2323
CartesianTrajectoryPoint desired
2424
CartesianTrajectoryPoint actual

msg/CartesianTrajectory.msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# header.frame_id is the frame in which all data from CartesianTrajectoryPoint[] is given
2-
Header header
2+
std_msgs/Header header
33
CartesianTrajectoryPoint[] points
44
string controlled_frame

msg/CartesianTrajectoryPoint.msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
duration time_from_start
1+
builtin_interfaces/Duration time_from_start
22
geometry_msgs/Pose pose
33
geometry_msgs/Twist twist
44
geometry_msgs/Accel acceleration

package.xml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<package format="2">
2+
<package format="3">
33
<name>cartesian_control_msgs</name>
44
<version>0.1.0</version>
55
<description>Cartesian trajectory execution interface.</description>
@@ -13,19 +13,16 @@
1313

1414
<author email="[email protected]">Felix Exner</author>
1515

16-
17-
<buildtool_depend>catkin</buildtool_depend>
18-
19-
<build_depend>message_generation</build_depend>
20-
<exec_depend>message_runtime</exec_depend>
21-
22-
<depend>actionlib_msgs</depend>
16+
<buildtool_depend>ament_cmake</buildtool_depend>
17+
<buildtool_depend>rosidl_default_generators</buildtool_depend>
18+
<depend>action_msgs</depend>
19+
<depend>builtin_interfaces</depend>
2320
<depend>geometry_msgs</depend>
21+
<depend>std_msgs</depend>
22+
<exec_depend>rosidl_default_runtime</exec_depend>
2423

25-
26-
<!-- The export tag contains other, unspecified, tags -->
24+
<member_of_group>rosidl_interface_packages</member_of_group>
2725
<export>
28-
<!-- Other tools can request additional information be placed here -->
29-
26+
<build_type>ament_cmake</build_type>
3027
</export>
3128
</package>

0 commit comments

Comments
 (0)