Once the project is set up it is time to run the project.
Step one is to set up the environment to use this ROS project.
- In the root folder of the project.
catkin_make
source devel/setup.bash
This will configure your terminal to use these project files going forwards. If you want to run a different project then you will need the source the setup file for that project before it will work.
catkin_make
should only need to be run once.
source devel/setup.bash
will need to be run in each new terminal window.
Once you have sourced your project you need to compile it.
ROS uses a system called catkin to compile all of the individual modules for you.
- In the root folder of the project.
catkin_make
With you code compiled you are now able to run the various ROS nodes of your project.
There are two ways to do this.
- Manually.
- Using a launch file.
Manually is not recommended but is sometimes needed during development.
- Run
roscore
in one terminal. - Run the individual ROS nodes you require using the
rosrun
command.- Follow the ROS tutorials if you want to know how.
Using a launch file.
- Run
roslaunch example.launch
- All of the ROS nodes will be run for you.
In this training we are going to be using launch files.
- Make sure that Webots is already running.
- The
simple_2022.wbt
world is open. - The robot controller is set to
<extern>
.
- The
- Run
roslaunch launch/simulation_autostart.launch
. - The simulated vehicle should start moving.