MoveJointsWithVelocity.h
Go to the documentation of this file.
1#pragma once
2
3#include <RobotAPI/interface/units/KinematicUnitInterface.h>
7
8#include <armarx/control/skills/aron/MoveJointsWithVelocityParams.aron.generated.h>
10
12{
13
14 /**
15 * @class MoveJoints
16 * @brief MoveJoints-skill to move joints to specified target values using the KinematicUnit
17 *
18 * Sets joint values with the KinematicUnit and waits until target values are reached. Can
19 * simulate trajectory when in simulation (otherwise trajectories from joint value updates through
20 * the KinematicUnit are not simulated).
21 */
23 public ::armarx::skills::SimpleSpecializedSkill<arondto::MoveJointsWithVelocityParams>
24 {
25
26 public:
27 struct Services
28 {
29 ::armarx::KinematicUnitInterfacePrx kinematicUnit;
30 };
31
32 static ::armarx::skills::SkillDescription
34 {
35 ParamType defaultParameters;
36 // TODO(): set parameter defaults
37
38 return ::armarx::skills::SkillDescription{
40 .description = "Moves joints with a specific velocity using the KinematicUnit",
41 .rootProfileDefaults = defaultParameters.toAron(),
42 .timeout = ::armarx::Duration::Minutes(1),
43 .parametersType = ParamType::ToAronType()};
44 }
45
46 MoveJointsWithVelocity(const Services&);
47
48
49 private:
50 using Base::exit;
51 using Base::main;
52
53 ::armarx::skills::Skill::MainResult main(const SpecializedMainInput& in) override;
54 ::armarx::skills::Skill::ExitResult exit(const SpecializedExitInput& in) override;
55
56 std::map<std::string, float>
57 filterJointTargetValues(const NameValueMap& jointsTargetValues,
58 const std::vector<std::string>& disabledJoints) const;
59
60 void switchControlMode(const NameValueMap& jointsTargetValues,
61 const armarx::ControlMode controlMode);
62
63 void moveJoints(const NameValueMap& jointsTargetValues,
65
66 private:
67 Services srv_;
68 };
69
70} // namespace armarx::control::skills::skills
static Duration Minutes(std::int64_t minutes)
Constructs a duration in minutes.
Definition Duration.cpp:96
Represents a duration.
Definition Duration.h:17
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
virtual ExitResult exit()
Override this method with the actual implementation.
Definition Skill.cpp:535
std::string MOVE_JOINTS_WITH_VELOCITY_SKILL_NAME
Definition constants.cpp:9
A result struct for skill exit function.
Definition Skill.h:69
A result struct for th main method of a skill.
Definition Skill.h:62