Open haoyunfeix opened 7 years ago
In JS version of slam_tutorial_1_web:
slam_tutorial_1_web
let slamModule = require('slam'); const mapResolution = 0.025; let slam; slamModule.createInstance().then((instance) => { startServer(); slam = instance; let slamOptions = { occupancyMapResolution: mapResolution, }; return slam.setInstanceOptions(slamOptions); }).then(() => { console.log('Starting SLAM...'); slam.on('tracking', (result) => { slam.getOccupancyMapUpdate().then((mapData) => { if (mapData.tileCount <= 0) { // occupancy map is updated. return; } }); }); return slam.start(); }).catch((error) => { console.log('error: ' + error); });
The occupancy map update FPS of getOccupancyMapUpdate JS API is less than 1 FPS.
getOccupancyMapUpdate
In C++ version:
class slam_event_handler : public video_module_interface::processing_event_handler { public: slam_event_handler() {} ~slam_event_handler() = default; void module_output_ready(video_module_interface* sender, correlated_sample_set* sample) { slam* slam_module = dynamic_cast<slam*>(sender); if (!occupancy) { // occupancy = slam_module->create_occupancy_map(50 * 50); occupancy_res = slam_module->get_occupancy_map_resolution(); } auto occ_status = slam_module->get_occupancy_map_update(occupancy); int count = occupancy->get_tile_count(); if (occ_status >= status::status_no_error && count > 0) { // occupancy map is updated } } };
In similar test environment, the native get_occupancy_map_update API update rate is about 8 FPS.
get_occupancy_map_update
In JS version of
slam_tutorial_1_web
:The occupancy map update FPS of
getOccupancyMapUpdate
JS API is less than 1 FPS.In C++ version:
In similar test environment, the native
get_occupancy_map_update
API update rate is about 8 FPS.