{"action":"created","comment":{"url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments/57496377","id":57496377,"diff_hunk":"@@ -222,6 +221,24 @@ const OpenSim::PhysicalFrame& Joint::getParentFrame() const\n     return getConnector<PhysicalFrame>(\"parent_frame\").getConnectee();\n }\n \n+Coordinate::MotionType Joint::getMotionType(CoordinateIndex cix) const\n+{\n+    OPENSIM_THROW_IF(cix >= _motionTypes.size(), Exception,\n+        \"Joint::getMotionType() given an invalid CoordinateIndex\");\n+    return _motionTypes[cix];\n+}\n+\n+void Joint::setMotionType(CoordinateIndex cix, Coordinate::MotionType mt)\n+{\n+    OPENSIM_THROW_IF(cix >= numCoordinates(), Exception,\n+        \"Joint::setMotionType() for an invalid CoordinateIndex\");\n+    if (_motionTypes.size() <= cix)","path":"OpenSim/Simulation/SimbodyEngine/Joint.cpp","position":56,"original_position":56,"commit_id":"8206acab2ed2ba11a53652bd8b39985e77f3202c","original_commit_id":"8206acab2ed2ba11a53652bd8b39985e77f3202c","user":{"login":"tkuchida","id":4203505,"avatar_url":"https://avatars.githubusercontent.com/u/4203505?v=3","gravatar_id":"","url":"https://api.github.com/users/tkuchida","html_url":"https://github.com/tkuchida","followers_url":"https://api.github.com/users/tkuchida/followers","following_url":"https://api.github.com/users/tkuchida/following{/other_user}","gists_url":"https://api.github.com/users/tkuchida/gists{/gist_id}","starred_url":"https://api.github.com/users/tkuchida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkuchida/subscriptions","organizations_url":"https://api.github.com/users/tkuchida/orgs","repos_url":"https://api.github.com/users/tkuchida/repos","events_url":"https://api.github.com/users/tkuchida/events{/privacy}","received_events_url":"https://api.github.com/users/tkuchida/received_events","type":"User","site_admin":false},"body":":confused: Why isn't this `if (_motionTypes.size() != numCoordinates())`?","created_at":"2016-03-25T22:03:33Z","updated_at":"2016-03-25T22:03:33Z","html_url":"https://github.com/opensim-org/opensim-core/pull/894#discussion_r57496377","pull_request_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894","_links":{"self":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments/57496377"},"html":{"href":"https://github.com/opensim-org/opensim-core/pull/894#discussion_r57496377"},"pull_request":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894"}}},"pull_request":{"url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894","id":64188831,"html_url":"https://github.com/opensim-org/opensim-core/pull/894","diff_url":"https://github.com/opensim-org/opensim-core/pull/894.diff","patch_url":"https://github.com/opensim-org/opensim-core/pull/894.patch","issue_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/894","number":894,"state":"open","locked":false,"title":"Fix Cooordinate's motion type initialization that caused hackathon example bug","user":{"login":"aseth1","id":6494122,"avatar_url":"https://avatars.githubusercontent.com/u/6494122?v=3","gravatar_id":"","url":"https://api.github.com/users/aseth1","html_url":"https://github.com/aseth1","followers_url":"https://api.github.com/users/aseth1/followers","following_url":"https://api.github.com/users/aseth1/following{/other_user}","gists_url":"https://api.github.com/users/aseth1/gists{/gist_id}","starred_url":"https://api.github.com/users/aseth1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aseth1/subscriptions","organizations_url":"https://api.github.com/users/aseth1/orgs","repos_url":"https://api.github.com/users/aseth1/repos","events_url":"https://api.github.com/users/aseth1/events{/privacy}","received_events_url":"https://api.github.com/users/aseth1/received_events","type":"User","site_admin":false},"body":"which caused simulation in debug and release and different platforms to be different. In particular, the Joints was correctly setting the MotionType of its coordinates upon construction, BUT when deserializing we use the default (registered) Coordinate (clone) and fill in its property values (effectively wiping out the Joint constructed coordinates), in which case the Coordinate's _motionType was uninitialized, since only a Joint can specify the correct motion type.\r\n\r\n**Changes:**\r\n1. Specified `Coordinate::MotionType::Undefined(0)` to be the default constructed value (so it is never uninitialized). This caused both release and debug versions to be consist (but now wrong).\r\n2. For the `Coordinate::MotionType` after deserialization to be correct, it must get its value from its owning `Joint`. Thus, when the `Joint` constructs its coordinates (as member initializers, except for `CustomJoint` which must wait until `finalizeFromProperties`) it also keeps track of the `MotionType` for the same coordinate (by `CoordinateIndex`).\r\n3. `Cooridinate::getMotionType()` remains for convenience but it delegates to its owning `Joint`.\r\n4. Removed the `motion_type` property from `Coordinate`","created_at":"2016-03-25T17:59:22Z","updated_at":"2016-03-25T22:03:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d66b75a498e08fbfbb055d659be8e56d8bc39501","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894/commits","review_comments_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894/comments","review_comment_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/894/comments","statuses_url":"https://api.github.com/repos/opensim-org/opensim-core/statuses/8206acab2ed2ba11a53652bd8b39985e77f3202c","head":{"label":"opensim-org:fix-cooordinate-motion-type-bug-hackathon","ref":"fix-cooordinate-motion-type-bug-hackathon","sha":"8206acab2ed2ba11a53652bd8b39985e77f3202c","user":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars.githubusercontent.com/u/4370782?v=3","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"repo":{"id":20775600,"name":"opensim-core","full_name":"opensim-org/opensim-core","owner":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars.githubusercontent.com/u/4370782?v=3","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opensim-org/opensim-core","description":"SimTK OpenSim 4.0 C++ libraries and command-line applications, and Java/Python wrapping.","fork":false,"url":"https://api.github.com/repos/opensim-org/opensim-core","forks_url":"https://api.github.com/repos/opensim-org/opensim-core/forks","keys_url":"https://api.github.com/repos/opensim-org/opensim-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opensim-org/opensim-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opensim-org/opensim-core/teams","hooks_url":"https://api.github.com/repos/opensim-org/opensim-core/hooks","issue_events_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/events{/number}","events_url":"https://api.github.com/repos/opensim-org/opensim-core/events","assignees_url":"https://api.github.com/repos/opensim-org/opensim-core/assignees{/user}","branches_url":"https://api.github.com/repos/opensim-org/opensim-core/branches{/branch}","tags_url":"https://api.github.com/repos/opensim-org/opensim-core/tags","blobs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opensim-org/opensim-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/opensim-org/opensim-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opensim-org/opensim-core/statuses/{sha}","languages_url":"https://api.github.com/repos/opensim-org/opensim-core/languages","stargazers_url":"https://api.github.com/repos/opensim-org/opensim-core/stargazers","contributors_url":"https://api.github.com/repos/opensim-org/opensim-core/contributors","subscribers_url":"https://api.github.com/repos/opensim-org/opensim-core/subscribers","subscription_url":"https://api.github.com/repos/opensim-org/opensim-core/subscription","commits_url":"https://api.github.com/repos/opensim-org/opensim-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/opensim-org/opensim-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/opensim-org/opensim-core/contents/{+path}","compare_url":"https://api.github.com/repos/opensim-org/opensim-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opensim-org/opensim-core/merges","archive_url":"https://api.github.com/repos/opensim-org/opensim-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opensim-org/opensim-core/downloads","issues_url":"https://api.github.com/repos/opensim-org/opensim-core/issues{/number}","pulls_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls{/number}","milestones_url":"https://api.github.com/repos/opensim-org/opensim-core/milestones{/number}","notifications_url":"https://api.github.com/repos/opensim-org/opensim-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/labels{/name}","releases_url":"https://api.github.com/repos/opensim-org/opensim-core/releases{/id}","deployments_url":"https://api.github.com/repos/opensim-org/opensim-core/deployments","created_at":"2014-06-12T16:57:56Z","updated_at":"2016-03-24T10:20:00Z","pushed_at":"2016-03-25T21:47:06Z","git_url":"git://github.com/opensim-org/opensim-core.git","ssh_url":"git@github.com:opensim-org/opensim-core.git","clone_url":"https://github.com/opensim-org/opensim-core.git","svn_url":"https://github.com/opensim-org/opensim-core","homepage":"https://opensim.stanford.edu","size":130466,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":262,"forks":21,"open_issues":262,"watchers":29,"default_branch":"master"}},"base":{"label":"opensim-org:master","ref":"master","sha":"b3847c62e8d990c9da586d7005c70fa910530af6","user":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars.githubusercontent.com/u/4370782?v=3","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"repo":{"id":20775600,"name":"opensim-core","full_name":"opensim-org/opensim-core","owner":{"login":"opensim-org","id":4370782,"avatar_url":"https://avatars.githubusercontent.com/u/4370782?v=3","gravatar_id":"","url":"https://api.github.com/users/opensim-org","html_url":"https://github.com/opensim-org","followers_url":"https://api.github.com/users/opensim-org/followers","following_url":"https://api.github.com/users/opensim-org/following{/other_user}","gists_url":"https://api.github.com/users/opensim-org/gists{/gist_id}","starred_url":"https://api.github.com/users/opensim-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opensim-org/subscriptions","organizations_url":"https://api.github.com/users/opensim-org/orgs","repos_url":"https://api.github.com/users/opensim-org/repos","events_url":"https://api.github.com/users/opensim-org/events{/privacy}","received_events_url":"https://api.github.com/users/opensim-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opensim-org/opensim-core","description":"SimTK OpenSim 4.0 C++ libraries and command-line applications, and Java/Python wrapping.","fork":false,"url":"https://api.github.com/repos/opensim-org/opensim-core","forks_url":"https://api.github.com/repos/opensim-org/opensim-core/forks","keys_url":"https://api.github.com/repos/opensim-org/opensim-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opensim-org/opensim-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opensim-org/opensim-core/teams","hooks_url":"https://api.github.com/repos/opensim-org/opensim-core/hooks","issue_events_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/events{/number}","events_url":"https://api.github.com/repos/opensim-org/opensim-core/events","assignees_url":"https://api.github.com/repos/opensim-org/opensim-core/assignees{/user}","branches_url":"https://api.github.com/repos/opensim-org/opensim-core/branches{/branch}","tags_url":"https://api.github.com/repos/opensim-org/opensim-core/tags","blobs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opensim-org/opensim-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opensim-org/opensim-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/opensim-org/opensim-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opensim-org/opensim-core/statuses/{sha}","languages_url":"https://api.github.com/repos/opensim-org/opensim-core/languages","stargazers_url":"https://api.github.com/repos/opensim-org/opensim-core/stargazers","contributors_url":"https://api.github.com/repos/opensim-org/opensim-core/contributors","subscribers_url":"https://api.github.com/repos/opensim-org/opensim-core/subscribers","subscription_url":"https://api.github.com/repos/opensim-org/opensim-core/subscription","commits_url":"https://api.github.com/repos/opensim-org/opensim-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/opensim-org/opensim-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/opensim-org/opensim-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/opensim-org/opensim-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/opensim-org/opensim-core/contents/{+path}","compare_url":"https://api.github.com/repos/opensim-org/opensim-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opensim-org/opensim-core/merges","archive_url":"https://api.github.com/repos/opensim-org/opensim-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opensim-org/opensim-core/downloads","issues_url":"https://api.github.com/repos/opensim-org/opensim-core/issues{/number}","pulls_url":"https://api.github.com/repos/opensim-org/opensim-core/pulls{/number}","milestones_url":"https://api.github.com/repos/opensim-org/opensim-core/milestones{/number}","notifications_url":"https://api.github.com/repos/opensim-org/opensim-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opensim-org/opensim-core/labels{/name}","releases_url":"https://api.github.com/repos/opensim-org/opensim-core/releases{/id}","deployments_url":"https://api.github.com/repos/opensim-org/opensim-core/deployments","created_at":"2014-06-12T16:57:56Z","updated_at":"2016-03-24T10:20:00Z","pushed_at":"2016-03-25T21:47:06Z","git_url":"git://github.com/opensim-org/opensim-core.git","ssh_url":"git@github.com:opensim-org/opensim-core.git","clone_url":"https://github.com/opensim-org/opensim-core.git","svn_url":"https://github.com/opensim-org/opensim-core","homepage":"https://opensim.stanford.edu","size":130466,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":262,"forks":21,"open_issues":262,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894"},"html":{"href":"https://github.com/opensim-org/opensim-core/pull/894"},"issue":{"href":"https://api.github.com/repos/opensim-org/opensim-core/issues/894"},"comments":{"href":"https://api.github.com/repos/opensim-org/opensim-core/issues/894/comments"},"review_comments":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894/comments"},"review_comment":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opensim-org/opensim-core/pulls/894/commits"},"statuses":{"href":"https://api.github.com/repos/opensim-org/opensim-core/statuses/8206acab2ed2ba11a53652bd8b39985e77f3202c"}}}}