use ros commands in bash script
Hey, so I need to compile my workspace every time I add it into my computer. This proves to be very time consuming. I would like to write a script that runs these commands:
roscd /directory/build
cmake ..
make
This is what I type into the terminal to compile all the directories and it works perfectly! But, when I tried just adding these commands to a script and running it I would get errors basically saying it didn't recognize the commands (i.e. roscd
). I'm not sure if I'm supposed to source something so it will recognize the commands or something.
Any help is appreciated! George
You have a good answer down there... But, I must ask... Why are you using cmake at all? With a catkin workspace, catkin builds (invoking CMake) all packages in the source directory in topological order. This is mainly for my own curiosity.
Hey, thanks for your curiosity! When we started with ROS a catkin didn't exist. Then when it did we never made the transition, but we are planning on switching over pretty soon. Even with catkin I would like to have a script because its one less thing I need to setup when I install the system!