6#include <grpcpp/channel.h>
8#include <viam/api/service/motion/v1/motion.grpc.pb.h>
10#include <viam/sdk/services/motion.hpp>
24 const Name& component_name,
25 const std::shared_ptr<WorldState>& world_state,
27 const ProtoStruct& extra)
override;
30 const Name& component_name,
31 const Name& slam_name,
33 const std::vector<GeometryConfig>& obstacles,
34 const ProtoStruct& extra)
override;
37 const boost::optional<double>& heading,
38 const Name& component_name,
39 const Name& movement_sensor_name,
40 const std::vector<geo_geometry>& obstacles,
42 const std::vector<geo_geometry>& bounding_regions,
43 const ProtoStruct& extra)
override;
46 const std::string& destination_frame,
47 const std::vector<WorldState::transform>& supplemental_transforms,
48 const ProtoStruct& extra)
override;
50 void stop_plan(
const Name& component_name,
const ProtoStruct& extra)
override;
53 const ProtoStruct& extra)
override;
55 std::pair<Motion::plan_with_status, std::vector<Motion::plan_with_status>>
58 const ProtoStruct& extra)
override;
61 const std::string& execution_id,
62 const ProtoStruct& extra)
override;
64 std::pair<Motion::plan_with_status, std::vector<Motion::plan_with_status>>
66 const std::string& execution_id,
67 const ProtoStruct& extra)
override;
70 const ProtoStruct& extra)
override;
74 ProtoStruct
do_command(
const ProtoStruct& command)
override;
98 using StubType = service::motion::v1::MotionService::StubInterface;
99 std::vector<Motion::plan_status_with_id> list_plan_statuses_(
bool only_active_plans,
100 const ProtoStruct& extra);
101 std::pair<Motion::plan_with_status, std::vector<Motion::plan_with_status>> get_plan_(
102 const Name& component_name,
103 boost::optional<std::string> execution_id,
105 const ProtoStruct& extra);
106 std::unique_ptr<StubType> stub_;
107 std::shared_ptr<grpc::Channel> channel_;
The Motion service coordinates motion planning across all components of a given robot....
Definition motion.hpp:68
pose_in_frame get_pose(const Name &component_name, const std::string &destination_frame, const std::vector< WorldState::transform > &supplemental_transforms)
Get the pose of any component on the robot.
Definition motion.hpp:317
std::string move_on_map(const pose &destination, const Name &component_name, const Name &slam_name, const std::shared_ptr< motion_configuration > &motion_configuration, const std::vector< GeometryConfig > &obstacles)
Moves any component on the robot to a specific destination on a SLAM map.
Definition motion.hpp:236
bool move(const pose_in_frame &destination, const Name &name, const std::shared_ptr< WorldState > &world_state, const std::shared_ptr< constraints > &constraints)
Moves any compononent on the robot to a specified destination.
Definition motion.hpp:209
std::string move_on_globe(const geo_point &destination, const boost::optional< double > &heading, const Name &component_name, const Name &movement_sensor_name, const std::vector< geo_geometry > &obstacles, const std::shared_ptr< motion_configuration > &motion_configuration, const std::vector< geo_geometry > &bounding_regions)
Moves any component on the robot to a specific destination on a globe.
Definition motion.hpp:271
void stop_plan(const Name &component_name)
Stop a currently executing motion plan.
Definition motion.hpp:340
plan_with_status get_plan(const Name &component_name, const std::string &execution_id)
Returns the plan and state history of the requested plan. Returns a result if the last execution is s...
Definition motion.hpp:394
std::pair< plan_with_status, std::vector< plan_with_status > > get_latest_plan_with_replan_history(Name component_name)
Returns the plan, state history, and replan history of the most recent execution to move a component....
Definition motion.hpp:374
std::pair< plan_with_status, std::vector< plan_with_status > > get_plan_with_replan_history(const Name &component_name, const std::string &execution_id)
Returns the plan, state history, and replan history of the requested plan. Returns a result if the la...
Definition motion.hpp:416
std::vector< plan_status_with_id > list_plan_statuses()
Returns the status of plans created by MoveOnGlobe requests. Includes statuses of plans that are exec...
Definition motion.hpp:436
plan_with_status get_latest_plan(const Name &component_name)
Returns the plan and state history of the most recent execution to move a component....
Definition motion.hpp:354
std::vector< plan_status_with_id > list_active_plan_statuses()
Returns the status of currently active plans created by MoveOnGlobe requests. Includes statuses of pl...
Definition motion.hpp:451
A name for specific instances of resources.
Definition resource_api.hpp:63
virtual std::string name() const
Return the resource's name.
gRPC client implementation of a Motion service.
Definition motion_client.hpp:19
pose_in_frame get_pose(const Name &component_name, const std::string &destination_frame, const std::vector< WorldState::transform > &supplemental_transforms, const ProtoStruct &extra) override
Get the pose of any component on the robot.
void stop_plan(const Name &component_name, const ProtoStruct &extra) override
Stop a currently executing motion plan.
std::vector< Motion::plan_status_with_id > list_active_plan_statuses(const ProtoStruct &extra) override
Returns the status of currently active plans created by MoveOnGlobe requests. Includes statuses of pl...
Motion::plan_with_status get_latest_plan(const Name &component_name, const ProtoStruct &extra) override
Returns the plan and state history of the most recent execution to move a component....
std::vector< Motion::plan_status_with_id > list_plan_statuses(const ProtoStruct &extra) override
Returns the status of plans created by MoveOnGlobe requests. Includes statuses of plans that are exec...
std::pair< Motion::plan_with_status, std::vector< Motion::plan_with_status > > get_plan_with_replan_history(const Name &component_name, const std::string &execution_id, const ProtoStruct &extra) override
Returns the plan, state history, and replan history of the requested plan. Returns a result if the la...
std::string move_on_map(const pose &destination, const Name &component_name, const Name &slam_name, const std::shared_ptr< motion_configuration > &motion_configuration, const std::vector< GeometryConfig > &obstacles, const ProtoStruct &extra) override
Moves any component on the robot to a specific destination on a SLAM map.
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
std::pair< Motion::plan_with_status, std::vector< Motion::plan_with_status > > get_latest_plan_with_replan_history(const Name &component_name, const ProtoStruct &extra) override
Returns the plan, state history, and replan history of the most recent execution to move a component....
std::string move_on_globe(const geo_point &destination, const boost::optional< double > &heading, const Name &component_name, const Name &movement_sensor_name, const std::vector< geo_geometry > &obstacles, const std::shared_ptr< motion_configuration > &motion_configuration, const std::vector< geo_geometry > &bounding_regions, const ProtoStruct &extra) override
Moves any component on the robot to a specific destination on a globe.
bool move(const pose_in_frame &destination, const Name &component_name, const std::shared_ptr< WorldState > &world_state, const std::shared_ptr< constraints > &constraints, const ProtoStruct &extra) override
Moves any compononent on the robot to a specified destination.
Motion::plan_with_status get_plan(const Name &component_name, const std::string &execution_id, const ProtoStruct &extra) override
Returns the plan and state history of the requested plan. Returns a result if the last execution is s...
Specifies all constraints to be passed to Viam's motion planning, along with any optional parameters.
Definition motion.hpp:194
Describes a plan, its current status, and all status changes that have occurred previously on that pl...
Definition motion.hpp:154
Definition geometry.hpp:80
Defines configuration options for certain Motion APIs.
Definition motion.hpp:36