{"action":"created","issue":{"url":"https://api.github.com/repos/PX4/Firmware/issues/6562","repository_url":"https://api.github.com/repos/PX4/Firmware","labels_url":"https://api.github.com/repos/PX4/Firmware/issues/6562/labels{/name}","comments_url":"https://api.github.com/repos/PX4/Firmware/issues/6562/comments","events_url":"https://api.github.com/repos/PX4/Firmware/issues/6562/events","html_url":"https://github.com/PX4/Firmware/issues/6562","id":206938377,"number":6562,"title":"[FeatureRequest] Support VISLAM with PX4 Stack on Snapdragon Platform","user":{"login":"rkintada","id":13911267,"avatar_url":"https://avatars2.githubusercontent.com/u/13911267?v=3","gravatar_id":"","url":"https://api.github.com/users/rkintada","html_url":"https://github.com/rkintada","followers_url":"https://api.github.com/users/rkintada/followers","following_url":"https://api.github.com/users/rkintada/following{/other_user}","gists_url":"https://api.github.com/users/rkintada/gists{/gist_id}","starred_url":"https://api.github.com/users/rkintada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkintada/subscriptions","organizations_url":"https://api.github.com/users/rkintada/orgs","repos_url":"https://api.github.com/users/rkintada/repos","events_url":"https://api.github.com/users/rkintada/events{/privacy}","received_events_url":"https://api.github.com/users/rkintada/received_events","type":"User","site_admin":false},"labels":[{"id":10884840,"url":"https://api.github.com/repos/PX4/Firmware/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":289822090,"url":"https://api.github.com/repos/PX4/Firmware/labels/snapdragon","name":"snapdragon","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":71,"created_at":"2017-02-11T00:11:44Z","updated_at":"2017-06-11T07:13:54Z","closed_at":null,"body":"Problem Statement\r\n--------------------\r\nThere is a VISLAM ROS example released at https://github.com/ATLFlight/ros-examples for Snapdragon Flight<sup>TM</sup>.  The examples work as standalone and does not work when PX4 stack is running.  The reason being both the \"Snapdragon::ImuManager\" and the PX4 stack try to use the same MPU9x50.\r\n\r\nThis request is to support the VISLAM with Px4 Stack.\r\n\r\nProposed Solution/Steps:\r\n--------------------------\r\nThe solution is to not use the Sensor::ImuManager directly but use the PX4's ORB topics to get the IMU Data.  Here is a summary of the changes:\r\n\r\n1.  Create a module in PX4 for VISLAM\r\n    1. The module must use the Snapdragon::CameraManager(https://github.com/ATLFlight/ros-examples/tree/master/src/camera) class to get the camera Frames\r\n    1. Create a PX4 IMUOrbWrapper class/implementation to subscribe the “accel“ and “gyro“ ORB topics.\r\n    1. For each ORB Topic the timestamp needs to be adjusted as follows:\r\n```\r\n// get the adsp offset.  \r\nint64_t dsptime;  \r\nstatic const char qdspTimerTickPath[] = \"/sys/kernel/boot_adsp/qdsp_qtimer\";  \r\nchar qdspTicksStr[20] = \"\";  \r\nstatic const double clockFreq = 1 / 19.2;  \r\nFILE * qdspClockfp = fopen( qdspTimerTickPath, \"r\" );  \r\nfread( qdspTicksStr, 16, 1, qdspClockfp );  \r\nuint64_t qdspTicks = strtoull( qdspTicksStr, 0, 16 ); \r\nfclose( qdspClockfp );  \r\ndsptime = (int64_t)( qdspTicks*clockFreq*1e3 );    \r\n//get the apps proc timestamp;  \r\nint64_t appstimeInNs;  \r\nstruct timespec t;  \r\nswitch( clockType ) \r\n{    \r\n   case SENSOR_CLOCK_SYNC_TYPE_MONOTONIC:     \r\n     clock_gettime( CLOCK_MONOTONIC, &t );      \r\n     break;    \r\n  default:     \r\n       clock_gettime( CLOCK_REALTIME, &t );      \r\n       break;  \r\n}    \r\n \r\nuint64_t timeNanoSecMonotonic = (uint64_t)(t.tv_sec) * 1000000000ULL + t.tv_nsec;  \r\nappstimeInNs = (int64_t)timeNanoSecMonotonic;  \r\noffsetInNs = appstimeInNs – dsptime;\r\n```\r\n\r\n   1. Add the computed offset to the timestamp to the ORB topic\r\n      1. This is needed as the timestamp of the ORB topics are based on the aDSP time.\r\n   1. Modify the VISLAM Manager code to add an API to get the gyro and accel data into the VISLAM engine.\r\n      1. The implementation should call the VISLAM's API mvVISLAM_AddAccel and mvVISLAM_AddGyro\r\n      1. An example implementation is in the \"Snapdragon::VislamManager::Imu_IEventListener_ProcessSamples\" located in the file: https://github.com/ATLFlight/ros-examples/blob/master/src/vislam/SnapdragonVislamManager.cpp\r\n\r\n  1. Create a Cmakelists file for the new module and add the dependency on mv and libcamera.  An example can be found in the https://github.com/ATLFlight/ros-examples/blob/master/CMakeLists.txt\r\n  1. Compile the PX4 code\r\n   1. Update the start up script to start the px4 module.\r\n"},"comment":{"url":"https://api.github.com/repos/PX4/Firmware/issues/comments/307611292","html_url":"https://github.com/PX4/Firmware/issues/6562#issuecomment-307611292","issue_url":"https://api.github.com/repos/PX4/Firmware/issues/6562","id":307611292,"user":{"login":"mhkabir","id":5557676,"avatar_url":"https://avatars2.githubusercontent.com/u/5557676?v=3","gravatar_id":"","url":"https://api.github.com/users/mhkabir","html_url":"https://github.com/mhkabir","followers_url":"https://api.github.com/users/mhkabir/followers","following_url":"https://api.github.com/users/mhkabir/following{/other_user}","gists_url":"https://api.github.com/users/mhkabir/gists{/gist_id}","starred_url":"https://api.github.com/users/mhkabir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhkabir/subscriptions","organizations_url":"https://api.github.com/users/mhkabir/orgs","repos_url":"https://api.github.com/users/mhkabir/repos","events_url":"https://api.github.com/users/mhkabir/events{/privacy}","received_events_url":"https://api.github.com/users/mhkabir/received_events","type":"User","site_admin":false},"created_at":"2017-06-11T07:13:54Z","updated_at":"2017-06-11T07:13:54Z","body":"Yeah you need to add the velocity update to LPE. "}}
{"actor":{"display_login":"mhkabir"}}