-
Notifications
You must be signed in to change notification settings - Fork 27
RSDK-6709 - update move_on_map #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSDK-6709 - update move_on_map #217
Conversation
| const Name& component_name, | ||
| const Name& slam_name, | ||
| const std::shared_ptr<motion_configuration>& motion_configuration, | ||
| const std::vector<GeometryConfig>& obstacles, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my knowledge of cpp is very limited so I want to confirm that vector means list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! That's correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly "list" - more like "dynamic array". Both std::vector and std::list are dynamically sized and bidirectionally iterable. The key difference is that std::vector is guaranteed contiguous, but insertions/deletions can cost reallocation / element-by-element copies, whereas std::list is non-contiguous, but insertions/deletions anywhere are cheap since contiguity isn't in play.
| *request.mutable_component_name() = component_name.to_proto(); | ||
| *request.mutable_slam_service_name() = slam_name.to_proto(); | ||
|
|
||
| for (const auto& obstacle : obstacles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q]: does anything special need to happen if the user chooses to not specify any obstacles e.g. use nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a user couldn't pass nullptr or anything like that because the arg is not a pointer. If they wanted to not specify any obstacles they would want to pass an empty vec (trivial to do, just pass {} as the arg). Nothing special is required in that case.
nfranczak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
acmorrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| const Name& component_name, | ||
| const Name& slam_name, | ||
| const std::shared_ptr<motion_configuration>& motion_configuration, | ||
| const std::vector<GeometryConfig>& obstacles, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly "list" - more like "dynamic array". Both std::vector and std::list are dynamically sized and bidirectionally iterable. The key difference is that std::vector is guaranteed contiguous, but insertions/deletions can cost reallocation / element-by-element copies, whereas std::list is non-contiguous, but insertions/deletions anywhere are cheap since contiguity isn't in play.
No description provided.