I have packages as follows:
package_A/
|-- msg/
|-- CustomMsg.msg
\-- ... (other messages)
|-- include/ ... (some code)
|-- src/ ... (some Python and C++ code)
package_B/ ... (also depends on package_A/CustomMsg.msg)
my_msgs/
|-- msg/ ... (some messages; one depends on package_A/CustomMsg.msg)
\-- ... (srv and action definitions that depend on msg)
my_package_1/ ... (depends on my_msgs)
my_package_2/ ... (depends on my_msgs)
I'm working in Melodic and I have some bag data, pkl files, etc., but unfortunately, I need to work with that data in another distro where it's infeasible for me to setup my workspace again (package_A
and package_B
won't build because of various dependencies, for example). The way I see it, I have 2 options:
Option 1:
I only need the messages built to work with my data, but I cannot figure out a way to get catkin to only build the message targets and ignore the code that comes in package_A
. Is there a way to do this?
CMake doesn't come naturally to me, so when trying to build catkin build package_A_generate_messages
failed, I decided to come here for help. If there is a way to build just CustomMsg.msg
, even better!
Option 2:
I know that you can work across distros if the message hashes remain unchanged. But I don't know how those hashes are generated. Is the package name taken into account? I think the answer is yes, but wanted to check what else might be. CustomMsg.msg
actually has a pretty simple message definition, so if I redefine the message in my own (faux) package called package_A on the other machine and build, will I end up with the same hash, which will then allow me to reuse my data files?
Originally posted by banerjs on ROS Answers with karma: 5 on 2019-07-30
Post score: 0
Original comments
Comment by pcoenen on 2019-07-30:
I don't know if there is a way to force catkin to only generate messages, but you could comment out all the add_executable/library/dependencies and target_link_libraries in your packages CMakeLists.txt.
Comment by banerjs on 2019-07-30:
Yeah, that's essentially what I'm doing with option 2. I think it seems to be working; I'll post back here when I'm sure. Thanks!