Anders Bøgild - Robo[LAB]
unread,Nov 4, 2009, 2:41:24 AM11/4/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RobWorkDevel
When defining a movable frame in the scene XML file i can view the
frame coordinate system using the 'Show/Remove Frame' option in the
TreeView plugin, and any drawable added to the movable frame can be
toggled on and off with the 'Enable' option also in the TreeView
plugin.
However when i create a movable frame in runtime (see code below) i
cannot get any graphics for that frame to show up in RWS, eventhough i
can see that the frame exists in TreeView.
Is there something i'm missing?
------ example ----
MovableFrame *newFrame = new MovableFrame("AndersFrame");
_workcell->getStateStructure()->addFrame(newFrame,_workcell-
>getWorldFrame());
// now this is VERY important, remember to update the RobWorkStudio
state
State newState = _workcell->getStateStructure()->getDefaultState();
getRobWorkStudio()->setState(newState);
....
//Find the frame and transformation -works fine
State state = _rws->getState();
MovableFrame* theFrame = dynamic_cast<MovableFrame*>(_workcell-
>findFrame("AndersFrame"));
Rotation3D<double> targetR(1,0,0,0,1,0,0,0,1);
Vector3D<double> targetP(0,0,0);
Transform3D<double> target(targetP,targetR);
theFrame->setTransform(target,state);
...
// Add a drawable 'hccell1' to the frame
//_drawer->addDrawableToFrame(_workcell->getWorldFrame(), hccell1); //
drawable shows up fine here
_drawer->addDrawableToFrame(theFrame, hccell1); // cannot see any
geometry
_rws->setState(_rws->getState());