-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,13 +45,19 @@ std::string MotionClient::move_on_map( | |
| const Name& component_name, | ||
| const Name& slam_name, | ||
| const std::shared_ptr<motion_configuration>& motion_configuration, | ||
| const std::vector<GeometryConfig>& obstacles, | ||
| const AttributeMap& extra) { | ||
| return make_client_helper(this, *stub_, &StubType::MoveOnMap) | ||
| .with(extra, | ||
| [&](auto& request) { | ||
| *request.mutable_destination() = destination.to_proto(); | ||
| *request.mutable_component_name() = component_name.to_proto(); | ||
| *request.mutable_slam_service_name() = slam_name.to_proto(); | ||
|
|
||
| for (const auto& obstacle : obstacles) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So a user couldn't pass |
||
| *request.mutable_obstacles()->Add() = obstacle.to_proto(); | ||
| } | ||
|
|
||
| if (motion_configuration) { | ||
| *request.mutable_motion_configuration() = motion_configuration->to_proto(); | ||
| } | ||
|
|
||
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
vectormeans 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::vectorandstd::listare dynamically sized and bidirectionally iterable. The key difference is thatstd::vectoris guaranteed contiguous, but insertions/deletions can cost reallocation / element-by-element copies, whereasstd::listis non-contiguous, but insertions/deletions anywhere are cheap since contiguity isn't in play.