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;
50 [[deprecated(
"Use ::viam::sdk::KinematicsDataUnspecified instead")]] =
52 using KinematicsDataSVA [[deprecated(
"Use ::viam::sdk::KinematicsDataSVA instead")]] =
54 using KinematicsDataURDF [[deprecated(
"Use ::viam::sdk::KinematicsDataURDF instead")]] =
56 using KinematicsData [[deprecated(
"Use ::viam::sdk::KinematicsData instead")]] =
57 ::viam::sdk::KinematicsData;
60 using MoveLimit = boost::variant<double, std::vector<double>>;
64 boost::optional<MoveLimit> max_vel_degs_per_sec;
65 boost::optional<MoveLimit> max_acc_degs_per_sec2;
66 boost::optional<double> max_tcp_speed;
107 const ProtoStruct& extra) = 0;
123 const ProtoStruct& extra) = 0;
138 std::vector<double> velocities_degs_per_sec;
139 boost::optional<std::vector<double>> accelerations_degs_per_sec2;
148 std::chrono::microseconds
time;
174 const std::function<boost::optional<std::vector<trajectory_point>>()>& batch_source,
220 const std::function<boost::optional<std::vector<trajectory_point>>()>& batch_source,
222 const ProtoStruct& extra) = 0;
234 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
239 virtual ::viam::sdk::KinematicsData
get_kinematics(
const ProtoStruct& extra) = 0;
250 virtual std::map<std::string, mesh>
get_3d_models(
const ProtoStruct& extra) = 0;
265 virtual std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra) = 0;
270 explicit Arm(std::string
name);
278namespace proto_convert_details {
293 viam::component::arm::v1::MoveThroughJointPositionsStreamedResponse*)
const;
297struct from_proto_impl<viam::component::arm::v1::MoveThroughJointPositionsStreamedResponse> {
299 const viam::component::arm::v1::MoveThroughJointPositionsStreamedResponse*)
const;
Definition resource_api.hpp:21
An Arm represents a physical robot arm that exists in three-dimensional space.
Definition arm.hpp:46
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.
std::vector< double > get_joint_positions()
Lists the joint positions in degrees of every joint on a robot arm.
Definition arm.hpp:91
virtual ProtoStruct get_status()=0
Get the status of the arm.
stream_outcome
How a streamed trajectory execution ended.
Definition arm.hpp:163
@ 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:60
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:100
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling arm.
Definition arm.hpp:259
inline ::viam::sdk::KinematicsData get_kinematics()
Get the kinematics data associated with the arm.
Definition arm.hpp:243
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:113
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:254
pose get_end_position()
Get the current position of the end of the arm.
Definition arm.hpp:71
void move_to_position(const pose &pose)
Move the end of the arm to.
Definition arm.hpp:81
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.
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:173
API api() const override
Returns the API associated with a particular resource.
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:63
Target kinematic constraints at a waypoint.
Definition arm.hpp:137
A single waypoint in a streamed joint-space trajectory.
Definition arm.hpp:129
std::chrono::microseconds time
Offset of this waypoint from the start of the trajectory.
Definition arm.hpp:148
std::vector< double > positions
Target position at this waypoint, one value per joint, in degrees.
Definition arm.hpp:151
boost::optional< kinematic_constraints > constraints
Optional velocity and acceleration constraints at this waypoint.
Definition arm.hpp:154
An update emitted while a streamed trajectory executes.
Definition arm.hpp:160
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