Skip to content

A cross-platform real-time 3D spatial data visualization

License

Notifications You must be signed in to change notification settings

bmegli/ev3dev-mapping-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ev3dev-mapping-ui

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

Alt text

Supported Platforms

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.

Installation Instructions

Required Unity Version: 2017.3.0f3 or newer

  1. Download Unity

  2. Clone the project with submodules

    git clone --recursive https://github.com/bmegli/ev3dev-mapping-ui

  3. Open the project in Unity

Getting Started

The easiest way to start is working with recorded UDP communication:

  1. Open the project in Unity
  2. Open the Base scene
  3. Hit Play button in Unity
  4. 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.

Other Recorded Sessions

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.

Hardware

On EV3 follow Building Instructions for ev3dev-mapping-modules.

Hardware Getting Started

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:

  1. Follow printed instructions on EV3 (if any)
  2. On PC open ev3dev-mapping-ui in Unity
    • open corresponding Test Scene for the Hardware and select Robot game object
    • in Network component set Host Ip to your PC ip and Robot Ip to your EV3 ip
    • hit Play Unity button

Use Shift or W S A D Shift or joy/pad to control the robot.

Mapping/Scanning

This section summarizes how to get result like in 3D mapping/scanning project with ev3dev OS and Unity UI.

Hardware

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

Instructions

  1. On PC follow Installation Instructions and Gettings Started for ev3dev-mapping-ui
  2. On EV3 follow Building Instructions for ev3dev-mapping-modules
  3. On PC open ev3dev-mapping-ui Base scene in Unity
    • select Robot game object
    • in Robot Required component change Session Directory (e.g. "session1")
    • in Replay component change Mode to None
    • in Network component set Host Ip to your PC ip
    • in Network component set Robot 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)
  4. On EV3 (through ssh/putty) run ev3init script and ev3control
cd ev3dev-mapping-modules/bin
sudo ./ev3init.sh #only once after each boot
./ev3control 8004 500
  1. On PC hit Play button in Unity

Troubleshooting

  1. ev3init.sh script will not work if other init scripts were called before (reboot, sorry)
  2. If the robot moves but ev3dev-mapping-ui gets no data check your firewall settings (e.g. make exception for Unity Editor)
  3. 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.
  4. If you want to build the project as standalone copy UDP folder to you build location (for replays)
  5. If you have some problems read the Unity console output with ~ key
  6. If laser (hardware) fails just after starting let it spin for 15 seconds and warmup (from ssh) and only later hit Play.

About

A cross-platform real-time 3D spatial data visualization

Resources

License

Stars

Watchers

Forks

Packages

No packages published