ROS Kinetic, TurtleBot3, Raspicamni Raspberry Pi  4b: 5 qadamga o'rnating
ROS Kinetic, TurtleBot3, Raspicamni Raspberry Pi 4b: 5 qadamga o'rnating
Anonim
Raspberry Pi 4b -ga ROS Kinetic, TurtleBot3, Raspicam -ni o'rnating
Raspberry Pi 4b -ga ROS Kinetic, TurtleBot3, Raspicam -ni o'rnating

TurtleBot3 Burger Raspberry Pi 3 B/B+ bilan birga keladi va yangi Raspberry Pi 4b -ni qo'llab -quvvatlamaydi. TurtleBot3 -ni Raspberry Pi 4b -da ishlashi uchun quyidagi amallarni bajaring

  • Raspberry Pi 4b Raspbian Buster manbalaridan ROS Kinetic yaratish
  • TurtleBot3 uchun maxsus paketlarni qo'shish
  • raspicam tugunini qo'shish

1 -qadam: Raspbian -ni o'rnating va Raspberry Pi 4b -ni sozlang

Raspbian -ni o'rnating va Raspberry Pi 4b -ni sozlang
Raspbian -ni o'rnating va Raspberry Pi 4b -ni sozlang

Raspbian rasm yuklab olish. Men 2019–07–10 yilgi Raspbian Buster -dan foydalandim.

Yuklab olingan Raspbian tasvirini SD -kartaga yozing (hajmi kamida 8 Gb). Raspberry Pi 4b -ga displey, klaviatura va sichqonchani ulang, yuklang va WiFi -ga ulaning. SD -kartani to'liq egallash uchun fayl tizimini kengaytiring va ixtiyoriy ravishda SSH va VNC -ni ishga tushiring

sudo raspi-config

2 -qadam: ROS kinetik manbalarini yuklab oling

ROS kinetik manbalarini yuklab oling
ROS kinetik manbalarini yuklab oling

Quyidagi ko'rsatmalar ROSning rasmiy qo'llanmasida, shuningdek DmitryM8 -da ko'rsatma berilgan.

Raspberry Pi 4b -ga kiring va ROS to'plami omborini qo'shish, asboblarni yaratish va ROSga bog'liqlik vositasini ishga tushirish uchun ushbu buyruqlarni bajaring.

sudo sh -c 'echo "deb https://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-get update sudo apt-get install -y python-rosdep python-python-rosinstall python-rosinstall build-essential cmake sudo rosdep init rosdep yangilanishi

Manbadan ROS Kinetic yaratish uchun ish joyini yarating.

mkdir ~/ros_catkin_ws

cd ~/ros_catkin_ws

"Ros_comm" paketining manba kodini yuklab oling, u robotning bortli kompyuterida ishlashga mo'ljallangan asosiy modullarni o'z ichiga oladi. Bu erda rosinstall_generator yuklab olish uchun manba kodlari omborlari ro'yxatini tuzadi. wstool keyin manba kodini yuklab olishni davom ettiradi.

rosinstall_generator ros_comm --rosdistro kinetic --deps-faqat nam --tar> kinetik-ros_comm-wet.rosinstall

wstool init -j8 src kinetic-ros_comm-wet.rosinstall rosdep install --from-paths src --ignore-src --rosdistro kinetic -y

TurtleBot3 va raspicam -ni ishga tushirish uchun sizga ros_comm -dan tashqari ushbu ROS -paketlar kerak bo'ladi: common_msgs, rosserial, image_common, image_transport_plugins va diagnostika. Ushbu paketlarni qo'shish uchun ushbu buyruqlarni bajaring.

rosinstall_generator common_msgs common_msgs rosserial image_common image_transport_plugins diagnostikasi nodelet_core --rosdistro kinetik --deps-faqat nam --tar> kinetik-qo'shimcha-nam.rosinstall

wstool merge -t src kinetic -extra -wet.rosinstall wstool update -j8 -t src rosdep install --from -paths src --ignore -src --rosdistro kinetic -y

Vaqt o'tishi bilan qaramlik versiyalari o'zgarganda, "python-rosdistro-modules_0.7.5-1_all.deb (--unpack)" kabi xatolar bo'lishi mumkin: '/usr/lib/python2.7/dist-packages/rosdistro/_init_ python-rosdistro 0.7.2-1 "paketida joylashgan.py '. Ushbu "qayta yozishga urinish" xatolarini hal qiling:

sudo dpkg --remove-forth all python-catkin-pkg python-catkin-pkg-modules python-rosdistro python-rosdistro-modules python-rospkg python-rospkg-modullari

// yoki sudo apt o'chirish sudo apt-tuzatish buzilgan

3 -qadam: ROS kompilyatsiya xatolarini qo'lda tuzatish

ROS kompilyatsiya xatolarini qo'lda tuzatish
ROS kompilyatsiya xatolarini qo'lda tuzatish

Bu vaqtda ROSni yaratish har xil xatolar bilan muvaffaqiyatsiz bo'ladi. Keling, ROS manba kodini qo'lda tahrir qilish orqali xatolarni tuzataylik.

Tahrirlash

/home/pi/ros_catkin_ws/src/opencv3/modules/python/src2/cv2.cpp liniyasi 885

O'zgartirish

char* str = PyString_AsString (obj);

bilan

const char* str = PyString_AsString (obj);

Quyidagi fayllarni tahrirlang.

/home/pi/ros_catkin_ws/src/rospack/include/rospack/rospack.h /home/pi/ros_catkin_ws/src/rospack/src/rospack.cpp /home/pi/ros_catkin_ws/src/rospack/crcack/src/

Ning barcha hodisalarini o'chirib tashlang

/tr1

va barcha hodisalarni almashtiring

std:: tr1

bilan

kuchaytirish

Quyidagi fayllarni tahrirlang.

/home/pi/ros_catkin_ws/src/actionlib/include/actionlib/client/simple_action_client.h /home/pi/ros_catkin_ws/src/actionlib/include/actionlib/destruction_guard.h/home/pi/ros_catkin_ws/srr /actionlib/server/simple_action_server_imp.h /home/pi/ros_catkin_ws/src/actionlib/src/connection_monitor.cpp /home/pi/ros_catkin_ws/src/actionlib/test/destruction_guard_test.cpp_ home/pi/bc/src /bondcpp/src/bond.cpp /home/pi/ros_catkin_ws/src/ros_comm/roscpp/include/ros/timer_manager.h /home/pi/ros_catkin_ws/src/ros/roslib/test/utest.cpp

Ning barcha paydo bo'lishini almashtiring

boost:: posix_time:: millisekundlar […]

bilan

boost:: posix_time:: millisekundlar (int (…))

Quyidagi faylni tahrirlang.

/home/pi/ros_catkin_ws/src/geometry2/tf2/src/buffer_core.cpp

Hammasini almashtiring

logWarn

bilan

CONSOLE_BRIDGE_logOgohlantirish

va

logError

bilan

CONSOLE_BRIDGE_logHato

4 -qadam: ROS Kinetic -ni yarating

Bu vaqtda qurilish muvaffaqiyatli bo'lishi kerak.

cd ~/ros_catkin_ws

sudo./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE = Release --install -space/opt/ros/kinetic

~/. Bashrc ga qo'shing va shuningdek qobig'ingizda bajaring:

manba /opt/ros/kinetic/setup.bash

5 -qadam: TurtleBot3 va Raspicam paketlarini yarating

TurtleBot3 va Raspicam paketlarini yarating
TurtleBot3 va Raspicam paketlarini yarating

Bu ko'rsatmalar ROBOTIS qo'llanmasiga mos keladi.

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws/catkin_make manba devel/setup.bash

~/. Bashrc -ni tahrir qiling va qo'shing

manba /home/pi/catkin_ws/devel/setup.bash

Endi, ijro eting

cd ~/catkin_ws/src

git klon https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git git klon https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git git klon https://github.com/ROBOTIS-GIT/turtlebot3. git git clone https://github.com/UbiquityRobotics/raspicam_node.git cd ~/catkin_ws/src/turtlebot3 rm -r turtlebot3_description/turtlebot3_teleop/turtlebot3_navigation/turtlebot3_slam/turtlebot_camp/catkin_cample

Qurilish muvaffaqiyatli bo'lishi kerak.

TurtleBot3 USB tashqi qurilmalarini tanib olish uchun Raspberry Pi 4b ni sozlang.

rosrun turtlebot3_bringup create_udev_rules

Ifconfig -ni ishga tushiring va Raspbery Pi -ning IP -manzilini yozing.

ifconfig

~/. Bashrc -ni tahrir qiling. Quyidagi qatorlarni qo'shing va ularni qobig'ingizda bajaring.

eksport qilish ROS_MASTER_URI = https://YOUR. ROS. MASTER. IP: 11311

eksport qilish ROS_HOSTNAME = YOUR. RASPBERRY. PI. IP

Raspberry Pi va kompyuter vaqtini sinxronlashtiring:

sudo apt-get install ntpdate

sudo ntpdate ntp.ubuntu.com

Bu vaqtda sizning sozlashingiz yakunlanishi kerak. Endi siz TurtleBot3 -da Raspberry Pi 3/3+ o'rniga Raspberry Pi 4b dan foydalanishingiz mumkin.

Tavsiya: