ZeroPose.cpp
Go to the documentation of this file.
1 #include "ZeroPose.h"
2 
4 
5 #include <armarx/control/skills/aron/MoveJointsToNamedConfigurationParams.aron.generated.h>
8 
10 {
11 
12  ZeroPose::ZeroPose() : SimpleSpecializedSkill(GetSkillDescription())
13  {
14  }
15 
18  {
19  ParamType defaultParams;
20 
21  std::stringstream desc;
22  desc << "Move all joints to zero (except joints which would cause a self collision)."
23  << "\n\n"
24  << "The `enable*` parameters can be used to enable/disable movement for different "
25  "body parts of the robot.";
26 
29  .description = desc.str(),
30  .rootProfileDefaults = defaultParams.toAron(),
31  .timeout = ::armarx::Duration::Seconds(30),
32  .parametersType = ParamType::ToAronType(),
33  };
34  }
35 
37  ZeroPose::main(const SpecializedMainInput& in)
38  {
39  auto moveToConfiguration = armarx::skills::SpecializedSkillProxy<
40  armarx::control::skills::arondto::MoveJointsToNamedConfigurationParams>(
41  this->manager,
45  });
46  auto subParams = moveToConfiguration.getRootProfileParameters();
47 
48  subParams.configuration = "Zero";
49  copy_params(in.parameters, subParams);
50 
51  this->callSubskill(moveToConfiguration, subParams.toAron());
52 
53  return MakeSucceededResult();
54  }
55 
56 } // namespace armarx::control::skills::skills::meta
armarx::skills::Skill::manager
manager::dti::SkillManagerInterfacePrx manager
Definition: Skill.h:327
armarx::skills::SimpleSpecializedSkill< arondto::NamedConfigurationParams >::ParamType
arondto::NamedConfigurationParams ParamType
Definition: SimpleSpecializedSkill.h:14
SpecializedSkillProxy.h
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:60
param_conversions.h
armarx::skills::SkillDescription
Definition: SkillDescription.h:18
armarx::control::skills::skills::meta::ZeroPose::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition: ZeroPose.cpp:17
armarx::skills::SkillID::providerId
std::optional< ProviderID > providerId
Definition: SkillID.h:59
armarx::skills::SpecializedSkillProxy::getRootProfileParameters
AronT getRootProfileParameters()
Definition: SpecializedSkillProxy.h:30
armarx::skills::Skill::callSubskill
std::optional< TerminatedSkillStatusUpdate > callSubskill(const skills::SkillProxy &proxy)
Call a subskill with default parameters and block until the subskill terminates.
Definition: Skill.cpp:22
armarx::control::skills::skills::copy_params
void copy_params(const arondto::MoveJointsParams &from, arondto::MoveJointsToPositionParams &to)
Definition: param_conversions.h:12
constants.h
armarx::core::time::Duration::Seconds
static Duration Seconds(std::int64_t seconds)
Constructs a duration in seconds.
Definition: Duration.cpp:83
armarx::skills::SpecializedSkillProxy
Definition: SpecializedSkillProxy.h:10
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:20
armarx::skills::Skill::MakeSucceededResult
static MainResult MakeSucceededResult(aron::data::DictPtr data=nullptr)
Definition: Skill.cpp:315
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition: Skill.h:48
ZeroPose.h
armarx::skills::SimpleSpecializedSkill< arondto::NamedConfigurationParams >::main
Skill::MainResult main() final
Definition: SimpleSpecializedSkill.h:71
armarx::control::skills::constants::ZERO_POSE_SKILL_NAME
std::string ZERO_POSE_SKILL_NAME
Definition: constants.cpp:17
armarx::control::skills::constants::MOVE_JOINTS_TO_NAMED_CONFIGURATION_SKILL_NAME
std::string MOVE_JOINTS_TO_NAMED_CONFIGURATION_SKILL_NAME
Definition: constants.cpp:10
armarx::control::skills::skills::meta
Definition: HomePose.cpp:12
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::control::skills::skills::meta::ZeroPose::ZeroPose
ZeroPose()
Definition: ZeroPose.cpp:12
armarx::skills::Skill::getSkillId
SkillID getSkillId() const
Get the id of the skill.
Definition: Skill.h:74