Skip to content
Snippets Groups Projects
Commit 4f843d60 authored by Fabian Reister's avatar Fabian Reister
Browse files

fix: used wrong robot

parent e7a835da
1 merge request!53Feature/hand unit reloading of preshapes
......@@ -24,13 +24,15 @@ namespace devices::ethercat::hand::common
auto robotToUse = robot;
if(forceRobotFileReload)
{
ARMARX_INFO << "Reloading robot model `" << robot->getFilename() << "`";
ARMARX_VERBOSE << "Reloading robot model `" << robot->getFilename() << "`";
robotToUse = VirtualRobot::RobotIO::loadRobot(robot->getFilename(), VirtualRobot::BaseIO::eStructure);
}
const auto eef = robot->getEndEffector(eefName);
const auto eef = robotToUse->getEndEffector(eefName);
const std::vector<std::string> preshapeNames = eef->getPreshapes();
ARMARX_VERBOSE << handName;
for (const auto& preshapeName : preshapeNames)
{
const VirtualRobot::RobotConfigPtr preshape = eef->getPreshape(preshapeName);
......@@ -41,9 +43,11 @@ namespace devices::ethercat::hand::common
std::map<std::string, float> preshapeMap;
for (const auto& pair : jointValues)
{
preshapeMap[simox::alg::remove_prefix(pair.first, handName)] = pair.second;
const std::string jointName = simox::alg::remove_prefix(pair.first, handName);
preshapeMap[jointName] = pair.second;
}
ARMARX_VERBOSE << preshapeName << ": " << preshapeMap;
preshapesByName.emplace(preshapeName, preshapeMap);
}
......
......@@ -24,7 +24,9 @@ namespace devices::ethercat::hand::common
virtual std::map<std::string, float> getShapeJointValues(const std::string& shape) = 0;
// virtual void reloadPreshapes() = 0;
virtual void reloadPreshapes() {};
virtual void reloadPreshapes() {
ARMARX_WARNING << "NYI";
};
virtual std::string
describeHandState() const
......
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