I've got a package defining messages for rosserial. After changing a message, I need to deploy (copy) the changes to a folder containing generated messages for an Arduino board. Is there a (clean) way to add custom actions to the rosbuild system? For now I'm assuming I could modify Makefile in my message-defining-package adding the actions I need after the call:
include $(shell rospack find mk)/cmake.mk
but won't it get overwritten in some case and is it the right way to do it? I've got a deploy script and would like to call it from somewhere.
I'm not sure that it's the correct answer, but I think you should rather edit the CMakeLists.txt than the Makefile.
You can add a custom command to your CMakeLists.txt using this line:
EXECUTE_PROCESS(COMMAND "${PROJECT_SOURCE_DIR}/your_script.sh")
Hope this helps.
You can use add_custom_target(), e.g.:
# Declare a custom target that will do the copy when the 'all' target fires
add_custom_target(deploy ALL
COMMAND cp $(CMAKE_SOURCE_DIR)/undeployed /tmp/deployed)
# Declare a dependency on the 'rosbuild_precompile' target, to ensure
# that message generation happens before we copy.
add_dependencies(deploy rosbuild_precompile)
Asked: 2011-09-08 02:39:39 -0500
Seen: 155 times
Last updated: Sep 08 '11
Rosserial/Arduino Publishers and Subscribers
Will the RosSerial client reconnect?
Problem setting up rosserial_arduino
rosserial debs for rosserial_arduino
rosserial lost sync with device
rosserial spinOnce() blocks if not connected to ROS
rosserial - losing sync when running servo example [closed]
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.