Skip to content

Commit

Permalink
finalize ros to xviz pipeline with working location data
Browse files Browse the repository at this point in the history
  • Loading branch information
leonzz committed Mar 4, 2019
1 parent 1433d0d commit b1957c1
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 397 deletions.
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,41 @@ Names in alphabetical order:
- [Reid Stevens](mailto:[email protected])

## System Diagram

Note: we've abandoned a Unity based approach in favor of the following new approach:

![System Overview](argus-overview.svg)

Diagram created with [Draw.io](https://www.draw.io/)

## Components:

- ROS connector: the C++/C# interface that read data from ROS topics and send over to the Unity C# runtime.
- [`rosbridge-xviz-connector`](rosbridge-xviz-connector): A data proxy server that read from rosbridge-server and serves data in [XVIZ](https://github.com/uber/xviz) format, which is a opensource protocol from Uber to stream/visualize autonomy data.

- Map Rendering: read map data from disk or online service and render an image based on the input GPS location.
- GUI: A web UI based on Uber's [streetscape.gl](https://github.com/uber/streetscape.gl) which is specialized to visualize data in XVIZ format. Right now we are using the demo example from [streetscape.gl](https://github.com/uber/streetscape.gl/tree/master/examples/get-started) with some minor changes.

- Unity:
- Main rendering loop: read data from the first 2 components and render the following data:
- 3D point cloud
- lane detection result
- obstacle detection result
- map image in a window (might be expandable)
- Configuration: read in a config file (or with a button in the UI to set config at runtime) to choose which subset of data to render, size of the window etc.
- Map Tile Server: A map tile server that reads local OpenStreemMap data files and serve map images to the GUI.

## Build and Run

Dependencies in ubuntu to run Unity3D build:
Note: If running from a VM, make sure to enable 3D acceleration for it's graphics setting.

1. Follow the steps (1, 2, and 4) in [rosbridge-xviz-connector](rosbridge-xviz-connector) to start the neccessary services.

2. Start the GUI

```
cd gui
# please run yarn install before the next command to download dependencies
yarn start-live
```
A browser window will automatically open and connect to the server from step 1.
3. In developement/simulation mode, play the rosbag to start piping in data, e.g.
```
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module mesa-utils nux-tools
```
```
rosbag play /mnt/hgfs/argus-autoronto/project-data/_2019-01-18-15-19-31_public_roads.ba
```
If running from a VM, make sure to enable 3D acceleration for it's graphics setting.
4. After starting the rosbag, if the UI is not updated, refresh the browser window. Since some rosbag recordings are very short, be sensitive to the timing of refresh and play.
2 changes: 1 addition & 1 deletion argus-overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions rosbridge-xviz-connector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@ process.on('SIGTERM', gracefulShutdown);
process.on('SIGINT', gracefulShutdown);

rosBridgeClient.on('connection', function() {
console.log('Connected to websocket server.');
console.log('Connected to rosbridge websocket server.');
});

rosBridgeClient.on('error', function(error) {
console.log('Error connecting to websocket server: ', error);
console.log('Error connecting to rosbridge websocket server: ', error);
});

rosBridgeClient.on('close', function() {
console.log('Connection to websocket server closed.');
console.log('Connection to rosbridge websocket server closed.');
});

listener.subscribe(function(message) {
// var msgNew = 'Received message on ' + listener.name + JSON.stringify(message, null, 2) + "\n";
let timestamp = `${message.header.stamp.secs}.${message.header.stamp.nsecs}`;
// console.log("new msg (time, lat, lng): ", timestamp, message.latitude, message.longitude);
xvizServer.updateLocation(message.latitude, message.longitude, message.altitude, parseFloat(timestamp));
xvizServer.updateLocation(message.header.seq, message.latitude, message.longitude, message.altitude, parseFloat(timestamp));
});

/* *******************************************
Expand Down
Binary file added rosbridge-xviz-connector/mock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b1957c1

Please sign in to comment.