A cross-platform real-time 3D spatial data visualization working with ev3dev-mapping-modules
For high-level project overview visit ev3dev-mapping web page
For project meta-repository visit ev3dev-mapping
This is Unity project. In theory it should work on platforms ranging from desktops, through consoles to mobile devices and TVs. See Unity platforms for the full list. Note that currently only some desktops were tested. Other platforms may not work, need some tweaking or disabling some functionality.
Required Unity Version: 2017.3.0f3 or newer
-
Download Unity
-
Clone the project with submodules
git clone --recursive https://github.com/bmegli/ev3dev-mapping-ui
-
Open the project in Unity
The easiest way to start is working with recorded UDP communication:
- Open the project in Unity
- Open the Base scene
- Hit Play button in Unity
- Click Replay button in UI
If all went well you should see a moving yellow brick and the readings as they were collected.
Mouse LMB moves RMB rotates Wheel for up down ~ shows/hides console Esc shows/hides UI.
Change Robot
-> Robot Required
-> Session Directory
to: Body
, Building
, Faces
, Room
, SnapshotTour
or your own past session.
Then follow with Play button in Unity and Replay button in UI.
You may also try FeatureExtraction scene with NoisyRoom
or SnapshotTour
sessions.
On EV3 follow Building Instructions for ev3dev-mapping-modules.
Hardware | Connection | ev3dev-mapping-ui component | ev3dev-mapping-modules | Test Scene | First ev3dev-mapping-modules step |
---|---|---|---|---|---|
2 x EV3 Large Servo Motor | outA, outD | Drive, Odometry | ev3drive, ev3odometry | TestingTheDrive WithOdometry | ./ev3control 8004 500 |
above + CruizCore gyroscope | above + in3 | Drive, DeadReconning | ev3drive, ev3dead-reconning | TestingTheDrive WithDeadReconning | sudo ./TestingTheDriveWithDeadReconning.sh |
WiFi dongle | USB (wlan0) | WiFi | ev3wifi | TestingTheWiFi | ./ev3control 8004 500 |
Neato XV11 Lidar | in1, outC, USB hub | Laser | ev3laser | TestingTheLidar | ./TestingTheLidar.sh |
On EV3 (through ssh/putty) execute First ev3dev-mapping-modules step from the table and:
- Follow printed instructions on EV3 (if any)
- On PC open ev3dev-mapping-ui in Unity
- open corresponding Test Scene for the Hardware and select
Robot
game object - in
Network
component setHost Ip
to your PC ip andRobot Ip
to your EV3 ip - hit Play Unity button
- open corresponding Test Scene for the Hardware and select
Use ← ↑ → ↓ Shift or W S A D Shift or joy/pad to control the robot.
This section summarizes how to get result like in 3D mapping/scanning project with ev3dev OS and Unity UI.
Hardware | Connection | Extra Info |
---|---|---|
WiFi dongle | USB hub (wlan0) | |
EV3 Large Servo Motor (left) | outA | |
EV3 Large Servo Motor (right) | outD | |
Neato XV11 Lidar (horizontal) | outC, in1, USB hub | |
Neato XV11 Lidar (vertical) | outB, in2, USB hub | one lidar -> remove one Laser game object frome Base scene and comment out its entries in ev3init.sh |
CruizCore gyroscope | in3 | no gyroscope -> replace DeadReconning with Odometry (worse estimate) and comment out entry in ev3init.sh |
- On PC follow Installation Instructions and Gettings Started for ev3dev-mapping-ui
- On EV3 follow Building Instructions for ev3dev-mapping-modules
- On PC open ev3dev-mapping-ui
Base
scene in Unity- select
Robot
game object - in
Robot Required
component changeSession Directory
(e.g. "session1") - in
Replay
component changeMode
toNone
- in
Network
component setHost Ip
to your PC ip - in
Network
component setRobot Ip
to your EV3 ip - tweak other components and
Robot
children if your geometry differs- set your wheel diameter in
Robot
->Physics
->Wheel Diameter Mm
- set distance between wheels in
Robot
->Physics
->Wheelbase Mm
- set horizontal lidar position/rotation in
Robot
->LaserXZ
->Transform
(relative to midpoint between wheels) - set vertical lidar position/rotation in
Robot
->LaserXY
->Transform
(relative to midpoint between wheels)
- set your wheel diameter in
- select
- On EV3 (through ssh/putty) run
ev3init
script andev3control
cd ev3dev-mapping-modules/bin
sudo ./ev3init.sh #only once after each boot
./ev3control 8004 500
- On PC hit Play button in Unity
ev3init.sh
script will not work if other init scripts were called before (reboot, sorry)- If the robot moves but ev3dev-mapping-ui gets no data check your firewall settings (e.g. make exception for Unity Editor)
- If you have a laptop with both integrated and dedicated GPU make sure Unity is using the dedicated one. Unity likes to use the first if not forced.
- If you want to build the project as standalone copy UDP folder to you build location (for replays)
- If you have some problems read the Unity console output with ~ key
- If laser (hardware) fails just after starting let it spin for 15 seconds and warmup (from ssh) and only later hit Play.