Ask Your Question
0

[ROS2] Do these package.xml and CMakeLists.txt tags have alternatives in ament and colcon builds for ROS2?

asked 2020-07-17 09:57:51 -0600

Jaroan gravatar image

updated 2020-07-20 03:00:36 -0600

Hello,

I am trying to port a package.xml and CMakeLists files from ros1 to ros2. I have this tag in the original XML file

<build_export_depend>roscpp</build_export_depend>

Is there an alternative for this in ros2 with rclcpp and ament?

Also, the CMakeLists.txt file has

SET_SOURCE_FILES_PROPERTIES(src/file.c PROPERTIES LANGUAGE CXX)

add_dependencies(<target> ${PROJECT_NAME}_gencfg ${catkin_EXPORTED_TARGETS})

I wanted to know if there are any alternatives in ROS2

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-07-20 05:45:21 -0600

mgruhler gravatar image

I have this tag in the original XML file

<build_export_depend>roscpp</build_export_depend>

Is there an alternative for this in ros2 with rclcpp and ament?

This is in the package.xml and a tag of the format 2 version. According to the migration guide ROS2 support package.xmls of the format 2 and higher versions. So you should be good to go.

SET_SOURCE_FILES_PROPERTIES and add_dependencies are actually cmake functions and thus, there is no ROS2 alternative.

However, you can use ament_target_dependencies instead of the add_dependencies call, which is an easier way to handle that.

I suggest you thoroughly work through the migration guide linked above.

edit flag offensive delete link more

Comments

Thank you, I was referring to that site, but I didn't find some specific instructions. I'll go through them again

Jaroan gravatar image Jaroan  ( 2020-07-21 00:15:53 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-07-17 09:57:51 -0600

Seen: 222 times

Last updated: Jul 20 '20