Cov txheej txheem:

Nruab ROS Kinetic, TurtleBot3, Raspicam ntawm Raspberry Pi  4b: 5 Kauj Ruam
Nruab ROS Kinetic, TurtleBot3, Raspicam ntawm Raspberry Pi 4b: 5 Kauj Ruam

Video: Nruab ROS Kinetic, TurtleBot3, Raspicam ntawm Raspberry Pi 4b: 5 Kauj Ruam

Video: Nruab ROS Kinetic, TurtleBot3, Raspicam ntawm Raspberry Pi  4b: 5 Kauj Ruam
Video: ROS Kinetic on Raspbian| ROS Kinetic Installation on Raspberry Pi 4 2024, Hlis ntuj nqeg
Anonim
Nruab ROS Kinetic, TurtleBot3, Raspicam ntawm Raspberry Pi 4b
Nruab ROS Kinetic, TurtleBot3, Raspicam ntawm Raspberry Pi 4b

TurtleBot3 Burger los nrog Raspberry Pi 3 B/B+ thiab tsis txhawb nqa qhov tshiab (raws li ntawm 9/2019) Raspberry Pi 4b. Ua raws cov theem hauv qab no kom TurtleBot3 ua haujlwm ntawm Raspberry Pi 4b, suav nrog

  • tsim ROS Kinetic los ntawm cov peev txheej ntawm Raspberry Pi 4b Raspbian Buster
  • ntxiv TurtleBot3-pob tshwj xeeb
  • ntxiv raspicam-node rau

Kauj Ruam 1: Nruab Raspbian thiab teeb tsa Raspberry Pi 4b

Nruab Raspbian thiab teeb tsa Raspberry Pi 4b
Nruab Raspbian thiab teeb tsa Raspberry Pi 4b

Rub tus duab Raspbian. Kuv siv Raspbian Buster hnub tim 2019–07–10.

Hlawv cov duab Raspbian rub tawm rau daim npav SD (tsawg kawg 8Gb qhov loj me). Txuas cov zaub, keyboard thiab nas rau koj Raspberry Pi 4b, khau raj thiab txuas rau WiFi. Txuas cov ntaub ntawv kaw kom nyob tag nrho koj daim npav SD thiab, xaiv tau, pab SSH thiab VNC los ntawm kev khiav

sudo raspi-teeb tsa

Kauj Ruam 2: Rub ROS Kinetic Sources

Rub tawm ROS Kinetic Sources
Rub tawm ROS Kinetic Sources

Cov lus qhia hauv qab no ua raws txoj cai ROS qhia ntxiv rau DmitryM8 qhia.

Nkag mus rau hauv koj li Raspberry Pi 4b thiab ua raws cov lus txib no ntxiv ROS pob ntawv khaws cia, tsim cov cuab yeej thiab pib ua ROS cov cuab yeej vam khom.

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-tau hloov tshiab sudo apt-tau nruab -y python-rosdep python-rosinstall-generator python-wwstst-generator sej-rosinstall tsim-qhov tseem ceeb cmake sudo rosdep init rosdep hloov tshiab

Tsim chaw ua haujlwm los tsim ROS Kinetic los ntawm qhov chaw.

mkdir ~/ros_catkin_ws

cd ~/ros_catkin_ws

Rub tawm qhov chaws rau pob "ros_comm", uas muaj cov qauv tseem ceeb npaj los ua haujlwm ntawm neeg hlau lub khoos phis tawj. Nov rosinstall_generator tsim cov npe ntawm cov peev txheej khaws cia los rub tawm. wstool tom qab ntawd txuas ntxiv mus rub tawm qhov chaws.

rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar> kinetic-ros_comm-wet.rosinstall

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

Txhawm rau khiav TurtleBot3 thiab raspicam koj yuav xav tau cov pob ROS no ntxiv rau ros_comm: common_msgs, rosserial, image_common, image_transport_plugins thiab kuaj mob. Txhawm rau ntxiv cov pob no khiav cov lus txib no.

rosinstall_generator common_msgs common_msgs rosserial image_common image_transport_plugins kuaj mob nodelet_core --rosdistro kinetic --deps --wet-only -tar> kinetic-extra-wet.rosinstall

wstool sib tshuam -t src kinetic -extra -wet.rosinstall wstool hloov tshiab -j8 -t src rosdep nruab -los ntawm -paths src --ignore -src --rosdistro kinetic -y

Raws li kev vam khom hloov pauv sijhawm, yuav muaj qhov yuam kev zoo li "python-rosdistro-modules_0.7.5-1_all.deb (--unpack): sim rov sau dua '/usr/lib/python2.7/dist-packages/rosdistro/_init_.py ', uas tseem nyob hauv pob sej-rosdistro 0.7.2-1 ". Daws qhov "sim rov sau dua" qhov yuam kev:

sudo dpkg-tshem tawm-yuam-tag nrho cov nab hab sej-catkin-pkg nab hab sej-catkin-pkg-modules sej-rosdistro python-rosdistro-modules python-rospkg python-rospkg-modules

// lossis sudo apt tshem tawm sudo apt-kho-tawg nruab

Kauj Ruam 3: Txhim Kho ROS Kev Sib Sau Ua Ke Tsis Yooj Yim

Khoos phis tawj ROS Kev Sau Ua Ke Los Ntawm Tus Kheej
Khoos phis tawj ROS Kev Sau Ua Ke Los Ntawm Tus Kheej

Tsev ROS ntawm qhov no yuav ua tsis tiav nrog ntau qhov yuam kev. Cia peb kho qhov yuam kev los ntawm kev kho tus kheej ROS qhov chaws.

Kho kom raug

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

Hloov

char* str = PyString_AsString (obj);

nrog

const char* str = PyString_AsString (obj);

Kho cov ntaub ntawv hauv qab no.

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

Tshem tawm txhua qhov tshwm sim ntawm

tr /ib

thiab hloov txhua qhov tshwm sim ntawm

ib:: tr1

nrog

txhawb

Kho cov ntaub ntawv hauv qab no.

/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 /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_testc /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

Hloov tag nrho cov txiaj ntsig ntawm

txhawb:: posix_time:: milliseconds (…)

nrog

txhawb:: posix_time:: milliseconds (int (…))

Kho cov ntaub ntawv hauv qab no.

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

Hloov tag nrho

logWarn

nrog

CONSOLE_BRIDGE_logWarn

thiab

logError

nrog

CONSOLE_BRIDGE_logError

Kauj Ruam 4: Tsim ROS Kinetic

Hauv qhov no, kev tsim kho yuav tsum ua tiav.

cd ~/ros_catkin_ws

sudo./src/catkin/bin/catkin_make_isolated -nruab -DCMAKE_BUILD_TYPE = Tso tawm -nruab -qhov chaw/opt/ros/kinetic

Ntxiv rau ~/.bashrc thiab tseem ua hauv koj lub plhaub:

qhov chaw /opt/ros/kinetic/setup.bash

Kauj Ruam 5: Tsim TurtleBot3 thiab Raspicam Pob

Tsim TurtleBot3 thiab Raspicam Pob
Tsim TurtleBot3 thiab Raspicam Pob

Cov lus qhia no ua raws ROBOTIS kev qhia.

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws/catkin_make qhov chaw devel/setup.bash

Kho kom raug ~/.bashrc thiab txuas ntxiv

qhov chaw /home/pi/catkin_ws/devel/setup.bash

Tam sim no, ua

cd ~/catkin_ws/src

git clone https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git git clone 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/turtlebot3_example/cd ~/catkin_

Kev tsim kho yuav tsum ua tiav.

Configure Raspberry Pi 4b kom paub txog TurtleBot3 USB cov khoom siv.

rosrun turtlebot3_bringup create_udev_rules

Khiav ifconfig thiab sau Raspbery Pi tus IP.

ifconfig

Kho kom raug ~/.bashrc. Ntxiv cov kab hauv qab no thiab tseem ua rau lawv hauv koj lub plhaub.

export ROS_MASTER_URI = https://YOUR. ROS. MASTER. IP: 11311

export ROS_HOSTNAME = YOUR. RASPBERRY. PI. IP

Synchronize Raspberry Pi thiab PC lub sijhawm:

sudo apt-tau nruab ntpdate

sudo ntpdate ntp.ubuntu.com

Txij ntawm no mus, koj teeb tsa yuav tsum ua kom tiav. Tam sim no koj tuaj yeem siv koj li Raspberry Pi 4b siv Raspberry Pi 3/3+ hauv koj li TurtleBot3.

Pom zoo: