Wprowadzenie do mobilnych robotów - Kielce...MobileEyes Adam Krechowicz Mobilne Roboty 9 stycznia...
Transcript of Wprowadzenie do mobilnych robotów - Kielce...MobileEyes Adam Krechowicz Mobilne Roboty 9 stycznia...
Wprowadzenie do mobilnych robotów
Adam Krechowicz
9 stycznia 2018
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 1 / 54
Wst¦p Adept
Adept MobileRobots c©
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 2 / 54
Wst¦p Pioneer
Pioneer
Mobilne roboty
wykorzystywane gªównie w pracach badawczych
nap¦d koªowy
sterowane przez wbudowany mikrokontroler
wyposa»one w komputer pokªadowy
poruszaj¡ce si¦ samodzielnie
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 3 / 54
Wst¦p Pioneer 3dx
Pioneer 3dx
Konstrukcja trójkoªowa
Zastosowanie w budynkach
Wa»y 9 kg
Pr¦dko±¢ maksymalna 1.4 m/s
Mo»e unie±¢ 23 kg
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 4 / 54
Wst¦p Pioneer 3at
Pioneer 3at
Nap¦d na cztery koªa
Stosowany na dowolnym terenie
Wa»y 14 kg
Pr¦dko±c maksymalna 0.7 m/s
Mo»e unie±¢ 12 kg
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 5 / 54
Wyposa»enie
Wyposa»enie
zderzaki
sonary
czujnik laserowy
odbiornik gps
chwytaki
kamery
»yroskopy
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 6 / 54
Wyposa»enie Komputer
Komputer pokªadowy
Pentium M 1.8GHz
2GB RAM
Dysk 80GB
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 7 / 54
Wyposa»enie Komputer
Komunikacja z robotem
Robot
Mikrokontroler
RS232
Komputer pokªadowy
WiFi
Komputer steruj¡cy
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 8 / 54
Wyposa»enie Sonary
Sonary
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 9 / 54
Wyposa»enie Sonary
Sonar
t
t2-t1
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 10 / 54
Wyposa»enie Chwytaki
Chwytaki
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 11 / 54
Wyposa»enie Dalmierz laserowy
Dalmierz laserowy
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 12 / 54
Wyposa»enie Dalmierz laserowy
Dalmierz laserowy
Nadajnik
Odbiornik
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 13 / 54
Wyposa»enie Odbiornik GPS
Odbiornik GPS
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 14 / 54
Wyposa»enie Kamery
Kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 15 / 54
Wyposa»enie Kamery
Obraz z kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 16 / 54
Wyposa»enie Kamery
Obraz z kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 17 / 54
Wyposa»enie Kamery
Obraz z kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 18 / 54
Wyposa»enie Kamery
Obraz z kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 19 / 54
Wyposa»enie Odometria
Sterowanie dyferencyjne
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 20 / 54
Wyposa»enie Odometria
Odometria
NadajnikOdbiornik t
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 21 / 54
Wyposa»enie Odometria
Jazda po prostej
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 22 / 54
Wyposa»enie Odometria
Sterownik PID
∑
Kpe(t)
Ki
∫ t
0e(τ)dτ
Kdde(t)dt
∑Nap¦d
+u(t) e(t)
+
+
+
−
y(t)
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 23 / 54
Oprogramowanie
Oprogramowanie mobilnych robotów
Robot jest serwerem
Programy klienckie steruj¡ robotem
sterowanie r¦czne
teleoperacja
praca autonomiczna
praca autonomiczna + zdalna kontrola
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 24 / 54
Oprogramowanie ARCOS
ARCOS
Advanced Robotics Control and Operations
�rmware robota
steruje najwa»niejszymi funkcjami robota
odometriaPIDreagowanie na zablokowania (Stall)komunikacja
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 25 / 54
Oprogramowanie Aria
Aria
Advanced Robot Interface for Applications
wysokopoziomowe programowanie robota
C++, Java, Python
sterowanieodczytywanie danych z czujnikówbudowanie skomplikowanych zachowa«
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 26 / 54
Oprogramowanie MobileSim
MobileSim
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 27 / 54
Oprogramowanie ArNetworking
ArNetworking
ARIA
Server
Client
MobileEyes
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 28 / 54
Oprogramowanie MobileEyes
MobileEyes
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 29 / 54
Oprogramowanie ARNL
ARNL
Advanced Robotics Navigation and Localization
Planowanie tras
Nawigacja robota
Wykorzystuje mapy
Wykorzystuje dalmierz laserowy lub sonary
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 30 / 54
Oprogramowanie Mapper3
Mapper3
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 31 / 54
Programowanie Poª¡czenie
Kody zródªowe
/∗MobileRobots Advanced Robotics Interface for Applications (ARIA)Copyright (C) 2004, 2005 ActivMedia Robotics LLCCopyright (C) 2006, 2007, 2008, 2009 MobileRobots Inc.
This program is free software ; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License , or(at your option) any later version .
This program is distributed in the hope that it will be useful ,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details .
You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc ., 59 Temple Place, Suite 330, Boston, MA 02111−1307 USA
If you wish to redistribute ARIA under di�erent terms, contactMobileRobots for information about a commercial version of ARIA [email protected] orMobileRobots Inc, 10 Columbia Drive, Amherst, NH 03031; 800−639−9481∗/
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 32 / 54
Programowanie Poª¡czenie
Przykªadowy program � poª¡czenie
#include "Aria.h"int main(int argc, char∗∗ argv){Aria::init();ArArgumentParser parser(&argc, argv);parser.loadDefaultArguments();ArRobot robot;ArRobotConnector robotConnector(&parser, &robot);if (!robotConnector.connectRobot(&robot)){ArLog::log(ArLog::Terse, "Error , could not connect to robot.\n");robotConnector.logOptions();Aria::exit(1);
}robot.runAsync(true);
}
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 33 / 54
Programowanie Klasa robota
Przykªadowy program � klasa ArRobot
robot.lock();ArLog::log(ArLog::Normal, "simpleConnect: Pose=(%.2f,%.2f,%.2f),Trans. Vel=%.2f, Battery=%.2fV",robot.getX(), robot.getY(), robot.getTh(),robot.getVel(), robot.getBatteryVoltage());
robot.unlock();
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 34 / 54
Programowanie Klasa robota
Przykªadowy program � poruszanie
robot.lock();robot.enableMotors();robot.setVel(250);robot.unlock();ArUtil::sleep(5000);
robot.lock();robot.stop();robot.unlock();ArUtil::sleep(1000);
robot.lock();robot.setRotVel(10);robot.unlock();
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 35 / 54
Programowanie Akcje
Przykªadowy program � akcje
ArActionStallRecover recover;ArActionBumpers bumpers;ArActionAvoidFront avoidFrontNear("Avoid Front Near", 225, 0);ArActionAvoidFront avoidFrontFar;ArActionConstantVelocity constantVelocity("Constant Velocity", 400);
robot.addAction(&recover, 100);robot.addAction(&bumpers, 75);robot.addAction(&avoidFrontNear, 50);robot.addAction(&avoidFrontFar, 49);robot.addAction(&constantVelocity, 25);
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 36 / 54
Programowanie Akcje
Przykªadowy program � wªasna akcja
class ActionGo : public ArAction
{public:ActionGo();virtual ~ActionGo(void) {};virtual ArActionDesired ∗fire(ArActionDesired currentDesired);virtual void setRobot(ArRobot ∗robot);
protected:ArRangeDevice ∗mySonar;ArActionDesired myDesired;
};
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 37 / 54
Programowanie Akcje
Przykªadowy program � wªasna akcja
ActionGo::ActionGo() : ArAction("Go"){mySonar = NULL;
}
void ActionGo::setRobot(ArRobot ∗robot){ArAction::setRobot(robot);mySonar = robot−>findRangeDevice("sonar");if (robot == NULL){ArLog::log(ArLog::Terse, "actionExample: ActionGo: Warning: I found no sonar , ←↩deactivating .");deactivate();
}}
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 38 / 54
Programowanie Akcje
Przykªadowy program � wªasna akcja
ArActionDesired ∗ActionGo::fire(ArActionDesired currentDesired){myDesired.reset();myDesired.setVel(100);return &myDesired;
}
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 39 / 54
Programowanie Chwytak
Przykªadowy program � chwytak
ArRobot robot;ArGripper gripper(&robot);
gripper−>liftUp();gripper−>liftDown();gripper−>gripClose();gripper−>gripOpen();
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 40 / 54
Programowanie Range Devices
Przykªadowy program � RangeDevices
Aria Reference
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 41 / 54
Programowanie Kamera
Przykªadowy program � kamera
///////////////////////////////////////////////////////////////////////////// Copyright (c) 2005 Focus Robotics. All rights reserved .//// Created by : Jason Peck//// This program is free software ; you can redistribute it and/or modify it// under the terms of the GNU General Public License as published by the// Free Software Foundation; either version 2 of the License , or (at your// option) any later version .//// This program is distributed in the hope that it will be useful , but// WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// General Public License for more details ./////////////////////////////////////////////////////////////////////////////
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 42 / 54
Programowanie Kamera
Przykªadowy program � kamera
#include "cv.h"#include "highgui.h"#include "frcam.h"
int main( int argc, char∗∗ argv ){FrChannel ∗channel[2];IplImage ∗frame[2];char wndname [2][50];
int i;
for(i = 0; i < 2; i++) {channel[i] = frOpenChannel(i);if (!channel[i]) {printf("demo: frOpen failed for device%d\n",i);exit(1);
}}
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 43 / 54
Programowanie Kamera
Przykªadowy program � kamera
if (frSetChannelInput(channel[0], FR_CHAN_INPUT_TYPE_DISP)) {printf("demo: set INPUT_TYPE failed for device 0\n");exit(1);
}if (frSetChannelInput(channel[1], FR_CHAN_INPUT_TYPE_RT)) {printf("demo: set INPUT_TYPE failed for device 1\n");exit(1);
}
sprintf(wndname[0], "Disparity");sprintf(wndname[1], "Right Calib");cvNamedWindow(wndname[0], CV_WINDOW_AUTOSIZE);cvMoveWindow(wndname[0], 0, 0);cvNamedWindow(wndname[1], CV_WINDOW_AUTOSIZE);cvMoveWindow(wndname[1], 0, 520);
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 44 / 54
Programowanie Kamera
Przykªadowy program � kamera
for (i = 0; i < 2; i++) {if (frGrabFrame(channel[i]))goto out;
}for (;;) {for (i = 0; i < 2; i++) {frame[i] = frRetrieveFrame(channel[i]);if (NULL == frame)goto out;
}cvShowImage(wndname[0], frame[0]);cvShowImage(wndname[1], frame[1]);for (i = 0; i < 2; i++) {
if (frGrabFrame(channel[i]))goto out;
}if (−1 == frCheckKeypress(stat, cvWaitKey(2)))break;
}
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 45 / 54
Programowanie Kamera
Przykªadowy program � kamera
out:frCloseStatusTool(stat);for (i = 0; i < 2; i++) {frCloseChannel(channel[i]);
}}
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 46 / 54
Dalsze informacje Mobile Robots Support
Strona MobileRobots
http://robots.mobilerobots.com
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 47 / 54
Dalsze informacje Serwer Cyklon
Serwer Cyklon
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 48 / 54
Dalsze informacje Kinect
Kinect
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 49 / 54
Dalsze informacje Kamery
Kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 50 / 54
Dalsze informacje Kamery
Kamery
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 51 / 54
Dalsze informacje ROS
Robot Operating System
http://www.ros.org
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 52 / 54
Dalsze informacje Gazebo
Gazebo
http://gazebosim.org/
Adam Krechowicz Mobilne Roboty 9 stycznia 2018 53 / 54
KONIEC