Go to the documentation of this file.
3 #include <VirtualRobot/Robot.h>
4 #include <VirtualRobot/RobotNodeSet.h>
6 #include <RobotAPI/interface/units/RobotUnit/NjointZeroTorqueController.h>
14 defaults.nodeSetName =
"RightArm";
15 return ::armarx::skills::SkillDescription{
17 .description =
"Enables zero torque mode for the runtime",
18 .rootProfileDefaults = defaults.toAron(),
20 .parametersType = ParamType::ToAronType(),
35 controller_->activateController();
42 controller_->deactivateController();
57 NJointZeroTorqueControllerConfigPtr config(
new NJointZeroTorqueControllerConfig());
58 config->maxTorque = 0;
59 controllerName_ =
"ControlSkills_ZeroTorque_" + in.
parameters.nodeSetName;
61 <<
"RNS " << in.
parameters.nodeSetName <<
" is unknown";
63 for (
auto& name : nodeSet->getNodeNames())
65 config->jointNames.push_back(name);
68 controller_ = armarx::NJointZeroTorqueControllerInterfacePrx::checkedCast(
69 context_.
robotUnitPlugin_->getRobotUnit()->getNJointController(controllerName_));
72 controller_ = armarx::NJointZeroTorqueControllerInterfacePrx::checkedCast(
86 context_.
robotUnitPlugin_->getRobotUnit()->deactivateAndDeleteNJointController(
Skill::InitResult init() final
This file is part of ArmarX.
armarx::control::skills::params::ZeroTorque ParamType
ZeroTorque(const config::ZeroTorque &)
static void WaitFor(const Duration &duration)
Wait for a certain duration on the virtual clock.
::armarx::skills::SkillDescription GetSkillDescription()
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_CHECK_GREATER(lhs, rhs)
This macro evaluates whether lhs is greater (>) than rhs and if it turns out to be false it will thro...
VirtualRobot::RobotPtr localRobot_
void connectTo(const Context &context)
Skill::ExitResult exit() final
const string NJointZeroTorqueController
static Duration Minutes(std::int64_t minutes)
Constructs a duration in minutes.
A result struct for th main method of a skill.
std::experimental::observer_ptr< armarx::plugins::RobotUnitComponentPlugin > robotUnitPlugin_
A result struct for skill exit function.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Skill::MainResult main() final
bool shouldSkillTerminate() const
Returns whether the skill should terminate as soon as possible.
A result struct for skill initialization.
This file offers overloads of toIce() and fromIce() functions for STL container types.
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.