Difference between revisions of "RoboRacing Software Installation Instructions"
(→Step 8 - Initialize catkin workspace) |
Cjenkins72 (talk | contribs) (→Install ROS Noetic) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
Welcome! | Welcome! | ||
− | Robojackets RoboRacing currently supports an Ubuntu | + | Robojackets RoboRacing currently supports an Ubuntu 20.04 and ROS-noetic environment. The project may build/run in other environments, but we can't guarantee it. |
Let's begin the installation process. | Let's begin the installation process. | ||
+ | == THESE INSTRUCTIONS ARE FOR ROS1 IF YOU WANT TO FOLLOW THE ROS2 INSTRUCTIONS GO TO THIS LINK: https://wiki.robojackets.org/RoboRacing_Software_Installation_Instructions_ROS2 == | ||
− | |||
− | + | = Install ROS Noetic = | |
− | |||
− | |||
− | == Step | + | == Step 1 - ROS Installation == |
+ | We will be using the instructions found on the ROS Noetic Ubuntu [http://wiki.ros.org/noetic/Installation/Ubuntu Guide] | ||
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' <br> | ||
+ | sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 <br> | ||
+ | sudo apt update <br> | ||
+ | sudo apt install ros-noetic-desktop-full --yes <br> | ||
+ | </span></div> | ||
+ | |||
+ | == Step 2 - Environment Variable Setup == | ||
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc <br> | ||
+ | source ~/.bashrc | ||
+ | </span></div> | ||
− | + | == Step 3 - Get Terminator == | |
+ | We primarily use terminator instead of the default terminal since it allows for both horizontal and vertical splitting (which ''obviously'' increases overall productivity). Start up the default terminal and type: | ||
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
− | sudo | + | sudo apt install terminator |
− | </ | + | </span></div> |
− | + | ||
− | + | = Setup Workspace = | |
− | </div> | + | == Step 4 - Make File Structure == |
− | |||
− | |||
− | == Step | ||
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
− | + | mkdir -p ~/catkin_ws/src <br> | |
− | + | cd ~/catkin_ws/src <br> | |
− | + | git clone https://github.com/RoboJackets/roboracing-software.git --recursive | |
− | + | </span></div> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Step | + | == Step 5 - Install Dependencies == |
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | cd ~/catkin_ws <br> | ||
+ | sudo apt install python3-rosdep python-is-python3 python3-catkin-tools --yes <br> | ||
+ | rosdep install --from-path src --ignore-src -y -r <br> | ||
+ | </span></div> | ||
+ | * ''rosdep'' will download and install all of the necessary ros package dependencies | ||
+ | * -r option is there to ensure that one package failure will not prevent all other packages from being installed | ||
− | + | == Step 6 - Building the Code == | |
− | <div style=" | + | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> |
+ | catkin_make <br> | ||
+ | source ~/catkin_ws/devel/setup.bash | ||
+ | </span></div> | ||
− | + | You can run: | |
− | <div style=" | + | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> |
− | </ | + | echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc |
− | + | </span></div> | |
+ | to ensure you don't have to source this setup.bash after every compilation. | ||
− | + | If you see an error: | |
− | + | CMake Error at /opt/ros/noetic/share/catkin/cmake/empy.cmake:30 (message): | |
− | + | Unable to find either executable 'empy' or Python module 'em'... try | |
− | + | installing the package 'python3-empy' | |
− | + | Run this instead | |
− | + | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | |
− | <div style=" | + | catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3<br> |
− | + | source ~/catkin_ws/devel/setup.bash | |
− | |||
− | |||
− | |||
</span></div> | </span></div> | ||
− | + | ||
− | + | Sometimes the python location is not accurate, causing a cmake to fail. This option also works if you are using catkin build. | |
</span></div> | </span></div> | ||
− | <div style=" | + | |
− | sudo | + | == Step 7 - Dependencies Problems == |
+ | For some computers, some of our packages aren't getting installed with ''rosdep install'' so just install them manually if you have issues with them: | ||
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | sudo apt install ros-noetic-costmap-2d ros-noetic-effort-controllers ros-noetic-robot-localization | ||
</span></div> | </span></div> | ||
− | + | Ensure that your pyyaml is set to the proper version | |
− | <div style=" | + | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> |
− | + | pip install pyyaml==5.1.2 | |
+ | </span></div> | ||
− | = | + | = Run the Code = |
− | <div style=" | + | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> |
+ | roscore & | ||
+ | </span></div> | ||
*Then press [Enter] | *Then press [Enter] | ||
− | <div style=" | + | === For IARRC Simulation === |
− | * Remeber to do ''source ~/. | + | * In one terminal run: |
− | *Gazebo | + | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> |
+ | roslaunch rr_gazebo macaroni_iarrc_circuit.launch | ||
+ | </span></div> | ||
+ | * In '''another''' terminal run: | ||
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | roslaunch rr_iarrc test_circuit_sim.launch | ||
+ | </span></div> | ||
+ | |||
+ | === For EVGP Simulation === | ||
+ | * In one terminal run: | ||
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | roslaunch rr_gazebo evgp.launch | ||
+ | </span></div> | ||
+ | * In '''another''' terminal run: | ||
+ | <div style="background:#eee; border:1px solid #ccc; padding:5px 10px"><span style="font-family:courier new,courier,monospace"> | ||
+ | roslaunch rr_evgp evgp_planning_demo.launch | ||
+ | </span></div> | ||
+ | |||
+ | * Remeber to do ''source ~/catkin_ws/devel/setup.bash'' if the launch file can't be found in package (you should add this to ~/.bashrc if you haven't already) | ||
+ | * Gazebo sometimes freezes when loading right after installation so just run it, wait, kill it with [Ctrl-C], wait until it is dead, then retry! |
Latest revision as of 16:38, 21 November 2021
Welcome!
Robojackets RoboRacing currently supports an Ubuntu 20.04 and ROS-noetic environment. The project may build/run in other environments, but we can't guarantee it.
Let's begin the installation process.
Contents
THESE INSTRUCTIONS ARE FOR ROS1 IF YOU WANT TO FOLLOW THE ROS2 INSTRUCTIONS GO TO THIS LINK: https://wiki.robojackets.org/RoboRacing_Software_Installation_Instructions_ROS2
Install ROS Noetic
Step 1 - ROS Installation
We will be using the instructions found on the ROS Noetic Ubuntu Guide
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-noetic-desktop-full --yes
Step 2 - Environment Variable Setup
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Step 3 - Get Terminator
We primarily use terminator instead of the default terminal since it allows for both horizontal and vertical splitting (which obviously increases overall productivity). Start up the default terminal and type:
sudo apt install terminator
Setup Workspace
Step 4 - Make File Structure
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/RoboJackets/roboracing-software.git --recursive
Step 5 - Install Dependencies
cd ~/catkin_ws
sudo apt install python3-rosdep python-is-python3 python3-catkin-tools --yes
rosdep install --from-path src --ignore-src -y -r
- rosdep will download and install all of the necessary ros package dependencies
- -r option is there to ensure that one package failure will not prevent all other packages from being installed
Step 6 - Building the Code
catkin_make
source ~/catkin_ws/devel/setup.bash
You can run:
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
to ensure you don't have to source this setup.bash after every compilation.
If you see an error:
CMake Error at /opt/ros/noetic/share/catkin/cmake/empy.cmake:30 (message): Unable to find either executable 'empy' or Python module 'em'... try installing the package 'python3-empy'
Run this instead
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
source ~/catkin_ws/devel/setup.bash
Sometimes the python location is not accurate, causing a cmake to fail. This option also works if you are using catkin build.
Step 7 - Dependencies Problems
For some computers, some of our packages aren't getting installed with rosdep install so just install them manually if you have issues with them:
sudo apt install ros-noetic-costmap-2d ros-noetic-effort-controllers ros-noetic-robot-localization
Ensure that your pyyaml is set to the proper version
pip install pyyaml==5.1.2
Run the Code
roscore &
- Then press [Enter]
For IARRC Simulation
- In one terminal run:
roslaunch rr_gazebo macaroni_iarrc_circuit.launch
- In another terminal run:
roslaunch rr_iarrc test_circuit_sim.launch
For EVGP Simulation
- In one terminal run:
roslaunch rr_gazebo evgp.launch
- In another terminal run:
roslaunch rr_evgp evgp_planning_demo.launch
- Remeber to do source ~/catkin_ws/devel/setup.bash if the launch file can't be found in package (you should add this to ~/.bashrc if you haven't already)
- Gazebo sometimes freezes when loading right after installation so just run it, wait, kill it with [Ctrl-C], wait until it is dead, then retry!