I installed foxy because I'm on ubuntu 20.04 but i believe the instructions are fairly similar/easy: Foxy Fitzroy ros2 Distro
In order to run this program you must open CLion from a terminal that has been properly setup for ros2
- In order to have the terminal always ready upon opening, execute the following commands
- echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
- echo "export ROS_DOMAIN_ID=1" >> ~/.bashrc
- echo "export ROS_LOCALHOST_ONLY=1" >> ~/.bashrc
- These commands will append to the bottom of your .bashrc file. Now whenever you open a terminal it will be ready to use the ros packages.
-
clion /ros2Test
For example:
clion ~/CLionProjects/ros2Test