12#include <boost/optional/optional.hpp>
13#include <boost/variant/variant.hpp>
15#include <viam/sdk/common/kinematics.hpp>
16#include <viam/sdk/common/mesh.hpp>
17#include <viam/sdk/common/pose.hpp>
18#include <viam/sdk/common/proto_convert.hpp>
19#include <viam/sdk/resource/stoppable.hpp>
20#include <viam/sdk/spatialmath/geometry.hpp>
28class MoveThroughJointPositionsStreamedResponse;
29class GetPropertiesResponse;
51 [[deprecated(
"Use ::viam::sdk::KinematicsDataUnspecified instead")]] =
53 using KinematicsDataSVA [[deprecated(
"Use ::viam::sdk::KinematicsDataSVA instead")]] =
55 using KinematicsDataURDF [[deprecated(
"Use ::viam::sdk::KinematicsDataURDF instead")]] =
57 using KinematicsData [[deprecated(
"Use ::viam::sdk::KinematicsData instead")]] =
58 ::viam::sdk::KinematicsData;
61 using MoveLimit = boost::variant<double, std::vector<double>>;
65 boost::optional<MoveLimit> max_vel_degs_per_sec;
66 boost::optional<MoveLimit> max_acc_degs_per_sec2;
67 boost::optional<double> max_tcp_speed;
117 const ProtoStruct& extra) = 0;
133 const ProtoStruct& extra) = 0;
148 std::vector<double> velocities_degs_per_sec;
149 boost::optional<std::vector<double>> accelerations_degs_per_sec2;
158 std::chrono::microseconds
time;
184 const std::function<boost::optional<std::vector<trajectory_point>>()>& batch_source,
230 const std::function<boost::optional<std::vector<trajectory_point>>()>& batch_source,
232 const ProtoStruct& extra) = 0;
244 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
249 virtual ::viam::sdk::KinematicsData
get_kinematics(
const ProtoStruct& extra) = 0;
260 virtual std::map<std::string, mesh>
get_3d_models(
const ProtoStruct& extra) = 0;
275 virtual std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra) = 0;
309 std::chrono::seconds enabled_for,
310 const ProtoStruct& extra) = 0;
326 explicit Arm(std::string
name);
336namespace proto_convert_details {
351 viam::component::arm::v1::MoveThroughJointPositionsStreamedResponse*)
const;
355struct from_proto_impl<viam::component::arm::v1::MoveThroughJointPositionsStreamedResponse> {
357 const viam::component::arm::v1::MoveThroughJointPositionsStreamedResponse*)
const;
362 void operator()(
const Arm::properties&, viam::component::arm::v1::GetPropertiesResponse*)
const;
367 Arm::properties operator()(
const viam::component::arm::v1::GetPropertiesResponse*)
const;
Definition resource_api.hpp:21
An Arm represents a physical robot arm that exists in three-dimensional space.
Definition arm.hpp:47
virtual bool is_moving()=0
Reports if the arm is in motion.
virtual void move_through_joint_positions(const std::vector< std::vector< double > > &positions, const MoveOptions &options, const ProtoStruct &extra)=0
Move each joint on the arm through the positions specified in.
virtual void move_to_position(const pose &pose, const ProtoStruct &extra)=0
Move the end of the arm to.
virtual std::vector< double > get_joint_positions(const ProtoStruct &extra)=0
Lists the joint positions in degrees of every joint on a robot arm.
bool get_manual_mode()
Reports whether the arm is currently in manual mode.
Definition arm.hpp:314
std::vector< double > get_joint_positions()
Lists the joint positions in degrees of every joint on a robot arm.
Definition arm.hpp:101
virtual ProtoStruct get_status()=0
Get the status of the arm.
stream_outcome
How a streamed trajectory execution ended.
Definition arm.hpp:173
@ k_halted_by_update_handler
update_handler returned false, stopping the stream early.
@ k_completed
The trajectory ran to its natural end.
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual stream_outcome move_through_joint_positions_streamed(const std::function< boost::optional< std::vector< trajectory_point > >()> &batch_source, const std::function< bool(trajectory_update)> &update_handler, const ProtoStruct &extra)=0
Execute a stream of trajectory points in order.
boost::variant< double, std::vector< double > > MoveLimit
A movement limit: either a single scalar applied uniformly, or per-joint values.
Definition arm.hpp:61
void move_to_joint_positions(const std::vector< double > &positions)
Move each joint on the arm to the corresponding angle specified in.
Definition arm.hpp:110
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition arm.hpp:269
inline ::viam::sdk::KinematicsData get_kinematics()
Get the kinematics data associated with the arm.
Definition arm.hpp:253
void set_manual_mode(bool manual_mode)
Enter or exit manual mode, with no time limit.
Definition arm.hpp:291
virtual std::map< std::string, mesh > get_3d_models(const ProtoStruct &extra)=0
Returns 3DModels associated with the calling arm.
virtual void move_to_joint_positions(const std::vector< double > &positions, const ProtoStruct &extra)=0
Move each joint on the arm to the corresponding angle specified in.
void move_through_joint_positions(const std::vector< std::vector< double > > &positions, const MoveOptions &options)
Move each joint on the arm through the positions specified in.
Definition arm.hpp:123
virtual::viam::sdk::KinematicsData get_kinematics(const ProtoStruct &extra)=0
Get the kinematics data associated with the arm.
std::map< std::string, mesh > get_3d_models()
Returns 3DModels associated with the calling arm.
Definition arm.hpp:264
properties get_properties()
Returns the properties of the arm which comprises the booleans indicating which optional features the...
Definition arm.hpp:279
virtual void set_manual_mode(bool manual_mode, std::chrono::seconds enabled_for, const ProtoStruct &extra)=0
Enter or exit manual mode.
virtual bool get_manual_mode(const ProtoStruct &extra)=0
Reports whether the arm is currently in manual mode.
pose get_end_position()
Get the current position of the end of the arm.
Definition arm.hpp:81
void move_to_position(const pose &pose)
Move the end of the arm to.
Definition arm.hpp:91
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling arm.
virtual pose get_end_position(const ProtoStruct &extra)=0
Get the current position of the end of the arm.
virtual properties get_properties(const ProtoStruct &extra)=0
Returns the properties of the arm which comprises the booleans indicating which optional features the...
stream_outcome move_through_joint_positions_streamed(const std::function< boost::optional< std::vector< trajectory_point > >()> &batch_source, const std::function< bool(trajectory_update)> &update_handler)
Execute a stream of trajectory points in order.
Definition arm.hpp:183
API api() const override
Returns the API associated with a particular resource.
void set_manual_mode(bool manual_mode, std::chrono::seconds enabled_for)
Enter or exit manual mode.
Definition arm.hpp:299
Definition component.hpp:10
virtual std::string name() const
Return the resource's name.
Definition stoppable.hpp:8
Definition resource_api.hpp:46
Movement specifications for move_through_joint_positions.
Definition arm.hpp:64
Optional features that the specific arm supports.
Definition arm.hpp:72
bool support_cartesian_commands
True if the arm supports direct cartesian commands (move_to_position is implemented)
Definition arm.hpp:76
bool support_manual_mode
True if the arm supports software-enabled manual mode.
Definition arm.hpp:74
Target kinematic constraints at a waypoint.
Definition arm.hpp:147
A single waypoint in a streamed joint-space trajectory.
Definition arm.hpp:139
std::chrono::microseconds time
Offset of this waypoint from the start of the trajectory.
Definition arm.hpp:158
std::vector< double > positions
Target position at this waypoint, one value per joint, in degrees.
Definition arm.hpp:161
boost::optional< kinematic_constraints > constraints
Optional velocity and acceleration constraints at this waypoint.
Definition arm.hpp:164
An update emitted while a streamed trajectory executes.
Definition arm.hpp:170
Kinematics data in Viam's Spatial Vector Algebra (SVA) format.
Definition kinematics.hpp:48
Kinematics data in URDF format with optional meshes by URDF filepath.
Definition kinematics.hpp:53
Kinematics data with unspecified format.
Definition kinematics.hpp:45
Definition proto_convert.hpp:24
Definition proto_convert.hpp:18