Cov txheej txheem:

RGB-D SLAM Nrog Kinect ntawm Raspberry Pi 4 [Buster] ROS Melodic: 6 Kauj Ruam
RGB-D SLAM Nrog Kinect ntawm Raspberry Pi 4 [Buster] ROS Melodic: 6 Kauj Ruam

Video: RGB-D SLAM Nrog Kinect ntawm Raspberry Pi 4 [Buster] ROS Melodic: 6 Kauj Ruam

Video: RGB-D SLAM Nrog Kinect ntawm Raspberry Pi 4 [Buster] ROS Melodic: 6 Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
Image
Image

Xyoo tas los kuv tau sau ib tsab xov xwm hais txog kev tsim thiab txhim kho ROS Melodic ntawm qhov tshiab (lub sijhawm ntawd) Raspberry Pi nrog Debian Buster OS. Kab lus tau txais kev mloog zoo ob leeg ntawm no ntawm Kev Qhia thiab ntawm lwm lub platform. Kuv zoo siab heev uas kuv tau pab ntau tus neeg kom ua tiav ROS ntawm Raspberry Pi. Hauv cov vis dis aus nrog kuv kuj tau qhia luv luv kom pom qhov tob ntawm Kinect 360. Tom qab ntawd ntau tus neeg tau hu rau kuv ntawm LinkedIn thiab nug kuv tias kuv tswj hwm siv Kinect nrog Raspberry Pi li cas. Kuv tau xav tsis thoob txog cov lus nug, txij li cov txheej txheem ntawm Kinect npaj rau lub sijhawm ntawd coj kuv li 3-4 teev thiab tsis zoo li nyuaj heev. Kuv tau qhia kuv cov ntaub ntawv.bash_history nrog txhua tus neeg nug kuv txog qhov teeb meem thiab thaum lub Plaub Hlis thaum kawg pom lub sijhawm los sau ib tsab xov xwm yuav ua li cas rau nruab Kinect tsav tsheb thiab ua RGB-D SLAM nrog RTAB-MAP ROS. Lub lim tiam ntawm kev pw tsis tsaug zog tom qab pib sau kab lus Kuv tam sim no nkag siab tias vim li cas thiaj muaj coob tus neeg nug kuv cov lus nug no:)

Kuv yuav pib nrog cov lus piav qhia luv luv txog kev ua haujlwm tau zoo li cas thiab qhov twg tsis ua. Tom qab ntawd kuv yuav piav qhia yuav teeb tsa Kinect tsav tsheb rau siv nrog ROS Melodic thiab thaum kawg yuav teeb tsa koj lub tshuab li cas rau RGB-D SLAM nrog RTAB-MAP ROS.

Kauj Ruam 1: Dab Tsi Ua Haujlwm thiab Dab Tsi Tsis Ua

Muaj ob peb tus neeg tsav tsheb muaj rau Kinect ntawm Raspberry Pi - tawm ntawm lawv ob qhov kev txhawb nqa los ntawm ROS.

OpenNI cov tsav tsheb - pob openni_camera rau ROS

libfreenect tsav tsheb - freenect_stack pob rau ROS

Yog tias koj saib lawv tus kheej GitHub chaw cia khoom, koj tuaj yeem pom tias OpenNI tus tsav tsheb tau hloov kho zaum kawg dhau los thiab hauv kev coj ua yog EOL tau ntev. ibfreekinect ntawm qhov tod tes tau hloov kho raws sijhawm. Zoo ib yam rau lawv cov ROS pob khoom, freenect_stack tau tso tawm rau ROS suab paj nruag, thaum nws qhov kawg distro openni_camera tau teev cov kev txhawb nqa rau Fuerte …

Nws muaj peev xwm suav sau thiab teeb tsa OpenNI tus tsav tsheb thiab pob openni_camera ntawm Raspberry Pi rau ROS Melodic, txawm hais tias nws tsis ua haujlwm rau kuv. Txhawm rau ua qhov ntawd ua raws phau ntawv qhia no, qib 1, 2, 3, ntawm kauj ruam 2 thiab 3 tshem tawm "-mfloat-abi = softfp" chij los ntawm Platform/Linux/Build/Common/Platform. ARM cov ntaub ntawv (ib qho lus qhia ntawm no Github qhov teeb meem). Tom qab ntawd clone openni_camera pob rau koj qhov chaw ua haujlwm catkin thiab suav nrog catkin_make. Nws tsis ua haujlwm rau kuv txawm hais tias, qhov ua yuam kev tau tsim qhov tob tshuab ua tsis tau haujlwm. Yog vim li cas: USB interface tsis txaus siab!

Siv libfreenect thiab freenect_stack tau ua tiav qhov kawg, tab sis muaj qee qhov teeb meem los daws thiab kev daws teeb meem me ntsis, txawm tias ua haujlwm ruaj khov (1 teev + txuas ntxiv ua haujlwm).

Kauj Ruam 2: Txhim Kho Freenect Tsav Tsheb thiab Freenect_stack

Txhim kho Freenect Tsav Tsheb thiab Freenect_stack
Txhim kho Freenect Tsav Tsheb thiab Freenect_stack

Kuv yuav xav tias koj siv kuv ROS Melodic Desktop duab los ntawm kab lus no. Yog tias koj xav ua kev teeb tsa hauv ib puag ncig sib txawv, piv txwv li ros_comm duab lossis hauv Ubuntu rau Raspberry Pi, nco ntsoov tias koj muaj kev paub txaus txog ROS los daws teeb meem uas yuav tshwm sim los ntawm qhov sib txawv ntawd.

Cia peb pib los ntawm kev tsim cov tsav tsheb libfreenect los ntawm qhov chaw, txij li apt-get repository pre-built version dhau lawm.

sudo apt-tau hloov tshiab

sudo apt-tau nruab libusb-1.0-0-dev

git clone

cd libfreenect

mkdir tsim && cd tsim

cmake -L tau..

ua

sudo ua kom nruab

Cia siab tias cov txheej txheem tsim yuav tsis muaj txiaj ntsig thiab tag nrho ntawm cov lus ntsuab phooj ywg. Tom qab koj teeb tsa libfreenect tsav tsheb, tom ntej sthing ua yog txhawm rau nruab freenect_stack pob rau ROS. Muaj ob peb lwm pob nws nyob ntawm, peb yuav tau clone lawv thiab tsim nrog catkin_make txhua tus ua ke. Ua ntej koj pib, xyuas kom tseeb tias koj lub chaw ua haujlwm catkin tau teeb tsa raug thiab siv tau!

Los ntawm koj qhov chaw ua haujlwm catkin src nplaub tshev:

git clone

git clone

git clone

git clone

git clone

git clone

Whooh, uas yog cloning ntau.

ZOO TSHAJ PLAWS: Raws li nws tau taw qhia los ntawm ib tus ntawm kuv cov neeg nyeem, lub zeem muag_opencv qhov chaw cia khoom yuav tsum tau teeb tsa rau cov ceg ntoo suab paj nruag. Rau qhov cd rau src/vision_opencv thiab ua tiav

git checkout melodic

Tom qab ntawd rov qab mus rau koj daim ntawv teev chaw ua haujlwm catkin. Txhawm rau txheeb xyuas yog tias peb vam khom rau txhua pob khoom hauv qhov chaw ua raws cov lus txib no:

rosdep nruab --from-paths src --ignore-src

Yog tias koj ua tiav cloned txhua qhov tsim nyog pob nws yuav thov rub libfreekinect nrog apt-get. Teb tsis tau, txij li peb twb tau teeb tsa nws los ntawm qhov chaw.

sudo apt-tau nruab libbullet-dev libharfbuzz-dev libgtk2.0-dev libgtk-3-dev

catkin_make -j2

Sijhawm tshuaj yej;) lossis yam koj nyiam haus yog.

Tom qab cov txheej txheem sau ua tiav koj tuaj yeem sim tso tawm kinect pawg thiab tshawb xyuas yog tias nws nthuav tawm qhov tob thiab xim cov duab kom raug. Kuv siv Raspberry Pi headless, yog li kuv yuav tsum tau khiav RVIZ ntawm kuv lub khoos phis tawj desktop.

Ntawm Raspberry Pi ua (Hloov tus IP chaw nyob rau IP chaw nyob ntawm koj tus Raspberry Pi!):

export ROS_MASTER_URI = https://192.168.0.108: 11311

export ROS_IP = 192.168.0.108

roslaunch freenect_launch freenect.launch qhov tob_registration: = muaj tseeb

Koj yuav pom cov zis zoo li hauv Screenshot 1. "Nthuav ntaus ntawv RGB thiab Qhov tob ntws ntws tawm." qhia tias Kinect tau npaj txhij, tab sis tsis muaj dab tsi tau cuv npe rau nws cov ncauj lus tseem.

Ntawm koj lub khoos phis tawj desktop nrog ROS Melodic teeb tsa ua:

export ROS_MASTER_URI = https://192.168.0.108: 11311

export ROS_IP = [koj lub desktop-computer-ip] rviz

Tam sim no koj yuav tsum tuaj yeem pom RGB thiab Qhov tob cov duab ntws hauv RVIZ zoo li hauv Screenshot 2 saum toj no … tab sis tsis yog tib lub sijhawm.

Okay, ntawm no yog qhov twg hacky khoom pib. Kuv tau siv 3 hnub sim cov tsav tsheb sib txawv thiab cov txheej txheem thiab tsis muaj dab tsi ua haujlwm - sai li sai tau thaum kuv yuav sim nkag mus rau ob lub kwj dej ib txhij Kinect yuav pib sijhawm raws li koj tuaj yeem pom hauv Screenshot 3. Kuv tau sim txhua yam: muaj zog zoo dua qub, ua tau zoo ntawm libfreenect thiab freenect_stack, siv usb_autosuspend, txhaj tshuaj dawb rau USB chaw nres nkoj (ua tau, tsis yog qhov kawg! tsis txhob ua nws, nws yog qhov tso dag thiab yuav tsum tsis yog cov lus qhia:)). Tom qab ntawd hauv ib qho ntawm Github cov teeb meem kuv pom tus lej ntawm ib tus neeg uas hais tias lawv Kinect tsis ruaj khov, txog thaum lawv "thauj lub npav USB" los ntawm kev txuas WiFi dongle. Kuv sim qhov ntawd thiab nws ua haujlwm. Ntawm qhov one tes, Kuv zoo siab tias nws ua haujlwm. Ntawm qhov tod tes, ib tug neeg tiag tiag yuav tsum tau kho qhov ntawd. Zoo, lub sijhawm no muaj (yam) kho qhov ntawd, cia peb txav mus rau qib tom ntej.

Kauj Ruam 3: Txhim Kho Standalone RTAB MAP

Txhim Kho Standalone RTAB MAP
Txhim Kho Standalone RTAB MAP

Ua ntej peb muaj pawg ntawm kev vam khom raug teeb tsa:

Txawm hais tias muaj pob khoom ua ntej armhf muaj rau PCL, peb yuav tsum tau suav nws los ntawm qhov chaw vim qhov teeb meem no. Tham nrog PCL GitHub chaw cia khoom kom pom yuav ua li cas sau nws los ntawm qhov chaw.

sudo apt-tau nruab libvtk6-dev libvtk6-qt-dev libvtk6-java libvtk6-jni

sudo apt-tau nruab libopencv-dev cmake libopenni2-dev libsqlite3-dev

Tam sim no cia peb clone rtab daim ntawv qhia tus kheej pob git repository rau peb lub tsev ntawv thiab tsim nws. Kuv siv qhov kev tshaj tawm tshiab (0.18.0).

git clone

cd rtabmap/tsim

cmk ua..

ua -j 2

sudo ua kom nruab

sudo ldconfig rtabmap

Tam sim no thaum peb tau suav sau ib leeg RTAB MAP, peb tuaj yeem txav mus rau theem kawg - suav thiab txhim kho ROS qhwv rau RTAB MAP, rtabmap_ros.

Kauj Ruam 4: Txhim Kho Rtabmap_ros

Txhim kho Rtabmap_ros
Txhim kho Rtabmap_ros

Yog tias koj tau txais qhov ntawd deb, tej zaum koj yuav paub qhov laum los ntawm tam sim no:) Clone lub rtabmap_ros chaw cia rau koj lub catkin chaw ua haujlwm src nplaub tshev. (Ua cov lus txib tom ntej los ntawm koj catkin chaw ua haujlwm src nplaub tshev!)

git clone

Peb yuav xav tau cov pob ROS no ib yam, uas rtabmap_ros nyob ntawm:

git clone

git clone

git clone

git clone

git clone

Ua ntej koj pib sau ua ke koj tuaj yeem paub tseeb tias koj tsis ploj ib qho kev vam khom nrog cov lus txib hauv qab no:

rosdep nruab --from-paths src --ignore-src

Nruab ntau qhov kev vam khom los ntawm ap-tau txais (cov no yuav tsis cuam tshuam qhov txuas, tab sis yuav cuam tshuam qhov yuam kev thaum muab tso ua ke)

sudo apt-tau nruab libsdl-image1.2-dev

Tom qab ntawd txav mus rau koj daim ntawv teev chaw ua haujlwm catkin thiab pib ua ke:

cd ua..

catkin_make -j2

Vam tias koj tsis tso koj cov dej cawv nyiam tshaj plaws nyob qhov twg mus deb. Tom qab kev sib sau ua ke peb tau npaj ua daim duab qhia chaw!

Kauj Ruam 5: Qhia Sijhawm

Qhia Sijhawm
Qhia Sijhawm
Qhia Sijhawm
Qhia Sijhawm

Ua qhov kev dag ntxias nrog ntxiv qee yam xws li WiFi lossis Bluetooth dongle rau USB chaw nres nkoj - Kuv tau siv 2 USB 2.0 chaw nres nkoj, ib qho rau Kinect, lwm qhov rau WiFi dongle.

Ntawm Raspberry Pi ua (Hloov IP chaw nyob rau IP chaw nyob ntawm koj tus Raspberry Pi!): 1st davhlau ya nyob twg:

export ROS_MASTER_URI = https://192.168.0.108: 11311

export ROS_IP = 192.168.0.108

roslaunch freenect_launch freenect.launch qhov tob_registration: = cov ntaub ntawv tseeb_skip: = 2

2 davhlau ya nyob twg:

roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args: = -delete_db_on_start --Vis/MaxFeatures 500 --Mem/ImagePreDecimation 2 --Mem/ImagePostDecimation 2 --Kp/DetectorStrategy 6 --OdomF2M/MaxSize 1000mab: = cuav

Koj yuav pom cov zis zoo li hauv Screenshot 1. "Nthuav ntaus ntawv RGB thiab Qhov tob ntws ntws tawm." qhia tias Kinect tau npaj tiav, tab sis tsis muaj dab tsi tau cuv npe rau nws cov ncauj lus tsis tau. Yog tias koj tsiv Kinect nrawm heev, qhov zoo ntawm odom yuav mus rau 0 thiab koj yuav tsum tau txav mus rau qhov chaw dhau los lossis pib los ntawm cov ntaub ntawv huv.

Ntawm koj lub khoos phis tawj desktop nrog ROS Melodic thiab rtab_map pob teeb tsa (Kuv xav kom koj siv Ubuntu lub computer rau qhov ntawd, txij li cov pob ua ntej tau tsim muaj rau amd64 architecture) ua:

export ROS_MASTER_URI = https://192.168.0.108: 11311

export ROS_IP = [koj lub desktop-computer-ip]

rviz ua

Ntxiv MapGraph thiab MapCloud qhia rau rviz thiab xaiv cov ncauj lus sib xws los ntawm rtab_map. Zoo, qhov no yog nws, qab zib saj ntawm yeej! Mus tom ntej thiab ua qee daim duab qhia chaw:)

Kauj Ruam 6: Cov neeg ua tim khawv

Thaum sau tsab ntawv no muaj tus lej ntawm cov peev txheej uas kuv tau sab laj, feem ntau cov rooj sib tham thiab teeb meem GitHub. Kuv yuav tso lawv ntawm no.

github.com/OpenKinect/libfreenect/issues/338

www.reddit.com/r/robotics/comments/8d37gy/ros_with_raspberry_pi_and_xbox_360_kinect_question/

github.com/ros-drivers/freenect_stack/issues/48

official-rtab-map-forum.67519.x6.nabble.com/RGB-D-SLAM- piv txwv -on-ROS-and-Raspberry-Pi-3-td1250.html

github.com/OpenKinect/libfreenect/issues/524

Ntxiv rau kuv ntawm LinkedIn yog tias koj muaj lus nug dab tsi thiab sau npe rau kuv YouTube channel kom tau txais kev ceeb toom txog cov phiaj xwm nthuav dav uas cuam tshuam nrog kev kawm tshuab thiab neeg hlau.

Pom zoo: