{"action":"created","issue":{"url":"https://api.github.com/repos/mavlink/mavros/issues/625","repository_url":"https://api.github.com/repos/mavlink/mavros","labels_url":"https://api.github.com/repos/mavlink/mavros/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/mavlink/mavros/issues/625/comments","events_url":"https://api.github.com/repos/mavlink/mavros/issues/625/events","html_url":"https://github.com/mavlink/mavros/issues/625","id":187884914,"number":625,"title":"set_mode service always returns true","user":{"login":"tfoote","id":447804,"avatar_url":"https://avatars.githubusercontent.com/u/447804?v=3","gravatar_id":"","url":"https://api.github.com/users/tfoote","html_url":"https://github.com/tfoote","followers_url":"https://api.github.com/users/tfoote/followers","following_url":"https://api.github.com/users/tfoote/following{/other_user}","gists_url":"https://api.github.com/users/tfoote/gists{/gist_id}","starred_url":"https://api.github.com/users/tfoote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfoote/subscriptions","organizations_url":"https://api.github.com/users/tfoote/orgs","repos_url":"https://api.github.com/users/tfoote/repos","events_url":"https://api.github.com/users/tfoote/events{/privacy}","received_events_url":"https://api.github.com/users/tfoote/received_events","type":"User","site_admin":false},"labels":[{"id":70643008,"url":"https://api.github.com/repos/mavlink/mavros/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":120336307,"url":"https://api.github.com/repos/mavlink/mavros/labels/feature%20request","name":"feature request","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-08T02:22:53Z","updated_at":"2016-11-08T06:36:09Z","closed_at":null,"body":"I was just debugging a script for controlling a vehicle and was having trouble with sequencing. And I found that the set_mode service [always returns true](https://github.com/mavlink/mavros/blob/cafb05e79697fc8f1cb889ffac9e5b9d68183460/mavros/src/plugins/sys_status.cpp#L951) whether or not the state transtion was accepted. \r\n\r\nIt might fail if the state is invalid but doesn't fail otherwise."},"comment":{"url":"https://api.github.com/repos/mavlink/mavros/issues/comments/259057790","html_url":"https://github.com/mavlink/mavros/issues/625#issuecomment-259057790","issue_url":"https://api.github.com/repos/mavlink/mavros/issues/625","id":259057790,"user":{"login":"vooon","id":1023568,"avatar_url":"https://avatars.githubusercontent.com/u/1023568?v=3","gravatar_id":"","url":"https://api.github.com/users/vooon","html_url":"https://github.com/vooon","followers_url":"https://api.github.com/users/vooon/followers","following_url":"https://api.github.com/users/vooon/following{/other_user}","gists_url":"https://api.github.com/users/vooon/gists{/gist_id}","starred_url":"https://api.github.com/users/vooon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vooon/subscriptions","organizations_url":"https://api.github.com/users/vooon/orgs","repos_url":"https://api.github.com/users/vooon/repos","events_url":"https://api.github.com/users/vooon/events{/privacy}","received_events_url":"https://api.github.com/users/vooon/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T06:36:09Z","updated_at":"2016-11-08T06:36:09Z","body":"Yes, for some reasons `success` only show mode parsing status ([it may be one from list][1], or numeric).\r\nUnfortunately there are no reliable method to wait AP response. AP may switch to other mode, may switch with some pause, may switch on RC change, so i decided to leave mode change control to user.\r\nExample: OFFBOARD may not enable after SET_MODE if there are no setpoint (target), and switch after you stream targets.\r\n\r\nSo you should implement mode monitoring in your node:\r\na. Subscribe to `~state` and check mode, usually it update rate is 1 Hz (HEARTBEAT), possible values:\r\n    - one of cmap_mode entries (APM, PX4)\r\n    - `MODE(0x00)` if AP only support base_mode\r\n    - `CMODE(123)` if AP support custom_mode, but mode is unknown\r\n\r\nb. Call `~set_mode` and wait mode change.\r\n\r\nPerhaps i should add note to wiki.\r\n\r\n[1]: https://github.com/mavlink/mavros/blob/cafb05e79697fc8f1cb889ffac9e5b9d68183460/mavros/src/lib/uas_stringify.cpp#L32 "}}
{"actor":{"display_login":"vooon"}}