Skip to content
Snippets Groups Projects
Commit 951c148b authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Use PackagePath instead of absolute path

parent 8709fbad
No related branches found
No related tags found
2 merge requests!51Do not use absolute paths, use PackagePath instead,!47Changes for ARMAR-DE and ARMAR-7
......@@ -2,6 +2,7 @@
<AronTypeDefinition>
<AronIncludes>
<Include include="RobotAPI/libraries/aron/common/aron/framed.xml" />
<Include include="RobotAPI/libraries/aron/common/aron/PackagePath.xml" />
</AronIncludes>
<GenerateTypes>
<Object name="::armarx::control::retrieve_hand::skills::RetrieveHandParams">
......@@ -40,7 +41,7 @@
<ObjectChild key="fileNames">
<List>
<String/>
<armarx::arondto::PackagePath/>
</List>
</ObjectChild>
......
......@@ -2,6 +2,8 @@
#include <ArmarXCore/core/logging/Logging.h>
#include <RobotAPI/libraries/aron/common/aron_conversions/packagepath.cpp>
#include <armarx/control/deprecated_njoint_mp_controller/task_space/ControllerInterface.h>
#include <armarx/control/retrieve_hand/constants/constants.h>
......@@ -11,15 +13,17 @@ namespace armarx::control::retrieve_hand::skills
::armarx::skills::SkillDescription
RetrieveHand::GetSkillDescription()
{
ParamType defaultParams;
defaultParams.targetPose.header.agent = "Armar7";
defaultParams.targetPose.header.frame = "root";
defaultParams.targetPose.position = Eigen::Matrix<float, 3, 1>{-234.0f, 284.06f, 1103.0f};
defaultParams.targetPose.orientation =
ParamType defaults;
defaults.targetPose.header.agent = "Armar7";
defaults.targetPose.header.frame = "root";
defaults.targetPose.position = Eigen::Matrix<float, 3, 1>{-234.0f, 284.06f, 1103.0f};
defaults.targetPose.orientation =
Eigen::Quaternion<float>{0.7640368, -0.63349, 0.06744281, -0.10187};
defaultParams.fileNames = std::vector<std::string>{
"/home/armar-user/code/armarx_integration/robots/armar7/motions/data/armar7_motions/"
"tcp_trajectories/dmp/default_left.csv"};
armarx::arondto::PackagePath& packagePath = defaults.fileNames.emplace_back();
packagePath.package = "armar7_motions";
packagePath.path = "tcp_trajectories/dmp/default_left.csv";
// ARMARX_INFO << VAROUT(defaultParams.targetPose);
// ARMARX_INFO << VAROUT(defaultParams.targetPose.position) << VAROUT(defaultParams.targetPose.orientation);
// ARMARX_INFO << VAROUT(defaultParams.targetPose.header.frame) << VAROUT(defaultParams.targetPose.header.agent);
......@@ -32,7 +36,7 @@ namespace armarx::control::retrieve_hand::skills
return ::armarx::skills::SkillDescription{.skillId = skillId,
.description =
"TODO: Description of skill RetrieveHand.",
.rootProfileDefaults = defaultParams.toAron(),
.rootProfileDefaults = defaults.toAron(),
.timeout = ::armarx::Duration::MilliSeconds(1000),
.parametersType = ParamType::ToAronType()};
}
......@@ -66,6 +70,14 @@ namespace armarx::control::retrieve_hand::skills
in.parameters.targetPose.orientation,
in.parameters.targetPose.header.frame,
in.parameters.targetPose.header.agent};
std::vector<std::string> fileNames;
for (const auto& aronPackagePath : in.parameters.fileNames)
{
armarx::PackagePath packagePath = fromAron<armarx::PackagePath>(aronPackagePath);
fileNames.push_back(packagePath.toSystemPath().string());
}
core::RetrieveHand::Properties props{
.robotName = in.parameters.robotName,
.robotNodeSet = in.parameters.robotNodeSet,
......@@ -75,7 +87,7 @@ namespace armarx::control::retrieve_hand::skills
.kpAngular = in.parameters.kpAngular,
.kdLinear = in.parameters.kdLinear,
.kdAngular = in.parameters.kdAngular,
.fileNames = in.parameters.fileNames,
.fileNames = fileNames,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment