Skip to content

Commit

Permalink
port to ROS2
Browse files Browse the repository at this point in the history
fix ROS2 message type

Make geometry_msgs findable by CMake

update dependencies
  • Loading branch information
SyZbidi committed Mar 6, 2024
1 parent efd9900 commit f59d460
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 73 deletions.
80 changes: 23 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,64 +1,30 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.8)
project(cartesian_control_msgs)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
actionlib_msgs
geometry_msgs
message_generation
)

################################################
## Declare ROS messages, services and actions ##
################################################

add_message_files(
FILES
CartesianPosture.msg
CartesianTolerance.msg
CartesianTrajectory.msg
CartesianTrajectoryPoint.msg
)

# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

add_action_files(
FILES
FollowCartesianTrajectory.action
)

## Generate added messages and services with any dependencies listed here
generate_messages(
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(action_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"action/FollowCartesianTrajectory.action"
"msg/CartesianPosture.msg"
"msg/CartesianTolerance.msg"
"msg/CartesianTrajectory.msg"
"msg/CartesianTrajectoryPoint.msg"
DEPENDENCIES
actionlib_msgs
action_msgs
builtin_interfaces
geometry_msgs
std_msgs
)

ament_export_dependencies(rosidl_default_runtime)

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES cartesian_control_msgs
CATKIN_DEPENDS
actionlib_msgs
geometry_msgs
message_runtime
# DEPENDS system_lib
)
ament_package()
4 changes: 2 additions & 2 deletions action/FollowCartesianTrajectory.action
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CartesianTrajectory trajectory
CartesianTolerance path_tolerance
CartesianTolerance goal_tolerance
duration goal_time_tolerance
builtin_interfaces/Duration goal_time_tolerance

---

Expand All @@ -18,7 +18,7 @@ string error_string

---

Header header
std_msgs/Header header
string tcp_frame
CartesianTrajectoryPoint desired
CartesianTrajectoryPoint actual
Expand Down
2 changes: 1 addition & 1 deletion msg/CartesianTrajectory.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# header.frame_id is the frame in which all data from CartesianTrajectoryPoint[] is given
Header header
std_msgs/Header header
CartesianTrajectoryPoint[] points
string controlled_frame
2 changes: 1 addition & 1 deletion msg/CartesianTrajectoryPoint.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
duration time_from_start
builtin_interfaces/Duration time_from_start
geometry_msgs/Pose pose
geometry_msgs/Twist twist
geometry_msgs/Accel acceleration
Expand Down
21 changes: 9 additions & 12 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package format="2">
<package format="3">
<name>cartesian_control_msgs</name>
<version>0.1.0</version>
<description>Cartesian trajectory execution interface.</description>
Expand All @@ -13,19 +13,16 @@

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


<buildtool_depend>catkin</buildtool_depend>

<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>

<depend>actionlib_msgs</depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<depend>action_msgs</depend>
<depend>builtin_interfaces</depend>
<depend>geometry_msgs</depend>
<depend>std_msgs</depend>
<exec_depend>rosidl_default_runtime</exec_depend>


<!-- The export tag contains other, unspecified, tags -->
<member_of_group>rosidl_interface_packages</member_of_group>
<export>
<!-- Other tools can request additional information be placed here -->

<build_type>ament_cmake</build_type>
</export>
</package>

0 comments on commit f59d460

Please sign in to comment.