[ROS]run DR robot in ROS - installing note1

Installation history to run DR robot in ROS
Feb 21, 2024
[ROS]run DR robot in ROS - installing note1
 
 
DR source required
ros-noetic && Ubuntu 20.04 version
ros2-foxy&& Ubuntu 20.04 version
 
 

ROS-related files and other pre-run checks

apt upgrade โ†’ Avoid using the ROS version because it is fixed
 
apt update updates the list of packages to the latest, and apt upgrade upgrades the packages currently installed on your system to the latest version. It is usually a good habit of managing packages to perform an upgrade after an update.
 
source ~/catkin_ws/devel/setup.bash โ†’ The source ~/catkin_ws/devel/setup.bash command is used to execute the contents of the setup.bash script in your ROS workspace (catkin_ws). This command is typically run in your terminal to set up the environment variables and paths required for ROS to work with the packages and executables in your workspace.
roscore โ†’ Start ros package
 
 
 

โŒ Installing ROS noetic / ROS2 foxy via Docker on Ubuntu 22.04 / Mac M2

This way can run ROS, but cannot run DR source. Beacuse DR source required ros-noetic && Ubuntu 20.04 version. So for this reason, I have to find out the other way to run DR source.

Prerequisite:

 

If your OS is a Ubuntu, pls follow this guideline

Setup your sources.list

Setup your computer to accept software from packages.ros.org.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Set up your keys

  • sudo apt install curl # if you haven't already installed curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

Installation

First, make sure your Debian package index is up-to-date:
  • sudo apt update
Now pick how much of ROS you would like to install.
  • Desktop-Full Install: (Recommended) : Everything in Desktop plus 2D/3D simulators and 2D/3D perception packages
    • sudo apt install ros-noetic-desktop-full
 

Environment setup

You must source this script in every bash terminal you use ROS in.
source /opt/ros/noetic/setup.bash
It can be convenient to automatically source this script every time a new shell is launched. These commands will do that for you.
Bash
If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc
zsh
echo "source /opt/ros/noetic/setup.zsh" >> ~/.zshrc source ~/.zshrc

Dependencies for building packages

Up to now you have installed what you need to run the core ROS packages. To create and manage your own ROS workspaces, there are various tools and requirements that are distributed separately. For example, rosinstall is a frequently used command-line tool that enables you to easily download many source trees for ROS packages with one command.
To install this tool and other dependencies for building ROS packages, run:
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

Initialize rosdep

Before you can use many ROS tools, you will need to initialize rosdeprosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. If you have not yet installed rosdep, do so as follows.
sudo apt install python3-rosdep
With the following, you can initialize rosdep.
sudo rosdep init rosdep update
 
 
 

Load Docker image from hub

Docker hub
https://hub.docker.com/_/ros/ โ†’ ROS docker images hub
 
# load image docker pull <image> # check image docker images # run Image(image -> container) # it means start and approach the container docker run -it ros:melodic-perception-bionic # check running containers list docker ps # close the container docker stop [container ID] # exit container exit
When using Docker, it is important to note that the current environment is not stored. If you want to save the current environment, you must create a new image through commit to continue use. Here, the environment setting is as follows.
## Install ROS Package # update to APT package list apt update # ROS Desktop apt install ros-melodic-desktop-full
 
If catkin cammond got some error, try this
sudo apt-get update sudo apt-get install python3-catkin-tools
 
 
 

โŒ Window 10 - Install ROS by use VS2019 & Choco package manager

This way can run ROS, but I still not found reason, this way also cannot run DR source. So for this reason, I have to find out the other way to run DR source.

Prerequisite:

  1. Reserve space for the installation
    1. Reserve 10 GB free space under clean and enpty c:\opt before proceeding.
  1. Install Visual Studio with C++ core using visual studio installer
  1. Create a new shortcut for Visual Studio CMD (Anywhere on your desktop)
 

Install Chocolatey

  • Open x64 Native Tools Command Prompt for VS 2019(Admin auth)
  • Copy and paste
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Install Git

  • Wait for previous command to finish
Choco install git -y
 

Install ROS1 noetic

notion image
  • Open x64 Native Tools Command Prompt for VS 2019(Admin auth)
  • Copy and paste
mkdir c:\opt\chocolatey set ChocolateyInstall=c:\opt\chocolatey choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1 choco upgrade ros-noetic-desktop_full -y --execution-timeout=0
 

install ROS2 foxy

Also, it doesn't matter if you install both ROS1 and ROS2 as long as you can afford storage space.
If you also want to install the ROS2 foxy, follow this
mkdir c:\opt\chocolatey set ChocolateyInstall=c:\opt\chocolatey choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1 choco upgrade ros-foxy-desktop -y --execution-timeout=0
 
 

Error

After git clone DR source in C:\opt\ros\noetic\x64\catkin_ws>src
catkin_make command got some error
-- Configuring incomplete, errors occurred! See also "C:/opt/ros/noetic/x64/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also "C:/opt/ros/noetic/x64/catkin_ws/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed
 
 
 

๐Ÿ“š Reference

  • Setting ROS by use Docker in Mac/Ubuntu
 
  • DR Open-source
 
  • Install ROS by use VS2019 & Choco package manager
RosOnWindows
Brabalawuka โ€ข Updated Feb 21, 2024
 
Share article
RSSPowered by inblog