Skip to content
Snippets Groups Projects
Commit 7cc9b4a5 authored by Patrick Dormanns's avatar Patrick Dormanns
Browse files

set logging tag

parent 6ea294ac
No related branches found
No related tags found
1 merge request!53Implement 'PointAt'-skill
......@@ -14,6 +14,7 @@ namespace armarx::control::pointing::core
{
Pointing::Pointing(const Remote& remote) : remote_(remote)
{
setTag("Pointing");
}
void
......@@ -38,7 +39,7 @@ namespace armarx::control::pointing::core
if (params.handShape)
{
auto shapeJointValues = GetShapeJointValues(robot, params.side, *params.handShape);
auto shapeJointValues = getShapeJointValues(robot, params.side, *params.handShape);
addHandTrajectory(robot, traj, shapeJointValues);
}
......@@ -129,6 +130,23 @@ namespace armarx::control::pointing::core
});
}
std::map<std::string, float>
Pointing::getShapeJointValues(VirtualRobot::RobotPtr robot,
Side side,
const std::string& shapeName)
{
auto eefName = std::string("Hand_") + (side == Side::LEFT ? "L" : "R") + "_EEF"; // TODO
auto eef = robot->getEndEffector(eefName);
auto shape = eef->getPreshape(shapeName);
if (not shape)
{
ARMARX_ERROR << "Hand '" << eefName << "' has no shape '" << shape << "'";
throw armarx::exceptions::local::PointingFailedException();
}
return shape->getRobotNodeJointValueMap();
}
void
Pointing::addHandTrajectory(VirtualRobot::RobotPtr robot,
armarx::TrajectoryPtr traj,
......@@ -167,21 +185,4 @@ namespace armarx::control::pointing::core
ARMARX_INFO << "Pointing target reached";
}
std::map<std::string, float>
Pointing::GetShapeJointValues(VirtualRobot::RobotPtr robot,
Side side,
const std::string& shapeName)
{
auto eefName = std::string("Hand_") + (side == Side::LEFT ? "L" : "R") + "_EEF"; // TODO
auto eef = robot->getEndEffector(eefName);
auto shape = eef->getPreshape(shapeName);
if (not shape)
{
ARMARX_ERROR << "Hand '" << eefName << "' has no shape '" << shape << "'";
throw armarx::exceptions::local::PointingFailedException();
}
return shape->getRobotNodeJointValueMap();
}
} // namespace armarx::control::pointing::core
......@@ -36,7 +36,7 @@ namespace armarx::control::pointing::core
*
* @ingroup Library-pointing
*/
class Pointing
class Pointing : virtual public armarx::Logging
{
public:
struct Remote
......@@ -100,15 +100,15 @@ namespace armarx::control::pointing::core
void
addWristTrajectory(VirtualRobot::RobotPtr robot, Side side, armarx::TrajectoryPtr traj);
std::map<std::string, float>
getShapeJointValues(VirtualRobot::RobotPtr robot, Side side, const std::string& shapeName);
void addHandTrajectory(VirtualRobot::RobotPtr robot,
armarx::TrajectoryPtr traj,
const std::map<std::string, float>& shapeJointValues);
void playTrajectory(armarx::TrajectoryPtr traj);
static std::map<std::string, float>
GetShapeJointValues(VirtualRobot::RobotPtr robot, Side side, const std::string& shapeName);
private:
Remote remote_;
std::atomic_bool aborted;
......
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