Skip to content
Snippets Groups Projects
Commit 57d01dfc authored by Markus Grotz's avatar Markus Grotz
Browse files

update RobotToArViz

- add parameter for collision model
parent af6f5b13
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,8 @@ namespace armarx
// defs->optional(updateFrequency, "updateFrequency", "Target number of updates per second.");
defs->defineOptionalProperty("updateFrequency", updateFrequency, "Target number of updates per second.");
defs->optional(gui.useCollisionModel, "UseCollisionModel", "Use the collision model for visualization");
defs->optional(gui.showRobotNodeFrames, "ShowRobotNodeFrames",
"If true, show frames of robot nodes (can be changed in RemoteGui).");
......@@ -65,6 +67,11 @@ namespace armarx
// Initialize robot visu element.
this->robotViz = viz::Robot(robot->getName()).file("", robot->getFilename());
if (gui.useCollisionModel)
{
this->robotViz.useCollisionModel();
}
createRemoteGuiTab();
RemoteGui_startRunningTask();
......@@ -98,6 +105,11 @@ namespace armarx
root.add(Label("Show Robot Node Frames"), {row, 0});
root.add(tab.showRobotNodeFrames, {row, 1});
row += 1;
tab.useCollisionModel.setValue(gui.useCollisionModel);
root.add(Label("Use Collision Model"), {row, 0});
root.add(tab.useCollisionModel, {row, 1});
row += 1;
}
RemoteGui_createTab(getName(), root, &tab);
}
......@@ -109,6 +121,20 @@ namespace armarx
{
gui.showRobotNodeFrames = newShowRobotNodeFrames;
}
bool newUseCollisionmodel = tab.useCollisionModel.getValue();
if (newUseCollisionmodel != gui.useCollisionModel)
{
gui.useCollisionModel = newUseCollisionmodel;
if (newUseCollisionmodel)
{
robotViz.useCollisionModel();
}
else
{
robotViz.useFullModel();
}
}
}
......
......@@ -116,6 +116,8 @@ namespace armarx
struct Tab : RemoteGui::Client::Tab
{
RemoteGui::Client::CheckBox showRobotNodeFrames;
RemoteGui::Client::CheckBox useCollisionModel;
// Todo: add spin box for scale
};
Tab tab;
......@@ -123,6 +125,9 @@ namespace armarx
struct Gui
{
bool showRobotNodeFrames = false;
bool useCollisionModel = false;
};
Gui gui;
......
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