{"action":"created","issue":{"url":"https://api.github.com/repos/diydrones/ardupilot/issues/3099","labels_url":"https://api.github.com/repos/diydrones/ardupilot/issues/3099/labels{/name}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/issues/3099/comments","events_url":"https://api.github.com/repos/diydrones/ardupilot/issues/3099/events","html_url":"https://github.com/diydrones/ardupilot/pull/3099","id":114119764,"number":3099,"title":"AP_Eigen","user":{"login":"dgrat","id":4668178,"avatar_url":"https://avatars.githubusercontent.com/u/4668178?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrat","html_url":"https://github.com/dgrat","followers_url":"https://api.github.com/users/dgrat/followers","following_url":"https://api.github.com/users/dgrat/following{/other_user}","gists_url":"https://api.github.com/users/dgrat/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrat/subscriptions","organizations_url":"https://api.github.com/users/dgrat/orgs","repos_url":"https://api.github.com/users/dgrat/repos","events_url":"https://api.github.com/users/dgrat/events{/privacy}","received_events_url":"https://api.github.com/users/dgrat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/diydrones/ardupilot/labels/Need-rework","name":"Need-rework","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/diydrones/ardupilot/milestones/15","html_url":"https://github.com/diydrones/ardupilot/milestones/Plane%20v3.6.0","labels_url":"https://api.github.com/repos/diydrones/ardupilot/milestones/15/labels","id":1462106,"number":15,"title":"Plane v3.6.0","description":"","creator":{"login":"magicrub","id":4782875,"avatar_url":"https://avatars.githubusercontent.com/u/4782875?v=3","gravatar_id":"","url":"https://api.github.com/users/magicrub","html_url":"https://github.com/magicrub","followers_url":"https://api.github.com/users/magicrub/followers","following_url":"https://api.github.com/users/magicrub/following{/other_user}","gists_url":"https://api.github.com/users/magicrub/gists{/gist_id}","starred_url":"https://api.github.com/users/magicrub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicrub/subscriptions","organizations_url":"https://api.github.com/users/magicrub/orgs","repos_url":"https://api.github.com/users/magicrub/repos","events_url":"https://api.github.com/users/magicrub/events{/privacy}","received_events_url":"https://api.github.com/users/magicrub/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":0,"state":"open","created_at":"2015-12-15T21:22:44Z","updated_at":"2015-12-22T02:09:21Z","due_on":"2016-04-01T07:00:00Z","closed_at":null},"comments":38,"created_at":"2015-10-29T18:42:52Z","updated_at":"2015-12-23T21:32:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/diydrones/ardupilot/pulls/3099","html_url":"https://github.com/diydrones/ardupilot/pull/3099","diff_url":"https://github.com/diydrones/ardupilot/pull/3099.diff","patch_url":"https://github.com/diydrones/ardupilot/pull/3099.patch"},"body":"Included: examples and a reference implementation on the example of the compass learning algorithm.\r\nEigen is a slim algebra library and already used by the PX4 flight stack.\r\nThe Current Implementation of AP_Math is not interface complete and lacks optimization for ARM processors.\r\nUsing Eigen will increase performance. Currently, there is an increase is in binary size of the executable by ~3.5k.\r\nThe memory consumption should stay the same. The performance increase is platform dependent.\r\nI measured something between 30 % and 200 % on some i386 cpus, but not ARM yet."},"comment":{"url":"https://api.github.com/repos/diydrones/ardupilot/issues/comments/166993267","html_url":"https://github.com/diydrones/ardupilot/pull/3099#issuecomment-166993267","issue_url":"https://api.github.com/repos/diydrones/ardupilot/issues/3099","id":166993267,"user":{"login":"dgrat","id":4668178,"avatar_url":"https://avatars.githubusercontent.com/u/4668178?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrat","html_url":"https://github.com/dgrat","followers_url":"https://api.github.com/users/dgrat/followers","following_url":"https://api.github.com/users/dgrat/following{/other_user}","gists_url":"https://api.github.com/users/dgrat/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrat/subscriptions","organizations_url":"https://api.github.com/users/dgrat/orgs","repos_url":"https://api.github.com/users/dgrat/repos","events_url":"https://api.github.com/users/dgrat/events{/privacy}","received_events_url":"https://api.github.com/users/dgrat/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T21:32:55Z","updated_at":"2015-12-23T21:32:55Z","body":"I think I will write converter functions. However, before starting I would like offer my concerns. Such functions are not easy to implement, because addon functions must fit to every possible size of the underlying base class and vectors are treated maybe slightly differently than matrices. I will have to add size checks at run time which will make the conversion slower. At the moment this is solved very efficiently by the fact that conversion is just possible for equal sized objects (Vector3f to Eigen::Vector3f, ..), which I will call specialized classes in the following. I will have to think also about certain scenarios as well:\r\n  - what to do if I want to copy smaller vector into bigger matrices and vice versa\r\n  - what to do if I want to copy matrix into vector and vice versa (Eigen doesn't know about its usage)\r\nAs mentioned, we will lose all the comfort, because no copy operator will be there. You are right, in the Eigen guide is written to think carefully when to use derivation and to prefer the the mentions addons. Nevertheless, type conversions are exactly the exception, because of all the side conditions to consider on the level of implementation.\r\nI know it looks a little blown up, because I implemented for three _specialized_ classes type conversions. However, I doubt it will be more complicated to implement three or more _safe_ functions for the same conversion.\r\nOn the other hand, it would be really better to have less types and it might be really less confusing. \r\n"}}