Commit 51216226 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Some bugfix

parent 97a7f173
......@@ -232,7 +232,7 @@ namespace hpp {
std::string groupName = createJointGroup (jn);
std::string hn = "handle_" + escapeJointName (std::string(rcs[i]));
fromHPP(t, config);
main->osg()->addXYZaxis (hn, color, 0.005f, 1.f);
main->osg()->addXYZaxis (hn, color, 0.005f, 0.015f);
main->osg()->applyConfiguration (hn, config);
main->osg()->addToGroup (hn, groupName);
}
......@@ -253,7 +253,7 @@ namespace hpp {
std::string groupName = createJointGroup (jn);
std::string hn = "gripper_" + escapeJointName (std::string(rcs[i]));
fromHPP(t, config);
main->osg()->addXYZaxis (hn, color, 0.005f, 1.f);
main->osg()->addXYZaxis (hn, color, 0.005f, 0.015f);
main->osg()->applyConfiguration (hn, config);
main->osg()->addToGroup (hn, groupName);
}
......
......@@ -124,7 +124,7 @@ namespace hpp {
connect (main, SIGNAL (applyCurrentConfiguration()),
SLOT (applyCurrentConfiguration()));
connect (main, SIGNAL (selectJointFromBodyName (QString)),
SLOT (selectJointFromBodyName (QString)));
SLOT (selectJointFromBodyName (QString)), Qt::QueuedConnection);
main->connect (this, SIGNAL (logJobFailed(int,QString)),
SLOT (logJobFailed(int, QString)));
main->connect (this, SIGNAL (logSuccess(QString)), SLOT (log(QString)));
......@@ -443,7 +443,7 @@ namespace hpp {
const OsgColor_t color(1,0,0,1);
/// This returns false if the frame already exists
if (main->osg()->addXYZaxis (n, color, 0.005f, 1.f)) {
if (main->osg()->addXYZaxis (n, color, 0.005f, 0.015f)) {
main->osg()->setVisibility (n, "ALWAYS_ON_TOP");
return;
} else {
......@@ -494,8 +494,9 @@ namespace hpp {
std::string target = escapeJointName(jn);
graphics::GroupNodePtr_t group = main->osg()->getGroup (target.c_str(), false);
if (group) return target;
if (main->osg()->createGroup(target.c_str())) {
main->osg()->addToGroup(target.c_str(), "joints");
if (!main->osg()->getGroup(target)) {
main->osg()->createGroup(target);
main->osg()->addToGroup(target, "joints");
hpp::Transform__var t = client()->robot()->getJointPosition (jn.c_str());
OsgConfiguration_t p;
......
......@@ -84,7 +84,10 @@ namespace hpp {
gepetto::gui::WindowsManagerPtr_t wsm = main->osg();
HppWidgetsPlugin::HppClient* hpp = plugin_->client();
hpp::floatSeqSeq_var waypoints = hpp->problem()->getWaypoints((CORBA::UShort)pid);
wsm->createScene (pn);
if (!wsm->getGroup(pn, false)) {
wsm->createGroup (pn);
wsm->addToGroup(pn, "hpp-gui");
}
hpp::floatSeq_var curCfg = hpp->robot()->getCurrentConfig();
graphics::Configuration pos;
osgVector3 pos1, pos2;
......@@ -94,20 +97,21 @@ namespace hpp {
std::string xyzName = ss.str();
// Get positions
hpp->robot()->setCurrentConfig(waypoints[i]);
hpp::Transform__var t = hpp->robot()->getLinkPosition(jointName.c_str());
hpp::Transform__var t = hpp->robot()->getJointPosition(jointName.c_str());
fromHPP(t, pos);
pos1 = pos2; pos2 = pos.position;
// Create the nodes
wsm->addXYZaxis(xyzName, colorN, 0.01f, 1.f);
if (wsm->nodeExists(xyzName)) wsm->deleteNode(xyzName, false);
wsm->addXYZaxis(xyzName, colorN, 0.01f, 0.05f);
wsm->applyConfiguration(xyzName, pos);
if (i > 0) {
xyzName.replace(pn.length() + 1, 4, "edge");
qDebug () << xyzName.c_str();
if (wsm->nodeExists(xyzName)) wsm->deleteNode(xyzName, false);
wsm->addLine(xyzName, pos1, pos2, colorE);
}
}
hpp->robot()->setCurrentConfig(curCfg.in());
wsm->addToGroup(pn, "hpp-gui");
wsm->refresh();
}
......
......@@ -15,7 +15,7 @@
namespace hpp {
namespace gui {
Roadmap::Roadmap(HppWidgetsPlugin *plugin):
radius (0.01f), axisSize (1.f),
radius (0.01f), axisSize (0.05f),
currentNodeId_ (0), currentEdgeId_ (0),
nodeColorMap_ (0), edgeColorMap_ (0),
plugin_ (plugin), link_ (false)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment