You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
catkin_create_pkg <node_name><dependencies># for example
catkin_create_pkg relay_board rospy std_msgs bruin2_msgs
I strongly recommend using those three dependencies for new packages. Create all msg files in bruin2_msgs to simplify things.
Alterations
You must create a file setup.py in the root of the new package with the following contents:
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEADfromdistutils.coreimportsetupfromcatkin_pkg.python_setupimportgenerate_distutils_setup# fetch values from package.xmlsetup_args=generate_distutils_setup(
packages=['<package_name>'], # Change this line; for example 'relay_board'package_dir={'': 'src'},
)
setup(**setup_args)
You must also uncomment this line in CMakeLists.txt: catkin_python_setup()
It should be about line 23
Write your Code
You'll want a package inside the src folder that contains a main.py. For example: src > relay_board > main.py. Note that the main.py must be marked executable and contain the #!/usr/bin/env python line.