Orodha ya maudhui:

Sakinisha ROS Kinetic, TurtleBot3, Raspicam kwenye Raspberry Pi  4b: Hatua 5
Sakinisha ROS Kinetic, TurtleBot3, Raspicam kwenye Raspberry Pi 4b: Hatua 5

Video: Sakinisha ROS Kinetic, TurtleBot3, Raspicam kwenye Raspberry Pi 4b: Hatua 5

Video: Sakinisha ROS Kinetic, TurtleBot3, Raspicam kwenye Raspberry Pi  4b: Hatua 5
Video: ROS Kinetic on Raspbian| ROS Kinetic Installation on Raspberry Pi 4 2024, Novemba
Anonim
Sakinisha ROS Kinetic, TurtleBot3, Raspicam kwenye Raspberry Pi 4b
Sakinisha ROS Kinetic, TurtleBot3, Raspicam kwenye Raspberry Pi 4b

TurtleBot3 Burger inakuja na Raspberry Pi 3 B / B + na haiungi mkono mpya (kama ya 9/2019) Raspberry Pi 4b. Fuata hatua zifuatazo ili kufanya TurtleBot3 ifanye kazi kwenye Raspberry Pi 4b, pamoja

  • kujenga ROS Kinetic kutoka vyanzo kwenye Raspberry Pi 4b Raspbian Buster
  • kuongeza vifurushi maalum vya TurtleBot3
  • kuongeza raspicam-node kwa

Hatua ya 1: Sakinisha Raspbian na Sanidi Raspberry Pi 4b

Sakinisha Raspbian na Sanidi Raspberry Pi 4b
Sakinisha Raspbian na Sanidi Raspberry Pi 4b

Pakua picha ya Raspbian. Nilitumia Raspbian Buster ya tarehe 2019-07-10.

Choma picha ya Raspbian iliyopakuliwa kwenye kadi ya SD (angalau saizi ya 8Gb). Unganisha onyesho, kibodi na panya kwenye Raspberry yako Pi 4b, buti na unganisha kwenye WiFi. Panua mfumo wa faili kuchukua kadi yako yote ya SD na, kwa hiari, wezesha SSH na VNC kwa kukimbia

Sudo raspi-config

Hatua ya 2: Pakua Vyanzo vya ROS Kinetic

Pakua Vyanzo vya ROS Kinetic
Pakua Vyanzo vya ROS Kinetic

Maagizo hapa chini yanafuata mafunzo rasmi ya ROS na pia DmitryM8 inayoweza kufundishwa.

Ingia kwenye Raspberry yako Pi 4b na utekeleze maagizo haya ili kuongeza hazina ya kifurushi cha ROS, tengeneza zana na usanidi zana ya utegemezi wa ROS.

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

Sudo apt-key adv --keyserver 'hkp: //keyserver.ubuntu.com: 80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 python-rosinstall kujenga-muhimu cmake sudo rosdep init rosdep sasisho

Unda nafasi ya kazi ili kujenga ROS Kinetic kutoka kwa chanzo.

mkdir ~ / ros_catkin_ws

cd ~ / ros_catkin_ws

Pakua nambari ya chanzo ya kifurushi cha "ros_comm", ambacho kina moduli muhimu zinazokusudiwa kuendeshwa kwenye kompyuta ya bodi ya roboti. Hapa rosinstall_generator inaunda orodha ya hazina za nambari za chanzo za kupakua. wstool kisha inaendelea kupakua nambari ya chanzo.

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

wstool init -j8 src kinetic-ros_comm-wet.

Ili kuendesha TurtleBot3 na raspicam utahitaji vifurushi hivi vya ROS kwa kuongeza ros_comm: common_msgs, rosserial, image_common, image_transport_plugins na diagnostics. Ili kuongeza vifurushi hivi endesha amri hizi.

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

wstool unganisha -t src kinetic-ziada-mvua.

Kama matoleo ya utegemezi hubadilika kwa muda, kunaweza kuwa na makosa kama "python-rosdistro-modules_0.7.5-1_all.deb (--unpack): kujaribu kuandika '/ usr/lib/python2.7/dist-packages/rosdistro/_init_.py ', ambayo pia iko kwenye kifurushi python-rosdistro 0.7.2-1 ". Suluhisha makosa haya ya "kujaribu kuandika":

Sudo dpkg - ondoa - fanya-yote-chatu-katoni-pkg chatu-katoni-pkg-moduli python-rosdistro python-rosdistro-moduli python-rospkg python-rospkg-moduli

// au sudo apt kuondoa sudo apt - fix-kuvunjwa kufunga

Hatua ya 3: Rekebisha mwenyewe Makosa ya Mkusanyiko wa ROS

Rekebisha mwenyewe Makosa ya Mkusanyiko wa ROS
Rekebisha mwenyewe Makosa ya Mkusanyiko wa ROS

Kujenga ROS wakati huu kutashindwa na makosa anuwai. Wacha turekebishe makosa hayo kwa kuhariri nambari ya chanzo ya ROS.

Hariri

/ nyumbani/pi/ros_catkin_ws/src/opencv3/modules/python/src2/cv2.cpp line 885

Badilisha

char * str = PyString_AsString (obj);

na

const char * str = PyString_AsString (obj);

Hariri faili hapa chini.

/ nyumba/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/src/utils.cpp

Ondoa matukio yote ya

/ tr1

na kuchukua nafasi ya matukio yote ya

std:: tr1

na

kuongeza

Hariri faili hapa chini.

/ nyumbani/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 / src / /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 / rsps / ros / rsk / russia /bondcpp/src/bond.cpp / nyumba/pi/ros_catkin_ws/src/ros_comm/roscpp/include/ros/timer_manager.h / home /pi/ros_catkin_ws/src/ros/roslib/test/utest.cpp

Badilisha nafasi zote za

kuongeza:: posix_time:: milliseconds (…)

na

kuongeza:: posix_time:: milliseconds (int (…))

Hariri faili hapa chini.

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

Badilisha zote

logi Onya

na

CONSOLE_BRIDGE_log Onya

na

Hitilafu ya logi

na

CONSOLE_BRIDGE_logKosa

Hatua ya 4: Jenga ROS Kinetic

Kwa wakati huu ujenzi unapaswa kufaulu.

cd ~ / ros_catkin_ws

sudo./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE = Kutolewa - nafasi ya kufunga / opt / ros / kinetic

Tumia kwa ~ /.bashrc na pia fanya kwenye ganda lako:

chanzo /opt/ros/kinetic/setup.bash

Hatua ya 5: Jenga Vifurushi vya TurtleBot3 na Raspicam

Jenga Vifurushi vya TurtleBot3 na Raspicam
Jenga Vifurushi vya TurtleBot3 na Raspicam

Maagizo haya yanafuata mafunzo ya ROBOTIS.

mkdir -p ~ / catkin_ws / src

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

Hariri ~ /.bashrc na uongeze

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

Sasa, fanya

cd ~ / katuni_ws / src

clone ya git 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. clone ya git

Ujenzi unapaswa kufanikiwa.

Sanidi Raspberry Pi 4b kutambua vifaa vya USB vya TurtleBot3.

rosrun turtlebot3_bringup kuunda_udev_rules

Endesha ifconfig na andika IP ya Raspbery Pi.

ifconfig

Hariri ~ /.bashrc. Ongeza mistari hapa chini na pia uwafanye kwenye ganda lako.

kuuza nje ROS_MASTER_URI = https://YOUR. ROS. MASTER. IP: 11311

kuuza nje ROS_HOSTNAME = YAKO. RASPBERRY. PI. IP

Sawazisha Raspberry Pi na wakati wa PC:

Sudo apt-get kufunga ntpdate

Sudo ntpdate ntp.ubuntu.com

Kwa wakati huu, usanidi wako unapaswa kukamilika. Sasa unaweza kutumia Raspberry yako Pi 4b badala ya Raspberry Pi 3/3 + kwenye TurtleBot3 yako.

Ilipendekeza: