{"action":"opened","issue":{"url":"https://api.github.com/repos/RoboticsURJC/JdeRobot/issues/16","labels_url":"https://api.github.com/repos/RoboticsURJC/JdeRobot/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/RoboticsURJC/JdeRobot/issues/16/comments","events_url":"https://api.github.com/repos/RoboticsURJC/JdeRobot/issues/16/events","html_url":"https://github.com/RoboticsURJC/JdeRobot/issues/16","id":64122104,"number":16,"title":"Properly implement the C interfaces in progeo","user":{"login":"ojgarciab","id":4188035,"avatar_url":"https://avatars.githubusercontent.com/u/4188035?v=3","gravatar_id":"","url":"https://api.github.com/users/ojgarciab","html_url":"https://github.com/ojgarciab","followers_url":"https://api.github.com/users/ojgarciab/followers","following_url":"https://api.github.com/users/ojgarciab/following{/other_user}","gists_url":"https://api.github.com/users/ojgarciab/gists{/gist_id}","starred_url":"https://api.github.com/users/ojgarciab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojgarciab/subscriptions","organizations_url":"https://api.github.com/users/ojgarciab/orgs","repos_url":"https://api.github.com/users/ojgarciab/repos","events_url":"https://api.github.com/users/ojgarciab/events{/privacy}","received_events_url":"https://api.github.com/users/ojgarciab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-24T23:02:41Z","updated_at":"2015-03-24T23:02:41Z","closed_at":null,"body":"When compiling code there is some warnings that have to be avoided:\r\n\r\n```\r\nScanning dependencies of target progeo\r\n[ 29%] Building C object src/stable/libs/progeo/CMakeFiles/progeo.dir/progeo.c.o\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:581:6: warning: conflicting types for ‘update_camera_matrix’ [enabled by default]\r\n void update_camera_matrix(TPinHoleCamera *camera)\r\n      ^\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:345:2: note: previous implicit declaration of ‘update_camera_matrix’ was here\r\n  update_camera_matrix(&camera);\r\n  ^\r\nLinking C static library libprogeo.a\r\n[ 29%] Built target progeo\r\nScanning dependencies of target progeoshare\r\n[ 29%] Building C object src/stable/libs/progeo/CMakeFiles/progeoshare.dir/progeo.c.o\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:581:6: warning: conflicting types for ‘update_camera_matrix’ [enabled by default]\r\n void update_camera_matrix(TPinHoleCamera *camera)\r\n      ^\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:345:2: note: previous implicit declaration of ‘update_camera_matrix’ was here\r\n  update_camera_matrix(&camera);\r\n  ^\r\nLinking C shared library libprogeo.so\r\n```\r\n\r\nThis problem is due to lack of definition of the functions in C compiler at the header file:\r\n\r\n\r\n```C++\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n\tTPinHoleCamera xmlReader(TPinHoleCamera* camera, const char *filename);\r\n\tvoid xmlWriter(TPinHoleCamera camera, const char *filename);\r\n\tvoid update_camera_matrix(TPinHoleCamera *camera);\r\n\tvoid reverse_update_camera_matrix(TPinHoleCamera *camera);\r\n\tvoid update_stereocamera_matrix(TPinHoleStereocamera *stereo);\r\n\tint project(HPoint3D in, HPoint2D *out, TPinHoleCamera camera);\r\n\tint backproject(HPoint3D *out, HPoint2D in, TPinHoleCamera camera);\r\n\tint displayline(HPoint2D p1, HPoint2D p2, HPoint2D *a, HPoint2D *b, TPinHoleCamera camera);\r\n\tvoid display_camerainfo(TPinHoleCamera camera);\r\n}\r\n#endif\r\n```\r\n\r\nIt could be fixed creating a \"else\" case:\r\n\r\n```\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n\tTPinHoleCamera xmlReader(TPinHoleCamera* camera, const char *filename);\r\n\tvoid xmlWriter(TPinHoleCamera camera, const char *filename);\r\n\tvoid update_camera_matrix(TPinHoleCamera *camera);\r\n\tvoid reverse_update_camera_matrix(TPinHoleCamera *camera);\r\n\tvoid update_stereocamera_matrix(TPinHoleStereocamera *stereo);\r\n\tint project(HPoint3D in, HPoint2D *out, TPinHoleCamera camera);\r\n\tint backproject(HPoint3D *out, HPoint2D in, TPinHoleCamera camera);\r\n\tint displayline(HPoint2D p1, HPoint2D p2, HPoint2D *a, HPoint2D *b, TPinHoleCamera camera);\r\n\tvoid display_camerainfo(TPinHoleCamera camera);\r\n}\r\n#else\r\nTPinHoleCamera xmlReader(TPinHoleCamera* camera, const char *filename);\r\nvoid xmlWriter(TPinHoleCamera camera, const char *filename);\r\nvoid update_camera_matrix(TPinHoleCamera *camera);\r\nvoid reverse_update_camera_matrix(TPinHoleCamera *camera);\r\nvoid update_stereocamera_matrix(TPinHoleStereocamera *stereo);\r\nint project(HPoint3D in, HPoint2D *out, TPinHoleCamera camera);\r\nint backproject(HPoint3D *out, HPoint2D in, TPinHoleCamera camera);\r\nint displayline(HPoint2D p1, HPoint2D p2, HPoint2D *a, HPoint2D *b, TPinHoleCamera camera);\r\nvoid display_camerainfo(TPinHoleCamera camera);\r\n#endif\r\n```\r\n\r\nBut this change will fire a critical compile error:\r\n\r\n```\r\n[ 29%] Built target JderobotInterfaces\r\nScanning dependencies of target progeo\r\n[ 29%] Building C object src/stable/libs/progeo/CMakeFiles/progeo.dir/progeo.c.o\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c: In function ‘reverse_update_camera_matrix’:\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:536:2: error: incompatible type for argument 3 of ‘backproject’\r\n  backproject(&out, in, camera);\r\n  ^\r\nIn file included from /home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:23:0:\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.h:105:5: note: expected ‘TPinHoleCamera’ but argument is of type ‘struct TPinHoleCamera *’\r\n int backproject(HPoint3D *out, HPoint2D in, TPinHoleCamera camera);\r\n     ^\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:561:2: error: incompatible type for argument 3 of ‘backproject’\r\n  backproject(&p3, p2_rt_complete, camera);\r\n  ^\r\nIn file included from /home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.c:23:0:\r\n/home/redstar/Documentos/jderobot/temp/JdeRobot/src/stable/libs/progeo/progeo.h:105:5: note: expected ‘TPinHoleCamera’ but argument is of type ‘struct TPinHoleCamera *’\r\n int backproject(HPoint3D *out, HPoint2D in, TPinHoleCamera camera);\r\n     ^\r\nmake[2]: *** [src/stable/libs/progeo/CMakeFiles/progeo.dir/progeo.c.o] Error 1\r\nmake[1]: *** [src/stable/libs/progeo/CMakeFiles/progeo.dir/all] Error 2\r\nmake: *** [all] Error 2\r\n```\r\n\r\nSo we need to change proceo.c too:\r\n\r\n```\r\n@@ -533,7 +533,7 @@\r\n \tin.y = 0;\r\n \tin.h = 0;\r\n \r\n-\tbackproject(&out, in, camera);\r\n+\tbackproject(&out, in, *camera);\r\n \r\n \tcamera->foa.X = out.X;\r\n \tcamera->foa.Y = out.Y;\r\n@@ -558,7 +558,7 @@\r\n \tp2_rt_complete.y = 1;\r\n \tp2_rt_complete.h = 0;\r\n \r\n-\tbackproject(&p3, p2_rt_complete, camera);\r\n+\tbackproject(&p3, p2_rt_complete, *camera);\r\n \r\n \tTPinHoleCamera cameraAux; \r\n \tcameraAux = *camera;\r\n```\r\n\r\nBut I don't want to upload this fix because I don't use progeo.\r\n\r\nPlease, could someone that use progeo test my patch?\r\n\r\nThanks!"}}