{"action":"created","comment":{"url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/comments/72555396","id":72555396,"diff_hunk":"@@ -0,0 +1,47 @@\n+#include \"create/types.h\"\n+\n+namespace create {\n+  RobotModel::RobotModel(const std::string& name) {","path":"src/types.cpp","position":4,"original_position":4,"commit_id":"0b834678e83e2621753adad67f7ecdd37cb2f659","original_commit_id":"0b834678e83e2621753adad67f7ecdd37cb2f659","user":{"login":"lopsided98","id":5624721,"avatar_url":"https://avatars.githubusercontent.com/u/5624721?v=3","gravatar_id":"","url":"https://api.github.com/users/lopsided98","html_url":"https://github.com/lopsided98","followers_url":"https://api.github.com/users/lopsided98/followers","following_url":"https://api.github.com/users/lopsided98/following{/other_user}","gists_url":"https://api.github.com/users/lopsided98/gists{/gist_id}","starred_url":"https://api.github.com/users/lopsided98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lopsided98/subscriptions","organizations_url":"https://api.github.com/users/lopsided98/orgs","repos_url":"https://api.github.com/users/lopsided98/repos","events_url":"https://api.github.com/users/lopsided98/events{/privacy}","received_events_url":"https://api.github.com/users/lopsided98/received_events","type":"User","site_admin":false},"body":"Maybe I am misunderstanding you, but I'm not sure how this would work. This constructor is used to convert a string into a `RobotModel`, which is used to implement the parsing of the robot_model parameter in create_autonomy.\r\n\r\nI was basically trying to implement similar behavior to the Java [`Enum.valueOf()`] (https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-) method, and while I could do this with a lookup table, it seems overkill for this situation.","created_at":"2016-07-28T02:06:40Z","updated_at":"2016-07-28T02:06:40Z","html_url":"https://github.com/AutonomyLab/libcreate/pull/25#discussion_r72555396","pull_request_url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/comments/72555396"},"html":{"href":"https://github.com/AutonomyLab/libcreate/pull/25#discussion_r72555396"},"pull_request":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25","id":77495671,"html_url":"https://github.com/AutonomyLab/libcreate/pull/25","diff_url":"https://github.com/AutonomyLab/libcreate/pull/25.diff","patch_url":"https://github.com/AutonomyLab/libcreate/pull/25.patch","issue_url":"https://api.github.com/repos/AutonomyLab/libcreate/issues/25","number":25,"state":"open","locked":false,"title":"Add support for the original SCI protocol","user":{"login":"lopsided98","id":5624721,"avatar_url":"https://avatars.githubusercontent.com/u/5624721?v=3","gravatar_id":"","url":"https://api.github.com/users/lopsided98","html_url":"https://github.com/lopsided98","followers_url":"https://api.github.com/users/lopsided98/followers","following_url":"https://api.github.com/users/lopsided98/following{/other_user}","gists_url":"https://api.github.com/users/lopsided98/gists{/gist_id}","starred_url":"https://api.github.com/users/lopsided98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lopsided98/subscriptions","organizations_url":"https://api.github.com/users/lopsided98/orgs","repos_url":"https://api.github.com/users/lopsided98/repos","events_url":"https://api.github.com/users/lopsided98/events{/privacy}","received_events_url":"https://api.github.com/users/lopsided98/received_events","type":"User","site_admin":false},"body":"This PR adds support for the original SCI protocol used by the Discovery and 400 series (though apparently not all of them) Roombas.\r\n\r\nSince three robots are now supported, the existing system of specifying which model to use did not work that well. Therefore, I decided to create a new `RobotModel` class, which encapsulates the the wheelbase width, baud rate, and protocol version, as well as any other parameters that might differ between models.\r\n\r\nI added a new `ProtocolVersion` enum which largely replaces the old `RobotModel` enum in the various conditionals that decide how to communicate with the robot. The three protocol versions are based on the three documents that describe them:\r\n- `V_1` - http://www.ecsl.cs.sunysb.edu/mint/Roomba_SCI_Spec_Manual.pdf\r\n- `V_2` - http://www.irobot.com/filelibrary/pdfs/hrd/create/Create%20Open%20Interface_v2.pdf\r\n- `V_3` - https://cdn-shop.adafruit.com/datasheets/create_2_Open_Interface_Spec.pdf\r\n\r\nLike we talked about, I split the `Serial` class into `SerialStream` and a new `SerialQuery` class which uses the Sensors command to retrieve data.\r\n\r\nSince `V_1` does not include the \"drive direct\" command, and this is a very important command for create_autonomy, I decided to emulate it using the \"drive\" command.\r\n\r\nI also had to emulate the mode retrieval and requested wheel velocities because they are not supported in `V_1`. I decided to not request the requested velocity sensor packets (even when they are supported) since the exact same functionality can be gained by just caching the last requested velocities in `driveWheels()`.\r\n\r\nI found that the odometry on my Roomba 400 is much better than on my Create because the angle field is implemented as \"the right wheel distance minus the left wheel\r\ndistance, divided by two\" and it does not have the same bug as the angle field on the Create 1.\r\n\r\nI tested this on my Roomba and my Create, but there is a possibility that I broke the odometry on the Create 2, so I would recommend testing it.\r\n\r\nLet me know what you think. I will have a PR for create_autonomy soon that supports these changes.","created_at":"2016-07-14T17:41:21Z","updated_at":"2016-07-28T02:06:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be9e55aa915dc574687fcfd21e4cd4712b399508","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25/commits","review_comments_url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25/comments","review_comment_url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AutonomyLab/libcreate/issues/25/comments","statuses_url":"https://api.github.com/repos/AutonomyLab/libcreate/statuses/0b834678e83e2621753adad67f7ecdd37cb2f659","head":{"label":"lopsided98:roomba-400","ref":"roomba-400","sha":"0b834678e83e2621753adad67f7ecdd37cb2f659","user":{"login":"lopsided98","id":5624721,"avatar_url":"https://avatars.githubusercontent.com/u/5624721?v=3","gravatar_id":"","url":"https://api.github.com/users/lopsided98","html_url":"https://github.com/lopsided98","followers_url":"https://api.github.com/users/lopsided98/followers","following_url":"https://api.github.com/users/lopsided98/following{/other_user}","gists_url":"https://api.github.com/users/lopsided98/gists{/gist_id}","starred_url":"https://api.github.com/users/lopsided98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lopsided98/subscriptions","organizations_url":"https://api.github.com/users/lopsided98/orgs","repos_url":"https://api.github.com/users/lopsided98/repos","events_url":"https://api.github.com/users/lopsided98/events{/privacy}","received_events_url":"https://api.github.com/users/lopsided98/received_events","type":"User","site_admin":false},"repo":{"id":61762263,"name":"libcreate","full_name":"lopsided98/libcreate","owner":{"login":"lopsided98","id":5624721,"avatar_url":"https://avatars.githubusercontent.com/u/5624721?v=3","gravatar_id":"","url":"https://api.github.com/users/lopsided98","html_url":"https://github.com/lopsided98","followers_url":"https://api.github.com/users/lopsided98/followers","following_url":"https://api.github.com/users/lopsided98/following{/other_user}","gists_url":"https://api.github.com/users/lopsided98/gists{/gist_id}","starred_url":"https://api.github.com/users/lopsided98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lopsided98/subscriptions","organizations_url":"https://api.github.com/users/lopsided98/orgs","repos_url":"https://api.github.com/users/lopsided98/repos","events_url":"https://api.github.com/users/lopsided98/events{/privacy}","received_events_url":"https://api.github.com/users/lopsided98/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lopsided98/libcreate","description":"C++ library for interfacing with the iRobot Create 1 and 2.","fork":true,"url":"https://api.github.com/repos/lopsided98/libcreate","forks_url":"https://api.github.com/repos/lopsided98/libcreate/forks","keys_url":"https://api.github.com/repos/lopsided98/libcreate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lopsided98/libcreate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lopsided98/libcreate/teams","hooks_url":"https://api.github.com/repos/lopsided98/libcreate/hooks","issue_events_url":"https://api.github.com/repos/lopsided98/libcreate/issues/events{/number}","events_url":"https://api.github.com/repos/lopsided98/libcreate/events","assignees_url":"https://api.github.com/repos/lopsided98/libcreate/assignees{/user}","branches_url":"https://api.github.com/repos/lopsided98/libcreate/branches{/branch}","tags_url":"https://api.github.com/repos/lopsided98/libcreate/tags","blobs_url":"https://api.github.com/repos/lopsided98/libcreate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lopsided98/libcreate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lopsided98/libcreate/git/refs{/sha}","trees_url":"https://api.github.com/repos/lopsided98/libcreate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lopsided98/libcreate/statuses/{sha}","languages_url":"https://api.github.com/repos/lopsided98/libcreate/languages","stargazers_url":"https://api.github.com/repos/lopsided98/libcreate/stargazers","contributors_url":"https://api.github.com/repos/lopsided98/libcreate/contributors","subscribers_url":"https://api.github.com/repos/lopsided98/libcreate/subscribers","subscription_url":"https://api.github.com/repos/lopsided98/libcreate/subscription","commits_url":"https://api.github.com/repos/lopsided98/libcreate/commits{/sha}","git_commits_url":"https://api.github.com/repos/lopsided98/libcreate/git/commits{/sha}","comments_url":"https://api.github.com/repos/lopsided98/libcreate/comments{/number}","issue_comment_url":"https://api.github.com/repos/lopsided98/libcreate/issues/comments{/number}","contents_url":"https://api.github.com/repos/lopsided98/libcreate/contents/{+path}","compare_url":"https://api.github.com/repos/lopsided98/libcreate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lopsided98/libcreate/merges","archive_url":"https://api.github.com/repos/lopsided98/libcreate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lopsided98/libcreate/downloads","issues_url":"https://api.github.com/repos/lopsided98/libcreate/issues{/number}","pulls_url":"https://api.github.com/repos/lopsided98/libcreate/pulls{/number}","milestones_url":"https://api.github.com/repos/lopsided98/libcreate/milestones{/number}","notifications_url":"https://api.github.com/repos/lopsided98/libcreate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lopsided98/libcreate/labels{/name}","releases_url":"https://api.github.com/repos/lopsided98/libcreate/releases{/id}","deployments_url":"https://api.github.com/repos/lopsided98/libcreate/deployments","created_at":"2016-06-23T01:09:53Z","updated_at":"2016-06-23T01:09:53Z","pushed_at":"2016-07-14T19:42:34Z","git_url":"git://github.com/lopsided98/libcreate.git","ssh_url":"git@github.com:lopsided98/libcreate.git","clone_url":"https://github.com/lopsided98/libcreate.git","svn_url":"https://github.com/lopsided98/libcreate","homepage":"","size":75,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AutonomyLab:master","ref":"master","sha":"000dc9cf29482edbf90d1669084cc503bab72099","user":{"login":"AutonomyLab","id":319922,"avatar_url":"https://avatars.githubusercontent.com/u/319922?v=3","gravatar_id":"","url":"https://api.github.com/users/AutonomyLab","html_url":"https://github.com/AutonomyLab","followers_url":"https://api.github.com/users/AutonomyLab/followers","following_url":"https://api.github.com/users/AutonomyLab/following{/other_user}","gists_url":"https://api.github.com/users/AutonomyLab/gists{/gist_id}","starred_url":"https://api.github.com/users/AutonomyLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutonomyLab/subscriptions","organizations_url":"https://api.github.com/users/AutonomyLab/orgs","repos_url":"https://api.github.com/users/AutonomyLab/repos","events_url":"https://api.github.com/users/AutonomyLab/events{/privacy}","received_events_url":"https://api.github.com/users/AutonomyLab/received_events","type":"Organization","site_admin":false},"repo":{"id":47853409,"name":"libcreate","full_name":"AutonomyLab/libcreate","owner":{"login":"AutonomyLab","id":319922,"avatar_url":"https://avatars.githubusercontent.com/u/319922?v=3","gravatar_id":"","url":"https://api.github.com/users/AutonomyLab","html_url":"https://github.com/AutonomyLab","followers_url":"https://api.github.com/users/AutonomyLab/followers","following_url":"https://api.github.com/users/AutonomyLab/following{/other_user}","gists_url":"https://api.github.com/users/AutonomyLab/gists{/gist_id}","starred_url":"https://api.github.com/users/AutonomyLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutonomyLab/subscriptions","organizations_url":"https://api.github.com/users/AutonomyLab/orgs","repos_url":"https://api.github.com/users/AutonomyLab/repos","events_url":"https://api.github.com/users/AutonomyLab/events{/privacy}","received_events_url":"https://api.github.com/users/AutonomyLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AutonomyLab/libcreate","description":"C++ library for interfacing with the iRobot Create 1 and 2.","fork":false,"url":"https://api.github.com/repos/AutonomyLab/libcreate","forks_url":"https://api.github.com/repos/AutonomyLab/libcreate/forks","keys_url":"https://api.github.com/repos/AutonomyLab/libcreate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AutonomyLab/libcreate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AutonomyLab/libcreate/teams","hooks_url":"https://api.github.com/repos/AutonomyLab/libcreate/hooks","issue_events_url":"https://api.github.com/repos/AutonomyLab/libcreate/issues/events{/number}","events_url":"https://api.github.com/repos/AutonomyLab/libcreate/events","assignees_url":"https://api.github.com/repos/AutonomyLab/libcreate/assignees{/user}","branches_url":"https://api.github.com/repos/AutonomyLab/libcreate/branches{/branch}","tags_url":"https://api.github.com/repos/AutonomyLab/libcreate/tags","blobs_url":"https://api.github.com/repos/AutonomyLab/libcreate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AutonomyLab/libcreate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AutonomyLab/libcreate/git/refs{/sha}","trees_url":"https://api.github.com/repos/AutonomyLab/libcreate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AutonomyLab/libcreate/statuses/{sha}","languages_url":"https://api.github.com/repos/AutonomyLab/libcreate/languages","stargazers_url":"https://api.github.com/repos/AutonomyLab/libcreate/stargazers","contributors_url":"https://api.github.com/repos/AutonomyLab/libcreate/contributors","subscribers_url":"https://api.github.com/repos/AutonomyLab/libcreate/subscribers","subscription_url":"https://api.github.com/repos/AutonomyLab/libcreate/subscription","commits_url":"https://api.github.com/repos/AutonomyLab/libcreate/commits{/sha}","git_commits_url":"https://api.github.com/repos/AutonomyLab/libcreate/git/commits{/sha}","comments_url":"https://api.github.com/repos/AutonomyLab/libcreate/comments{/number}","issue_comment_url":"https://api.github.com/repos/AutonomyLab/libcreate/issues/comments{/number}","contents_url":"https://api.github.com/repos/AutonomyLab/libcreate/contents/{+path}","compare_url":"https://api.github.com/repos/AutonomyLab/libcreate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AutonomyLab/libcreate/merges","archive_url":"https://api.github.com/repos/AutonomyLab/libcreate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AutonomyLab/libcreate/downloads","issues_url":"https://api.github.com/repos/AutonomyLab/libcreate/issues{/number}","pulls_url":"https://api.github.com/repos/AutonomyLab/libcreate/pulls{/number}","milestones_url":"https://api.github.com/repos/AutonomyLab/libcreate/milestones{/number}","notifications_url":"https://api.github.com/repos/AutonomyLab/libcreate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AutonomyLab/libcreate/labels{/name}","releases_url":"https://api.github.com/repos/AutonomyLab/libcreate/releases{/id}","deployments_url":"https://api.github.com/repos/AutonomyLab/libcreate/deployments","created_at":"2015-12-11T22:07:29Z","updated_at":"2016-07-15T05:19:15Z","pushed_at":"2016-07-27T21:57:35Z","git_url":"git://github.com/AutonomyLab/libcreate.git","ssh_url":"git@github.com:AutonomyLab/libcreate.git","clone_url":"https://github.com/AutonomyLab/libcreate.git","svn_url":"https://github.com/AutonomyLab/libcreate","homepage":"","size":75,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":9,"forks":2,"open_issues":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25"},"html":{"href":"https://github.com/AutonomyLab/libcreate/pull/25"},"issue":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/issues/25"},"comments":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/AutonomyLab/libcreate/statuses/0b834678e83e2621753adad67f7ecdd37cb2f659"}}}}
{"actor":{"display_login":"lopsided98"}}