{"action":"opened","issue":{"url":"https://api.github.com/repos/ApolloAuto/apollo/issues/2738","repository_url":"https://api.github.com/repos/ApolloAuto/apollo","labels_url":"https://api.github.com/repos/ApolloAuto/apollo/issues/2738/labels{/name}","comments_url":"https://api.github.com/repos/ApolloAuto/apollo/issues/2738/comments","events_url":"https://api.github.com/repos/ApolloAuto/apollo/issues/2738/events","html_url":"https://github.com/ApolloAuto/apollo/issues/2738","id":294163223,"number":2738,"title":"relative_time check in DiscretizedTrajectory::Evaluate(const double relative_time)","user":{"login":"jilinzhou","id":6865725,"avatar_url":"https://avatars3.githubusercontent.com/u/6865725?v=4","gravatar_id":"","url":"https://api.github.com/users/jilinzhou","html_url":"https://github.com/jilinzhou","followers_url":"https://api.github.com/users/jilinzhou/followers","following_url":"https://api.github.com/users/jilinzhou/following{/other_user}","gists_url":"https://api.github.com/users/jilinzhou/gists{/gist_id}","starred_url":"https://api.github.com/users/jilinzhou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jilinzhou/subscriptions","organizations_url":"https://api.github.com/users/jilinzhou/orgs","repos_url":"https://api.github.com/users/jilinzhou/repos","events_url":"https://api.github.com/users/jilinzhou/events{/privacy}","received_events_url":"https://api.github.com/users/jilinzhou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-04T02:19:07Z","updated_at":"2018-02-04T02:19:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Here is code snippet for the function:\r\n\r\n```\r\nTrajectoryPoint DiscretizedTrajectory::Evaluate(\r\n    const double relative_time) const {\r\n  CHECK(!trajectory_points_.empty());\r\n  CHECK(trajectory_points_.front().relative_time() <= relative_time &&\r\n        trajectory_points_.back().relative_time() <= relative_time)\r\n      << \"Invalid relative time input!\";\r\n\r\n...\r\n}\r\n```\r\nConsidering  trajectory_points_.front().relative_time() **<=**  trajectory_points_.back().relative_time(), is the first part of compare **trajectory_points_.front().relative_time() <= relative_time** needed?\r\n\r\nShould it be something like this:\r\n\r\n```\r\n  CHECK(trajectory_points_.front().relative_time() >= relative_time ||\r\n        trajectory_points_.back().relative_time() <= relative_time)\r\n      << \"Invalid relative time input!\";\r\n```\r\n\r\nI can be wrong about this. \r\n\r\nBTW, what is minimum number of trajectory points to form a valid trajectory? Is a single point trajectory meaningful ( **CHECK(!trajectory_points_.empty());**)? \r\n\r\n"}}
{"actor":{"display_login":"jilinzhou"}}