MoveJointsToPosition.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <RobotAPI/interface/units/KinematicUnitInterface.h>
4
#include <
RobotAPI/libraries/armem/client/MemoryNameSystem.h
>
5
#include <
RobotAPI/libraries/armem_robot_state/client/common/VirtualRobotReader.h
>
6
#include <
RobotAPI/libraries/skills/provider/SimpleSpecializedSkill.h
>
7
8
#include <armarx/control/skills/aron/MoveJointsToPositionParams.aron.generated.h>
9
#include <
armarx/control/skills/constants/constants.h
>
10
11
namespace
armarx::control::skills::skills
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
*/
22
class
MoveJointsToPosition
:
23
public
::armarx::skills::SimpleSpecializedSkill
<arondto::MoveJointsToPositionParams>
24
{
25
26
public
:
27
struct
Services
28
{
29
::armarx::KinematicUnitInterfacePrx
kinematicUnit
;
30
::armarx::armem::robot_state::VirtualRobotReader
virtualRobotReader
;
31
std::string
robotName
;
32
};
33
34
static ::armarx::skills::SkillDescription
35
GetSkillDescription
()
36
{
37
ParamType
defaults;
38
defaults.timeoutMS = 1000;
39
40
return ::armarx::skills::SkillDescription{
41
.
skillId
= {.
skillName
=
constants::MOVE_JOINTS_TO_POSITION_SKILL_NAME
},
42
.description =
"Moves joints to specified target values using the KinematicUnit"
,
43
.rootProfileDefaults = defaults.toAron(),
44
.timeout =
::armarx::Duration::Minutes
(1),
45
.parametersType = ParamType::ToAronType()};
46
}
47
48
MoveJointsToPosition
(
const
Services&);
49
50
51
private
:
52
using
Base::exit
;
53
using
Base::main
;
54
55
::armarx::skills::Skill::MainResult
main
(
const
SpecializedMainInput& in)
override
;
56
::armarx::skills::Skill::ExitResult
exit
(
const
SpecializedExitInput& in)
override
;
57
58
std::map<std::string, float>
59
filterJointTargetValues(
const
NameValueMap
& jointsTargetValues,
60
const
std::vector<std::string>& disabledJoints)
const
;
61
62
bool
checkJointsTargetValuesValid(
const
NameValueMap
& jointsTargetValues,
63
const
VirtualRobot::RobotPtr
& virtualRobot);
64
65
void
switchControlMode(
const
NameValueMap
& jointsTargetValues,
66
const
armarx::ControlMode controlMode);
67
68
void
moveJoints(
const
NameValueMap
& jointsTargetValues,
69
float
accuracyDefault,
70
const
NameValueMap
& accuracyOverride,
71
float
timeoutDefault,
72
NameValueMap
timeoutOverride,
73
const
VirtualRobot::RobotPtr
& virtualRobot);
74
75
void
moveJointsSimulation(
const
NameValueMap
& jointsTargetValues,
76
float
speedDefault,
77
const
NameValueMap
& speedOverride,
78
const
VirtualRobot::RobotPtr
& virtualRobot);
79
80
private
:
81
Services srv_;
82
};
83
84
}
// namespace armarx::control::skills::skills
armarx::control::skills::skills::MoveJointsToPosition
Definition:
MoveJointsToPosition.h:22
armarx::control::skills::skills::MoveJointsToPosition::Services::virtualRobotReader
::armarx::armem::robot_state::VirtualRobotReader virtualRobotReader
Definition:
MoveJointsToPosition.h:30
armarx::armem::robot_state::VirtualRobotReader
The VirtualRobotReader class.
Definition:
VirtualRobotReader.h:39
armarx::skills::SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >::ParamType
arondto::MoveJointsToPositionParams ParamType
Definition:
SimpleSpecializedSkill.h:14
armarx::skills::SkillID::skillName
std::string skillName
Definition:
SkillID.h:41
armarx::control::skills::constants::MOVE_JOINTS_TO_POSITION_SKILL_NAME
std::string MOVE_JOINTS_TO_POSITION_SKILL_NAME
Definition:
constants.cpp:8
armarx::control::skills::skills::MoveJointsToPosition::Services::kinematicUnit
::armarx::KinematicUnitInterfacePrx kinematicUnit
Definition:
MoveJointsToPosition.h:29
SimpleSpecializedSkill.h
armarx::skills::SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >::exit
Skill::ExitResult exit() final
Definition:
SimpleSpecializedSkill.h:81
constants.h
armarx::control::skills::skills::MoveJointsToPosition::Services::robotName
std::string robotName
Definition:
MoveJointsToPosition.h:31
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:19
armarx::skills::SimpleSpecializedSkill
Definition:
SimpleSpecializedSkill.h:10
armarx::control::skills::skills::MoveJointsToPosition::MoveJointsToPosition
MoveJointsToPosition(const Services &)
Definition:
MoveJointsToPosition.cpp:10
VirtualRobotReader.h
armarx::core::time::Duration::Minutes
static Duration Minutes(std::int64_t minutes)
Constructs a duration in minutes.
Definition:
Duration.cpp:96
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition:
Skill.h:39
armarx::skills::Skill::ExitResult
A result struct for skill exit function.
Definition:
Skill.h:46
armarx::skills::Skill::exit
virtual ExitResult exit()
Override this method with the actual implementation.
Definition:
Skill.cpp:451
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition:
PlatformFollowerController.h:88
armarx::skills::SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >::main
Skill::MainResult main() final
Definition:
SimpleSpecializedSkill.h:71
armarx::control::skills::skills
Definition:
ExecuteTrajectory.cpp:18
armarx::skills::Skill::main
virtual MainResult main()
Override this method with the actual implementation. The callback is for status updates to the callin...
Definition:
Skill.cpp:458
armarx::control::skills::skills::MoveJointsToPosition::Services
Definition:
MoveJointsToPosition.h:27
MemoryNameSystem.h
armarx::control::skills::skills::MoveJointsToPosition::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition:
MoveJointsToPosition.h:35
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition:
Bus.h:19
armarx
control
skills
skills
MoveJointsToPosition.h
Generated on Sat Mar 29 2025 09:17:33 for armarx_documentation by
1.8.17