User Tools

Site Tools


# Creating your own package

We've been given some practical work on ROS, but the instructions were focused on _ROS Electric_ and rosbuild, so we spent some time trying to figure out how to use catkin and its workspace mechanism.

  mkdir -p workspace/src
  cd ./workspace/src
  catkin_create_pkg myPackage roscpp ## Add dependencies, separated with spaces here, like: std_msgs rospy ...
  # Time to do stuff here, like creating a main or whatever...
  cd ./myPackage
  vim ./src/main.cpp
  # Time to add our file to the build list
  vim CMakeList.txt
  # Let's say from here, that's we've name our executable myExec
  cd ../../

Now, if you want to be able to use you workspace with rosrun and stuff _without installing it, it's time to source another setup.bash, `source workspace/devel/setup.bash`

Time to run =) `rosrun myPackage myExec`

/home/share/www/ · Last modified: 2023/11/24 21:55 by