@@ -32,36 +32,26 @@ Navigation::Path path_from_proto(const viam::service::navigation::v1::Path& prot
3232NavigationClient::NavigationClient (std::string name, std::shared_ptr<grpc::Channel> channel)
3333 : Navigation(std::move(name)),
3434 stub_ (service::navigation::v1::NavigationService::NewStub(channel)),
35- channel_(std::move(channel)){};
35+ channel_(std::move(channel)) {};
3636
37- Navigation::Mode NavigationClient::get_mode (const std::string name, const ProtoStruct& extra) {
37+ Navigation::Mode NavigationClient::get_mode (const ProtoStruct& extra) {
3838 return make_client_helper (this , *stub_, &StubType::GetMode)
39- .with ([&](auto & request) {
40- *request.mutable_name () = name;
41- *request.mutable_extra () = map_to_struct (extra);
42- })
39+ .with ([&](auto & request) { *request.mutable_extra () = map_to_struct (extra); })
4340 .invoke ([](auto & response) { return Navigation::Mode (response.mode ()); });
4441}
4542
46- void NavigationClient::set_mode (const std::string name,
47- const Navigation::Mode mode,
48- const ProtoStruct& extra) {
43+ void NavigationClient::set_mode (const Navigation::Mode mode, const ProtoStruct& extra) {
4944 return make_client_helper (this , *stub_, &StubType::SetMode)
5045 .with ([&](auto & request) {
51- *request.mutable_name () = name;
5246 request.set_mode (viam::service::navigation::v1::Mode (mode));
5347 *request.mutable_extra () = map_to_struct (extra);
5448 })
5549 .invoke ([](auto & response) {});
5650}
5751
58- Navigation::LocationResponse NavigationClient::get_location (const std::string name,
59- const ProtoStruct& extra) {
52+ Navigation::LocationResponse NavigationClient::get_location (const ProtoStruct& extra) {
6053 return make_client_helper (this , *stub_, &StubType::GetLocation)
61- .with ([&](auto & request) {
62- *request.mutable_name () = name;
63- *request.mutable_extra () = map_to_struct (extra);
64- })
54+ .with ([&](auto & request) { *request.mutable_extra () = map_to_struct (extra); })
6555 .invoke ([](auto & response) {
6656 return Navigation::LocationResponse{
6757 geo_point::from_proto (response.location ()),
@@ -71,50 +61,38 @@ Navigation::LocationResponse NavigationClient::get_location(const std::string na
7161}
7262
7363std::unique_ptr<std::vector<Navigation::Waypoint>> NavigationClient::get_waypoints (
74- const std::string name, const ProtoStruct& extra) {
64+ const ProtoStruct& extra) {
7565 return make_client_helper (this , *stub_, &StubType::GetWaypoints)
76- .with ([&](auto & request) {
77- *request.mutable_name () = name;
78- *request.mutable_extra () = map_to_struct (extra);
79- })
66+ .with ([&](auto & request) { *request.mutable_extra () = map_to_struct (extra); })
8067 .invoke ([](auto & response) {
8168 auto ret = std::make_unique<std::vector<Navigation::Waypoint>>();
8269 repeatedPtrToVec (response.waypoints (), *ret, waypoint_from_proto);
8370 return ret;
8471 });
8572}
8673
87- void NavigationClient::add_waypoint (const std::string name,
88- const geo_point& location,
89- const ProtoStruct& extra) {
74+ void NavigationClient::add_waypoint (const geo_point& location, const ProtoStruct& extra) {
9075 return make_client_helper (this , *stub_, &StubType::AddWaypoint)
9176 .with ([&](auto & request) {
92- *request.mutable_name () = name;
9377 *request.mutable_location () = location.to_proto ();
9478 *request.mutable_extra () = map_to_struct (extra);
9579 })
9680 .invoke ([](auto & response) {});
9781}
9882
99- void NavigationClient::remove_waypoint (const std::string name,
100- const std::string id,
101- const ProtoStruct& extra) {
83+ void NavigationClient::remove_waypoint (const std::string id, const ProtoStruct& extra) {
10284 return make_client_helper (this , *stub_, &StubType::RemoveWaypoint)
10385 .with ([&](auto & request) {
104- *request.mutable_name () = name;
10586 *request.mutable_id () = id;
10687 *request.mutable_extra () = map_to_struct (extra);
10788 })
10889 .invoke ([](auto & response) {});
10990}
11091
11192std::unique_ptr<std::vector<geo_geometry>> NavigationClient::get_obstacles (
112- const std::string name, const ProtoStruct& extra) {
93+ const ProtoStruct& extra) {
11394 return make_client_helper (this , *stub_, &StubType::GetObstacles)
114- .with ([&](auto & request) {
115- *request.mutable_name () = name;
116- *request.mutable_extra () = map_to_struct (extra);
117- })
95+ .with ([&](auto & request) { *request.mutable_extra () = map_to_struct (extra); })
11896 .invoke ([](auto & response) {
11997 auto ret = std::make_unique<std::vector<geo_geometry>>();
12098 repeatedPtrToVec (response.obstacles (), *ret);
@@ -123,22 +101,19 @@ std::unique_ptr<std::vector<geo_geometry>> NavigationClient::get_obstacles(
123101}
124102
125103std::unique_ptr<std::vector<NavigationClient::Path>> NavigationClient::get_paths (
126- const std::string name, const ProtoStruct& extra) {
104+ const ProtoStruct& extra) {
127105 return make_client_helper (this , *stub_, &StubType::GetPaths)
128- .with ([&](auto & request) {
129- *request.mutable_name () = name;
130- *request.mutable_extra () = map_to_struct (extra);
131- })
106+ .with ([&](auto & request) { *request.mutable_extra () = map_to_struct (extra); })
132107 .invoke ([](auto & response) {
133108 auto ret = std::make_unique<std::vector<Path>>();
134109 repeatedPtrToVec (response.paths (), *ret, path_from_proto);
135110 return ret;
136111 });
137112}
138113
139- NavigationClient::MapType NavigationClient::get_properties (const std::string name ) {
114+ NavigationClient::MapType NavigationClient::get_properties () {
140115 return make_client_helper (this , *stub_, &StubType::GetProperties)
141- .with ([&](auto & request) { *request. mutable_name () = name; })
116+ .with ([&](auto & request) {})
142117 .invoke ([](auto & response) { return MapType (response.map_type ()); });
143118}
144119
0 commit comments