{"action":"created","comment":{"url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/comments/28140621","id":28140621,"diff_hunk":"@@ -0,0 +1,116 @@\n+#include \"PiecewisePolynomial.h\"\n+#include <stdexcept>\n+#include <cassert>\n+#include <algorithm>\n+\n+using namespace std;\n+\n+PiecewisePolynomial::PiecewisePolynomial(std::vector<Polynomial> const& polynomials, std::vector<double> const& segment_times) :","path":"solvers/qpSpline/PiecewisePolynomial.cpp","position":8,"original_position":8,"commit_id":"7c852c7de6dbaa13a92de2d315059548a62b6549","original_commit_id":"7c852c7de6dbaa13a92de2d315059548a62b6549","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars.githubusercontent.com/u/2585880?v=3","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"body":"What does this mean concretely right now, do I have to rename or add anything? There are a lot missing methods compared to PPTrajectory of course. I can fill those in over time.\r\n\r\nYeah, systems/trajectories is a better place and it won't mess with Robin's stuff so I'll move it.","created_at":"2015-04-10T12:34:43Z","updated_at":"2015-04-10T12:34:43Z","html_url":"https://github.com/RobotLocomotion/drake/pull/972#discussion_r28140621","pull_request_url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972","_links":{"self":{"href":"https://api.github.com/repos/RobotLocomotion/drake/pulls/comments/28140621"},"html":{"href":"https://github.com/RobotLocomotion/drake/pull/972#discussion_r28140621"},"pull_request":{"href":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972"}}},"pull_request":{"url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972","id":33018185,"html_url":"https://github.com/RobotLocomotion/drake/pull/972","diff_url":"https://github.com/RobotLocomotion/drake/pull/972.diff","patch_url":"https://github.com/RobotLocomotion/drake/pull/972.patch","issue_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/972","number":972,"state":"open","locked":false,"title":"Spline generation","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars.githubusercontent.com/u/2585880?v=3","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"body":"A bunch of new code for basic but fairly flexible spline generation, mostly in C++. Based on @rdeits' foot trajectory spline work in Matlab and CVXGen and required to run the latest, smoother foot trajectories on the robot at a fast enough rate.\r\n\r\nI wrote simple (univariate) `Polynomial` and `PiecewisePolynomial` classes and a `generateSpline` method you can use to create a spline with any number of segments, where the segment polynomials can have any (and varying) order. \r\n\r\n`generateSpline` computes spline coefficients based on a set of constraints you give it, stored in a `SplineInformation` object. Currently I've implemented `ValueConstraint` (constraint on function value or value of one of its derivatives at a certain time) and `ContinuityConstraint` (continuity of function or one of its derivatives between spline segments). The `generateSpline` method currently only handles the case where there is a single solution (it does a simple linear solve). If necessary at a later time, it should be easy to implement kicking out to a QP solver if the problem is underconstrained and there's some quadratic objective function.\r\n\r\nFor the `Polynomial` and `PiecewisePolynomial` classes, I've implemented evaluation at a value, addition, multiplication, integration, and differentiation.\r\n\r\nI created two mex functions that call the `generateSpline` function: `twoWaypointCubicSplinemex` and `twoWaypointCubicSplineFreeKnotTimesmex`. The former computes a C^2 continuous three-segment cubic spline given initial and final position and velocity and two waypoints, and returns a coefficient array in Matlab's format. The latter does the same as the former, but tries to minimize the integral of squared acceleration over the length of the spline by doing a simple grid search over knot point times.\r\n\r\nBasic C++ tests for `Polynomial`, `PiecewisePolynomial`, and `generateSpline` are implemented, as well as a Matlab test that compares Robin's implementation of the cubic spline with two waypoints to the mex implementation, and checks that the objective value is correct.\r\n\r\nI'm not 100% happy with the current location of the files (util and solvers/qpSpline), but I believe this makes it a little easier for Robin to merge his next pull request. Please let me know what you think is the right place for this stuff.","created_at":"2015-04-10T04:54:06Z","updated_at":"2015-04-10T12:34:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dafa78134bb64a7ee66ee99626d4a6c683f389b4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972/commits","review_comments_url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972/comments","review_comment_url":"https://api.github.com/repos/RobotLocomotion/drake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/972/comments","statuses_url":"https://api.github.com/repos/RobotLocomotion/drake/statuses/7c852c7de6dbaa13a92de2d315059548a62b6549","head":{"label":"tkoolen:spline-generation","ref":"spline-generation","sha":"7c852c7de6dbaa13a92de2d315059548a62b6549","user":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars.githubusercontent.com/u/2585880?v=3","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"repo":{"id":18049528,"name":"drake","full_name":"tkoolen/drake","owner":{"login":"tkoolen","id":2585880,"avatar_url":"https://avatars.githubusercontent.com/u/2585880?v=3","gravatar_id":"","url":"https://api.github.com/users/tkoolen","html_url":"https://github.com/tkoolen","followers_url":"https://api.github.com/users/tkoolen/followers","following_url":"https://api.github.com/users/tkoolen/following{/other_user}","gists_url":"https://api.github.com/users/tkoolen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkoolen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkoolen/subscriptions","organizations_url":"https://api.github.com/users/tkoolen/orgs","repos_url":"https://api.github.com/users/tkoolen/repos","events_url":"https://api.github.com/users/tkoolen/events{/privacy}","received_events_url":"https://api.github.com/users/tkoolen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tkoolen/drake","description":"A planning, control, and analysis toolbox for nonlinear dynamical systems.  Please see the WIKI for documentation.","fork":true,"url":"https://api.github.com/repos/tkoolen/drake","forks_url":"https://api.github.com/repos/tkoolen/drake/forks","keys_url":"https://api.github.com/repos/tkoolen/drake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tkoolen/drake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tkoolen/drake/teams","hooks_url":"https://api.github.com/repos/tkoolen/drake/hooks","issue_events_url":"https://api.github.com/repos/tkoolen/drake/issues/events{/number}","events_url":"https://api.github.com/repos/tkoolen/drake/events","assignees_url":"https://api.github.com/repos/tkoolen/drake/assignees{/user}","branches_url":"https://api.github.com/repos/tkoolen/drake/branches{/branch}","tags_url":"https://api.github.com/repos/tkoolen/drake/tags","blobs_url":"https://api.github.com/repos/tkoolen/drake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tkoolen/drake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tkoolen/drake/git/refs{/sha}","trees_url":"https://api.github.com/repos/tkoolen/drake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tkoolen/drake/statuses/{sha}","languages_url":"https://api.github.com/repos/tkoolen/drake/languages","stargazers_url":"https://api.github.com/repos/tkoolen/drake/stargazers","contributors_url":"https://api.github.com/repos/tkoolen/drake/contributors","subscribers_url":"https://api.github.com/repos/tkoolen/drake/subscribers","subscription_url":"https://api.github.com/repos/tkoolen/drake/subscription","commits_url":"https://api.github.com/repos/tkoolen/drake/commits{/sha}","git_commits_url":"https://api.github.com/repos/tkoolen/drake/git/commits{/sha}","comments_url":"https://api.github.com/repos/tkoolen/drake/comments{/number}","issue_comment_url":"https://api.github.com/repos/tkoolen/drake/issues/comments{/number}","contents_url":"https://api.github.com/repos/tkoolen/drake/contents/{+path}","compare_url":"https://api.github.com/repos/tkoolen/drake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tkoolen/drake/merges","archive_url":"https://api.github.com/repos/tkoolen/drake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tkoolen/drake/downloads","issues_url":"https://api.github.com/repos/tkoolen/drake/issues{/number}","pulls_url":"https://api.github.com/repos/tkoolen/drake/pulls{/number}","milestones_url":"https://api.github.com/repos/tkoolen/drake/milestones{/number}","notifications_url":"https://api.github.com/repos/tkoolen/drake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tkoolen/drake/labels{/name}","releases_url":"https://api.github.com/repos/tkoolen/drake/releases{/id}","created_at":"2014-03-24T02:31:26Z","updated_at":"2014-07-07T14:33:06Z","pushed_at":"2015-04-10T04:51:18Z","git_url":"git://github.com/tkoolen/drake.git","ssh_url":"git@github.com:tkoolen/drake.git","clone_url":"https://github.com/tkoolen/drake.git","svn_url":"https://github.com/tkoolen/drake","homepage":"https://github.com/RobotLocomotion/drake/wiki","size":159059,"stargazers_count":0,"watchers_count":0,"language":"Matlab","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"RobotLocomotion:master","ref":"master","sha":"a694801343d0b800b1516eba0471f2af5b48dfdd","user":{"login":"RobotLocomotion","id":6496345,"avatar_url":"https://avatars.githubusercontent.com/u/6496345?v=3","gravatar_id":"","url":"https://api.github.com/users/RobotLocomotion","html_url":"https://github.com/RobotLocomotion","followers_url":"https://api.github.com/users/RobotLocomotion/followers","following_url":"https://api.github.com/users/RobotLocomotion/following{/other_user}","gists_url":"https://api.github.com/users/RobotLocomotion/gists{/gist_id}","starred_url":"https://api.github.com/users/RobotLocomotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobotLocomotion/subscriptions","organizations_url":"https://api.github.com/users/RobotLocomotion/orgs","repos_url":"https://api.github.com/users/RobotLocomotion/repos","events_url":"https://api.github.com/users/RobotLocomotion/events{/privacy}","received_events_url":"https://api.github.com/users/RobotLocomotion/received_events","type":"Organization","site_admin":false},"repo":{"id":16256144,"name":"drake","full_name":"RobotLocomotion/drake","owner":{"login":"RobotLocomotion","id":6496345,"avatar_url":"https://avatars.githubusercontent.com/u/6496345?v=3","gravatar_id":"","url":"https://api.github.com/users/RobotLocomotion","html_url":"https://github.com/RobotLocomotion","followers_url":"https://api.github.com/users/RobotLocomotion/followers","following_url":"https://api.github.com/users/RobotLocomotion/following{/other_user}","gists_url":"https://api.github.com/users/RobotLocomotion/gists{/gist_id}","starred_url":"https://api.github.com/users/RobotLocomotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobotLocomotion/subscriptions","organizations_url":"https://api.github.com/users/RobotLocomotion/orgs","repos_url":"https://api.github.com/users/RobotLocomotion/repos","events_url":"https://api.github.com/users/RobotLocomotion/events{/privacy}","received_events_url":"https://api.github.com/users/RobotLocomotion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RobotLocomotion/drake","description":"A planning, control, and analysis toolbox for nonlinear dynamical systems.  Please see the WIKI for documentation.","fork":false,"url":"https://api.github.com/repos/RobotLocomotion/drake","forks_url":"https://api.github.com/repos/RobotLocomotion/drake/forks","keys_url":"https://api.github.com/repos/RobotLocomotion/drake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RobotLocomotion/drake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RobotLocomotion/drake/teams","hooks_url":"https://api.github.com/repos/RobotLocomotion/drake/hooks","issue_events_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/events{/number}","events_url":"https://api.github.com/repos/RobotLocomotion/drake/events","assignees_url":"https://api.github.com/repos/RobotLocomotion/drake/assignees{/user}","branches_url":"https://api.github.com/repos/RobotLocomotion/drake/branches{/branch}","tags_url":"https://api.github.com/repos/RobotLocomotion/drake/tags","blobs_url":"https://api.github.com/repos/RobotLocomotion/drake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RobotLocomotion/drake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RobotLocomotion/drake/git/refs{/sha}","trees_url":"https://api.github.com/repos/RobotLocomotion/drake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RobotLocomotion/drake/statuses/{sha}","languages_url":"https://api.github.com/repos/RobotLocomotion/drake/languages","stargazers_url":"https://api.github.com/repos/RobotLocomotion/drake/stargazers","contributors_url":"https://api.github.com/repos/RobotLocomotion/drake/contributors","subscribers_url":"https://api.github.com/repos/RobotLocomotion/drake/subscribers","subscription_url":"https://api.github.com/repos/RobotLocomotion/drake/subscription","commits_url":"https://api.github.com/repos/RobotLocomotion/drake/commits{/sha}","git_commits_url":"https://api.github.com/repos/RobotLocomotion/drake/git/commits{/sha}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/comments{/number}","issue_comment_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/comments{/number}","contents_url":"https://api.github.com/repos/RobotLocomotion/drake/contents/{+path}","compare_url":"https://api.github.com/repos/RobotLocomotion/drake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RobotLocomotion/drake/merges","archive_url":"https://api.github.com/repos/RobotLocomotion/drake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RobotLocomotion/drake/downloads","issues_url":"https://api.github.com/repos/RobotLocomotion/drake/issues{/number}","pulls_url":"https://api.github.com/repos/RobotLocomotion/drake/pulls{/number}","milestones_url":"https://api.github.com/repos/RobotLocomotion/drake/milestones{/number}","notifications_url":"https://api.github.com/repos/RobotLocomotion/drake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RobotLocomotion/drake/labels{/name}","releases_url":"https://api.github.com/repos/RobotLocomotion/drake/releases{/id}","created_at":"2014-01-26T16:11:05Z","updated_at":"2015-04-10T10:04:09Z","pushed_at":"2015-04-10T12:19:35Z","git_url":"git://github.com/RobotLocomotion/drake.git","ssh_url":"git@github.com:RobotLocomotion/drake.git","clone_url":"https://github.com/RobotLocomotion/drake.git","svn_url":"https://github.com/RobotLocomotion/drake","homepage":"https://github.com/RobotLocomotion/drake/wiki","size":177360,"stargazers_count":105,"watchers_count":105,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":120,"forks":97,"open_issues":120,"watchers":105,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972"},"html":{"href":"https://github.com/RobotLocomotion/drake/pull/972"},"issue":{"href":"https://api.github.com/repos/RobotLocomotion/drake/issues/972"},"comments":{"href":"https://api.github.com/repos/RobotLocomotion/drake/issues/972/comments"},"review_comments":{"href":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972/comments"},"review_comment":{"href":"https://api.github.com/repos/RobotLocomotion/drake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RobotLocomotion/drake/pulls/972/commits"},"statuses":{"href":"https://api.github.com/repos/RobotLocomotion/drake/statuses/7c852c7de6dbaa13a92de2d315059548a62b6549"}}}}