ROS version number judgment, ubuntu20.04 Install ROS_noetic-Modify Mirror Source

Posted by patsman77 on Tue, 11 Jan 2022 18:04:54 +0100

Determine ROS Version Number - ROS Installation - Modify Mirror Source linux Version: ubuntu20.04 ROS Version: noetic

    • Determine ROS Version Number
    • Install ROS
    • Change Mirror Source

 

Determine ROS Version Number

The robot uses raspberry pie, stm32, ros.

First configure the network, plug the sd card on the robot into the raspberry pie board, and then configure the connected hot spots.

Next, insert the sd card back into the raspberry pie on the robot, turn on the hot spot, and the robot will automatically connect to the hot spot.

Using MobaXterm_Personal software, create ssh connection.

Start with a terminal, where you type roscore:

    ┌──────────────────────────────────────────────────────────────────────┐
    │                 • MobaXterm Personal Edition v21.3 •                 │
    │               (SSH client, X server and network tools)               │
    │                                                                      │
    │ ➤ SSH session to lemon@192.168.137.189                               │
    │   • Direct SSH      :  ✔                                             │
    │   • SSH compression :  ✔                                             │
    │   • SSH-browser     :  ✔                                             │
    │   • X11-forwarding  :  ✔  (remote display is forwarded through SSH)  │
    │                                                                      │
    │ ➤ For more info, ctrl+click on help or visit our website.            │
    └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1035-raspi aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage


Last login: Sun Oct 24 12:03:52 2021 from 192.168.137.1
lemon@lemon:~$ roscore
... logging to /home/lemon/.ros/log/93e79cda-3486-11ec-a274-e94615cd611d/roslaunch-lemon-1399.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://lemon:40829/
ros_comm version 1.15.9


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES

auto-starting new master
process[master]: started with pid [1436]
ROS_MASTER_URI=http://lemon:11311/

setting /run_id to 93e79cda-3486-11ec-a274-e94615cd611d
process[rosout-1]: started with pid [1462]
started core service [/rosout]

Enter rosparam list when opening another terminal

Re-enter rosparam get/rosdistro

    ┌──────────────────────────────────────────────────────────────────────┐
    │                 • MobaXterm Personal Edition v21.3 •                 │
    │               (SSH client, X server and network tools)               │
    │                                                                      │
    │ ➤ SSH session to lemon@192.168.137.189                               │
    │   • Direct SSH      :  ✔                                             │
    │   • SSH compression :  ✔                                             │
    │   • SSH-browser     :  ✔                                             │
    │   • X11-forwarding  :  ✔  (remote display is forwarded through SSH)  │
    │                                                                      │
    │ ➤ For more info, ctrl+click on help or visit our website.            │
    └──────────────────────────────────────────────────────────────────────┘

Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1035-raspi aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
Last login: Sun Oct 24 12:45:37 2021 from 192.168.137.1
lemon@lemon:~$ rosparam list
/rosdistro
/roslaunch/uris/host_lemon__40829
/rosversion
/run_id
lemon@lemon:~$ rosparam get /rosdistro
'noetic

  '

You can then discover that the current ros version is noetic. Noetic is the last long-term support version of ROS1.

Next, research on ros will continue on linux-ubuntu20. noetic version ros is configured under version 04.

Install ROS

In VMware-linux-ubuntu20.04, open the terminal and follow the steps below to enter the instructions.

1. Add ros source

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

2. Increase key

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3. If the above addition is unsuccessful, you can add key as follows

curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

4. Update software

sudo apt update

5. Install ros

sudo apt install ros-noetic-desktop-full

6. Add the ros environment load script to bashrc

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

Test ROS:

Open three terminals and write roscore, rosrun turtlesim turtlesim_node, rosrun turtlesim turtle_teleop_key

jym@ubuntu:~$ roscore 
... logging to /home/jym/.ros/log/5b2a055c-34a1-11ec-b36c-ed0dd69260d5/roslaunch-ubuntu-32694.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:42685/
ros_comm version 1.15.13


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.13

NODES

auto-starting new master
process[master]: started with pid [32705]
ROS_MASTER_URI=http://ubuntu:11311/

setting /run_id to 5b2a055c-34a1-11ec-b36c-ed0dd69260d5
process[rosout-1]: started with pid [32715]
started core service [/rosout]

jym@ubuntu:~$ rosrun turtlesim turtlesim_node
[ INFO] [1635062998.850703821]: Starting turtlesim with node name /turtlesim
[ INFO] [1635062998.852881006]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
jym@ubuntu:~$ rosrun turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the turtle. 'q' to quit.

You can control the tortoise with the mouse to indicate that the installation was successful:

Change Mirror Source

It took three hours to install ros on it, and it's been too long, so I'll change the mirror source now.

Install vim in advance.

Set access to root first:

Enter sudo passwd root (note the spelling of passwd), then enter the user password, which will let you set the root password and confirm it again.

Next, type su, and then enter the root password you just set to enter the root.

Then you want to exit the input exit.

After that, start:

1. Back up the original file

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

2. Edit mirror source files

vim /etc/apt/sources.list

Inside vim

Delete all code: $d, $0

Then paste in:

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

Save and exit code: wq!

Update Source:

sudo apt-get update

Update software:

sudo apt-get dist-upgrade
sudo apt-get upgrade

You can see it very fast.

Install the rospy package via pip if using ros

pip install rospkg
pip install catkin-tools

At this point, ros is basically configured.

Topics: ROS