Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
* Support for VLP32c
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berger <christian.berger@gu.se>
  • Loading branch information
chrberger committed Sep 7, 2018
1 parent 2a23cea commit 1dd31c3
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions webapp/index.js.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ app.get("/details", function(req, res) {
// Extract meta data from a rec-file.
var output = "";
try {
output = execSync('if [ -f external.odvd ]; then rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./external.odvd 2>/dev/null; else rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./opendlv-standard-message-set-v0.9.6.odvd 2>/dev/null; fi', { shell: '/bin/bash' }).toString();
output = execSync('if [ -f external.odvd ]; then rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./external.odvd 2>/dev/null; else rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./opendlv-standard-message-set-v0.9.7.odvd 2>/dev/null; fi', { shell: '/bin/bash' }).toString();
}
catch (e) {}

Expand Down Expand Up @@ -201,7 +201,7 @@ app.post('/deleteodvdfile', (req, res) => {
});
});
app.post('/convertrec2csv', (req, res) => {
var process_cluonrec2csv = execSync('rm -f ' + req.body.recordingFile + '.csv.zip && if [ -f external.odvd ]; then cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=external.odvd; else cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=opendlv-standard-message-set-v0.9.6.odvd; fi && zip ./' + req.body.recordingFile + '.csv.zip *.csv && rm -f *.csv', { shell: '/bin/bash' });
var process_cluonrec2csv = execSync('rm -f ' + req.body.recordingFile + '.csv.zip && if [ -f external.odvd ]; then cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=external.odvd; else cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=opendlv-standard-message-set-v0.9.7.odvd; fi && zip ./' + req.body.recordingFile + '.csv.zip *.csv && rm -f *.csv', { shell: '/bin/bash' });
console.log('[opendlv-vehicle-view] Started cluon-rec2csv, PID: ' + process_cluonrec2csv.pid);
res.send ({
status : "200",
Expand All @@ -211,7 +211,7 @@ app.post('/convertrec2csv', (req, res) => {
});

app.post('/convertrec2csvpng', (req, res) => {
var process_cluonrec2csvpng = execSync('if [ "$(docker images -q chalmersrevere/rec2csv-png 2> /dev/null)" == "" ]; then docker build -t chalmersrevere/rec2csv-png https://github.com/chalmers-revere/rec2csv-png.git; fi && rm -f ' + req.body.recordingFile + '.csv.zip && mkdir -p recordings/tmp && if [ -f external.odvd ]; then cp external.odvd recordings/tmp/messages.odvd; else cp opendlv-standard-message-set-v0.9.6.odvd recordings/tmp/messages.odvd; fi && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp chalmersrevere/rec2csv-png --rec=../' + req.body.recordingFile + ' --odvd=messages.odvd && cd recordings/tmp && zip -r9 ../../' + req.body.recordingFile + '.csv.zip *.csv opendlv.proxy.ImageReading* && cd .. && rm -fr tmp && cd ..', { shell: '/bin/bash' });
var process_cluonrec2csvpng = execSync('if [ "$(docker images -q chalmersrevere/rec2csv-png 2> /dev/null)" == "" ]; then docker build -t chalmersrevere/rec2csv-png https://github.com/chalmers-revere/rec2csv-png.git; fi && rm -f ' + req.body.recordingFile + '.csv.zip && mkdir -p recordings/tmp && if [ -f external.odvd ]; then cp external.odvd recordings/tmp/messages.odvd; else cp opendlv-standard-message-set-v0.9.7.odvd recordings/tmp/messages.odvd; fi && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp chalmersrevere/rec2csv-png --rec=../' + req.body.recordingFile + ' --odvd=messages.odvd && cd recordings/tmp && zip -r9 ../../' + req.body.recordingFile + '.csv.zip *.csv opendlv.proxy.ImageReading* && cd .. && rm -fr tmp && cd ..', { shell: '/bin/bash' });

console.log(process_cluonrec2csvpng.toString());

Expand All @@ -224,7 +224,7 @@ app.post('/convertrec2csvpng', (req, res) => {
});

app.post('/convertrec2webm', (req, res) => {
var process_cluonrec2webm = execSync('if [ "$(docker images -q chalmersrevere/rec2csv-png:v0.0.2 2> /dev/null)" == "" ]; then docker build -t chalmersrevere/rec2csv-png:v0.0.2 https://github.com/chalmers-revere/rec2csv-png.git; fi && rm -f ' + req.body.recordingFile + '.webm.zip && mkdir -p recordings/tmp && if [ -f external.odvd ]; then cp external.odvd recordings/tmp/messages.odvd; else cp opendlv-standard-message-set-v0.9.6.odvd recordings/tmp/messages.odvd; fi && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp chalmersrevere/rec2csv-png:v0.0.2 --rec=../' + req.body.recordingFile + ' --odvd=messages.odvd && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp --entrypoint="" chalmersrevere/rec2csv-png:v0.0.2 /usr/bin/generate_webm.sh && cd recordings/tmp && zip -r9 ../../' + req.body.recordingFile + '.webm.zip *.webm && cd .. && rm -fr tmp && cd ..', { shell: '/bin/bash' });
var process_cluonrec2webm = execSync('if [ "$(docker images -q chalmersrevere/rec2csv-png:v0.0.2 2> /dev/null)" == "" ]; then docker build -t chalmersrevere/rec2csv-png:v0.0.2 https://github.com/chalmers-revere/rec2csv-png.git; fi && rm -f ' + req.body.recordingFile + '.webm.zip && mkdir -p recordings/tmp && if [ -f external.odvd ]; then cp external.odvd recordings/tmp/messages.odvd; else cp opendlv-standard-message-set-v0.9.7.odvd recordings/tmp/messages.odvd; fi && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp chalmersrevere/rec2csv-png:v0.0.2 --rec=../' + req.body.recordingFile + ' --odvd=messages.odvd && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp --entrypoint="" chalmersrevere/rec2csv-png:v0.0.2 /usr/bin/generate_webm.sh && cd recordings/tmp && zip -r9 ../../' + req.body.recordingFile + '.webm.zip *.webm && cd .. && rm -fr tmp && cd ..', { shell: '/bin/bash' });

console.log(process_cluonrec2webm.toString());

Expand Down
6 changes: 3 additions & 3 deletions webapp/index.js.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ app.get("/details", function(req, res) {
// Extract meta data from a rec-file.
var output = "";
try {
output = execSync('if [ -f external.odvd ]; then rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./external.odvd 2>/dev/null; else rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./opendlv-standard-message-set-v0.9.6.odvd 2>/dev/null; fi', { shell: '/bin/bash' }).toString();
output = execSync('if [ -f external.odvd ]; then rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./external.odvd 2>/dev/null; else rec-metadataToJSON --rec=./recordings/' + req.query.rec + ' --odvd=./opendlv-standard-message-set-v0.9.7.odvd 2>/dev/null; fi', { shell: '/bin/bash' }).toString();
}
catch (e) {}

Expand Down Expand Up @@ -200,7 +200,7 @@ app.post('/deleteodvdfile', (req, res) => {
});
});
app.post('/convertrec2csv', (req, res) => {
var process_cluonrec2csv = execSync('rm -f ' + req.body.recordingFile + '.csv.zip && if [ -f external.odvd ]; then cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=external.odvd; else cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=opendlv-standard-message-set-v0.9.6.odvd; fi && zip ./' + req.body.recordingFile + '.csv.zip *.csv && rm -f *.csv', { shell: '/bin/bash' });
var process_cluonrec2csv = execSync('rm -f ' + req.body.recordingFile + '.csv.zip && if [ -f external.odvd ]; then cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=external.odvd; else cluon-rec2csv --rec=' + req.body.recordingFileToConvert + ' --odvd=opendlv-standard-message-set-v0.9.7.odvd; fi && zip ./' + req.body.recordingFile + '.csv.zip *.csv && rm -f *.csv', { shell: '/bin/bash' });
console.log('[opendlv-vehicle-view] Started cluon-rec2csv, PID: ' + process_cluonrec2csv.pid);
res.send ({
status : "200",
Expand All @@ -210,7 +210,7 @@ app.post('/convertrec2csv', (req, res) => {
});

app.post('/convertrec2csvpng', (req, res) => {
var process_cluonrec2csv = execSync('if [ "$(docker images -q chalmersrevere/rec2csv-png 2> /dev/null)" == "" ]; then docker build -t chalmersrevere/rec2csv-png https://github.com/chalmers-revere/rec2csv-png.git; fi && rm -f ' + req.body.recordingFile + '.csv.zip && mkdir -p recordings/tmp && if [ -f external.odvd ]; then cp external.odvd recordings/tmp/messages.odvd; else cp opendlv-standard-message-set-v0.9.6.odvd recordings/tmp/messages.odvd; fi && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp chalmersrevere/rec2csv-png --rec=../' + req.body.recordingFile + ' --odvd=messages.odvd && cd recordings/tmp && zip -r9 ../../' + req.body.recordingFile + '.csv.zip *.csv opendlv.proxy.ImageReading* && cd .. && rm -fr tmp && cd ..', { shell: '/bin/bash' });
var process_cluonrec2csv = execSync('if [ "$(docker images -q chalmersrevere/rec2csv-png 2> /dev/null)" == "" ]; then docker build -t chalmersrevere/rec2csv-png https://github.com/chalmers-revere/rec2csv-png.git; fi && rm -f ' + req.body.recordingFile + '.csv.zip && mkdir -p recordings/tmp && if [ -f external.odvd ]; then cp external.odvd recordings/tmp/messages.odvd; else cp opendlv-standard-message-set-v0.9.7.odvd recordings/tmp/messages.odvd; fi && docker run --rm --volumes-from=opendlv-vehicle-view -w /opt/vehicle-view/recordings/tmp chalmersrevere/rec2csv-png --rec=../' + req.body.recordingFile + ' --odvd=messages.odvd && cd recordings/tmp && zip -r9 ../../' + req.body.recordingFile + '.csv.zip *.csv opendlv.proxy.ImageReading* && cd .. && rm -fr tmp && cd ..', { shell: '/bin/bash' });

console.log(process_cluonrec2csv.toString());

Expand Down
26 changes: 23 additions & 3 deletions webapp/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ var GL_position_index_vlp16 = 0;
var GL_position_index_hdl32e_12 = 0;
var GL_position_index_hdl32e_11 = 0;
var GL_position_index_hdl32e_9 = 0;

// Setup look-up table for interleaved vertical layers.
const verticalAngles16 = [-15.0, -13.0, -11.0, -9.0, -7.0, -5.0, -3.0, -1.0, 1.0, 3.0, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0];
const verticalAngles12 = [-30.67, -29.33, -25.33, -21.32, -17.32, -13.31, -9.31, -5.3, -1.3, 2.71, 6.71, 10.72];
const verticalAngles11 = [-28.0, -26.66, -22.66, -18.65, -14.65, -10.64, -6.64, -2.63, 1.37, 5.38, 9.38];
const verticalAngles9 = [-23.99, -19.99, -15.98, -11.98, -7.97, -3.97, 0.04, 4.04, 8.05];
const verticalAngles12_hdl32e = [-30.67, -29.33, -25.33, -21.32, -17.32, -13.31, -9.31, -5.3, -1.3, 2.71, 6.71, 10.72];
const verticalAngles11_hdl32e = [-28.0, -26.66, -22.66, -18.65, -14.65, -10.64, -6.64, -2.63, 1.37, 5.38, 9.38];
const verticalAngles9_hdl32e = [-23.99, -19.99, -15.98, -11.98, -7.97, -3.97, 0.04, 4.04, 8.05];

const verticalAngles12_vlp32c = [ -25.0, -15.639, -7.254, -4.667, -3.333, -2.333, -1.333, -0.333, 0.667, 1.667, 4.667, 15.0 ];
const verticalAngles11_vlp32c = [ -11.31, -8.843, -5.333, -3.667, -2.667, -1.667, -0.667, 0.333, 1.333, 3.333, 10.333 ];
const verticalAngles9_vlp32c = [ -6.148, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.333, 7.0 ];

var g_perception = {
front : 0,
Expand Down Expand Up @@ -345,6 +350,21 @@ function processEnvelope(incomingData) {
// CompactPointCloud
var distances = window.atob(data.opendlv_proxy_PointCloudReading.distances);

// Differentiate between HDL32e and VLP32c.
var verticalAngles12;
var verticalAngles11;
var verticalAngles9;
if (0 == data.opendlv_proxy_PointCloudReading.typeOfVerticalAngularLayout) {
verticalAngles12 = verticalAngles12_hdl32e;
verticalAngles11 = verticalAngles11_hdl32e;
verticalAngles9 = verticalAngles9_hdl32e;
}
else if (1 == data.opendlv_proxy_PointCloudReading.typeOfVerticalAngularLayout) {
verticalAngles12 = verticalAngles12_vlp32c;
verticalAngles11 = verticalAngles11_vlp32c;
verticalAngles9 = verticalAngles9_vlp32c;
}

var numberOfBitsForIntensity = data.opendlv_proxy_PointCloudReading.numberOfBitsForIntensity;
var startAzimuth = data.opendlv_proxy_PointCloudReading.startAzimuth;
var endAzimuth = data.opendlv_proxy_PointCloudReading.endAzimuth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

// These messages are necessary to control the remote player.
message cluon.data.PlayerCommand [id = 9] {
uint8 command [id = 1]; // 0 = nothing, 1 = play, 2 = pause, 3 = seekTo, 4 = step
float seekTo [id = 2];
}

message cluon.data.PlayerStatus [id = 10] {
uint8 state [id = 1]; // 0 = unknown, 1 = loading file, 2 = playback
uint32 numberOfEntries [id = 2];
uint32 currentEntryForPlayback [id = 3];
}

// This message is a legacy one to support controlling Snowfox and Rhino.
message opendlv.proxy.ActuationRequest [id = 160] {
float acceleration [id = 1];
float steering [id = 2];
bool isValid [id = 3];
}

////////////////////////////////////////////////////////////////////////////////

message opendlv.sim.Frame [id = 1001] {
float x [id = 1];
float y [id = 2];
Expand Down Expand Up @@ -189,6 +168,7 @@ message opendlv.proxy.PointCloudReading [id = 49] {
uint8 entriesPerAzimuth [id = 3];
bytes distances [id = 4];
uint8 numberOfBitsForIntensity [id = 5];
uint8 typeOfVerticalAngularLayout [id = 6]; // 0 = vertical angular layout for HDL32e, 1 = vertical angular layout fo VLP32c, ignored for other sensors.
}

message opendlv.proxy.PointCloudReadingShared [id = 28] {
Expand Down
2 changes: 1 addition & 1 deletion webapp/views/joystick.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
document.getElementById("connectionStatusText").style.color = "#3CB371";
document.getElementById("connectionStatusText").innerHTML = "connected";
var odvd = getResourceFrom("opendlv-standard-message-set-v0.9.6.odvd");
var odvd = getResourceFrom("opendlv-standard-message-set-v0.9.7.odvd");
console.log("Loaded " + __libcluon.setMessageSpecification(odvd) + " messages from specification.");
};
Expand Down
2 changes: 1 addition & 1 deletion webapp/views/main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ const ODVD_FILE = "external.odvd";
</script>
{{else}}
<script>
const ODVD_FILE = "opendlv-standard-message-set-v0.9.6.odvd";
const ODVD_FILE = "opendlv-standard-message-set-v0.9.7.odvd";
</script>
{{/if}}

Expand Down

0 comments on commit 1dd31c3

Please sign in to comment.