-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of using custom messages in the ros project #10
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Michael Carroll <[email protected]>
There is this part: gz_msgs_generate_messages(
# The cmake target to be generated for libraries/executables to link
TARGET msgs And then further on: target_link_libraries(FullSystem PRIVATE
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
ros_gz_example_gazebo-msgs
) Doest that mean that the If so, I think this should be explicitly mentioned. target_link_libraries(FullSystem PRIVATE
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
# Downstream libraries/executables using custom messages
# need to link with the custom message library.
# The name of this library is the concatenation of the project name and
# the target name as specified in the gz_msgs_generate_messages() call
# (in this example 'ros_gz_example_gazebo' and 'msgs'):
ros_gz_example_gazebo-msgs
) |
In this example the custom messages and the system plugin that uses them are in the same package. However in a ROS / Gazebo setting it is typically a more common use case that the messages and systems are in different packages, and the downstream package calls ament_target_dependencies(my_system
PUBLIC
custom_messages_package
gz-transport${GZ_TRANSPORT_VER}
gz-sim${GZ_SIM_VER}
rclcpp
#possible other dependencies
) I am trying this for my project, and it seems that an extra statement is needed in the ament_export_include_directories(include) I am not sure if this is the correct/recommended way to do this, as the documentation states that this should be 'superfluous':
Also note that in my case it seems I need:
as opposed to:
I think it would be valuable to extend this example to also cover this use case. |
Above did not work, I did not manage to get it to link. After another 2h of toiling and plodding, I finally have a working I conclude that it is not intended to use
|
It would be great if there were more documentation on the use of CMake / ament for ROS and Gazebo, as currently one has to resort to copy-paste and trial-and-error until it works. |
No description provided.