srothh / ppmrob

ROS drone control
0 stars 0 forks source link

common module #19

Open lazafi opened 7 months ago

lazafi commented 7 months ago

To be able to share code between modules, I have created a new module called "common" in branch "drone".

for now it contains:

usage

in package.xml

  <build_depend>common</build_depend>
  <exec_depend>common</exec_depend>

Use depend as a shortcut for packages that are both build and exec dependencies: <depend>common</depend> is equivalent to the 2 lines above.

in python files

import common.config.defaults
...
self._publish_to_topic = common.config.defaults.drone_twist_sensor_publish_topic_name

to be able to use it inside the Docker containers, we have to find a way to copy the common module alongside of the current node inside the catkin_workspace in the container. any thoughts on this?

srothh commented 7 months ago

I cannot try it right now, but maybe something like this would work ? (using multiple copy statements for the 2 directories and using the parent as context). https://stackoverflow.com/a/45353241