1. rufus 烧写 ubuntu 2004 iso 的 usb 启动盘.
2. 安装
ubuntu 2004 iso 桌面版.
3. 设置更新源为 tsinghua
4. 系统设置
-
-----------------------------
-
sudo vi /etc/sudoers; 改为 %sudo ALL=(ALL:ALL) NOPASSWD:ALL ## 这一步你要确认是否真的要做.
-
----------------------------
-
settings -> power [Blank Screen -> Never][Wifi save Power -> Off]
-
----------------------------
-
sudo apt remove libreoffice-common libreoffice-core libreoffice-style-breeze libreoffice-style-colibre libreoffice-style-elementary libreoffice-style-tango thunderbird thunderbird-gnome-support thunderbird-locale-en thunderbird-locale-en-us totem totem-common totem-plugins rhythmbox rhythmbox-data rhythmbox-plugin-alternative-toolbar rhythmbox-plugins simple-scan gnome-mahjongg aisleriot gnome-mines cheese transmission-common transmission-gtk gnome-sudoku deja-dup gnome-calendar shotwell shotwell-common evince evince-common gnome-todo usb-creator-common usb-creator-gtk gnome-screenshot eog yelp yelp-xsl gnome-font-viewer gnome-calculator ibus-data ibus-gtk ibus-gtk ibus-gtk3 ibus-table --purge;
-
sudo apt autoremove --purge
-
安装必要的开发环境
-
sudo apt install openssh-server samba vim git axel terminator xrdp htop bash-completion tree
-
sudo mkdir /work; sudo chown iibull:iibull /work; ln -s /work ~/work
-
sudo vi /etc/samba/smb.conf
-
sudo smbpasswd -a iibull
-
sudo service smbd restart
-
换种占用资源较少的桌面
-
sudo apt-get install gnome-session-flashback 重新登陆, 使用新的 gnome classic. 省 100MB RAM
-
-
部署远程桌面和虚拟桌面
-
VNC桌面
-
settings->sharing->screen sharing -> [ON,allow connections,access require passwd]
-
sudo apt install xrdp xbase-clients dconf-editor
-
sudo dconf-editororg 设置 org -> gnome -> desktop -> remote-access 取消勾选requlre-encryption
-
命令行执行 gsettings set org.gnome.Vino require-encryption false ; gsettings set org.gnome.Vino use-upnp true
-
通过VNC viewer 或者 windows 远程桌面[vnc-any, ip, 5900, 密码] 可登陆.
-
虚拟桌面 - 无显示器登陆.
-
sudo apt install x11vnc xvfb
-
编辑虚拟桌面脚本 /usr/local/bin/fakevncscreen ### 然后 vnc viewer 通过 IP:9595 登陆.
-
#smb.conf 内容
-
[ROS]
-
comment = foxy
-
path = /work
-
create mask = 0700
-
valid users = iibull
-
write list = root, iibull
-
$ cat fakevncscreen
-
#!/bin/bash
-
-
while [ 1 ]; do
-
xvfb_cnt=`pidof Xvfb`
-
if [[ $xvfb_cnt -eq 0 ]]; then
-
Xvfb :95 -screen 0 1280x1024x16 &
-
sleep 2
-
fi
-
-
x11_cnt=`pidof x11vnc`
-
if [[ $x11_cnt -eq 0 ]]; then
-
x11vnc -ncache 10 -listen 0.0.0.0 -rfbport 9595 -noipv6 -passwd wanglong -display :95 & #每次vncview退出后, 此程序也会退出.
-
else
-
sleep 3
-
fi
-
-
done
5. 安装 foxy, 今天 2020.06.23 ROS2放出了 Rolling Ridley 版本, 目前看是还是先用foxy, TMD学习成本太高了.
参照
-
最好有个VPN网络.
-
sudo locale-gen en_US en_US.UTF-8
-
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
-
export LANG=en_US.UTF-8
//参考 使用清华的ROS2 源
-
sudo apt update && sudo apt install curl gnupg2 lsb-release
-
sudo sh -c '. /etc/lsb-release && echo "deb $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros2-latest.list'
-
-
sudo apt update
-
sudo apt install ros-foxy-desktop
-
sudo apt install python3-argcomplete
-
-
验证
-
source /opt/ros/foxy/setup.bash
-
ros2 run demo_nodes_py listener
-
-
source /opt/ros/foxy/setup.bash
-
ros2 run demo_nodes_cpp talker
5. 部署开发环境
-
sudo apt update
-
sudo apt install -y python3-rosdep libpython3-dev python3-argcomplete python3-colcon-common-extensions
-
sudo rosdep init
-
rosdep update
-
rosdep install --from-paths /opt/ros/foxy/share --ignore-src --rosdistro foxy -y --skip-keys "console_bridge fastcdr fastrtps osrf_testing_tools_cpp poco_vendor rmw_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_connext_cpp rti-connext-dds-5.3.1 tinyxml_vendor tinyxml2_vendor urdfdom urdfdom_headers"
6. 部署工作空间
-
建立如下目录结构
-
cd /work/module_chassis/chassis/src
-
ros2 pkg create big_bringup --build-type ament_cmake
-
产生结果
-
iibull@MC:~/work/module_chassis/chassis/src$ tree .
.
└── big_bringup
├── CMakeLists.txt
├── include
│ └── big_bringup
├── package.xml
└── src
-
添加测试代码
-
cd /work/module_chassis/chassis;
-
rosdep install -i --from-path src --rosdistro foxy -y
-
colcon build --packages-up-to big_bringup
-
产生 build install log src. source install/setup.bash 是的环境生效.
7. 应用为发布模式
点击(此处)折叠或打开
-
iibull@MC:~/work/module_chassis/chassis$ cat /etc/ROS2_ENV
-
#!/bin/sh
-
-
export ROS_DOMAIN_ID=91
-
export ROS_LOCALHOST_ONLY=1 ##因为目前场景不需要分布式
-
-
source /opt/ros/foxy/setup.bash
-
source /work/module_chassis/chassis/install/setup.bash
-
-
export GIT_SSL_NO_VERIFY=1
-
export SLAM_MAP_DIR=/work/module_chassis/chassis/SlamMap
-
export VP_CALLBACK_ECHO=everything_is_OK
-
iibull@MC:~/work/module_chassis/chassis$
-
#添加到 .bashrc中
-
-
source /etc/ROS2_ENV
-
alias gw='cd /work/module_chassis/chassis'
-
alias gs='cd /work/module_chassis/chassis/src'
-
alias gm='cd /work/module_chassis/chassis && colcon build'
确认环境正确性
-
iibull@MC:~$ printenv | grep ROS
-
ROS_VERSION=2
-
ROS_PYTHON_VERSION=3
-
ROS_DOMAIN_ID=91
-
ROS_LOCALHOST_ONLY=1
-
ROS_DISTRO=foxy
好了, 节后移植送货机器人代码到 ROS2 foxy
忽然发现 ROS2很多库都没有移植上来, 包括 rplidar(可自行移植,比较简单), USB_Cam, ar_track_alvar, 奥比中光的估计够呛, 老外的用法很多用的是 ros1_bridge
, 那么用ROS2的意义就不大了.
so so 想想还是kinetic吧.
阅读(1568) | 评论(0) | 转发(0) |