3 #ifndef ROBOWFLEX_DART_GUI_
4 #define ROBOWFLEX_DART_GUI_
8 #include <dart/external/imgui/imgui.h>
9 #include <dart/gui/osg/ImGuiWidget.hpp>
10 #include <dart/gui/osg/osg.hpp>
50 class
Viewer : public dart::gui::osg::ImGuiViewer
58 void updateTraversal()
override;
66 class Window :
public dart::gui::osg::WorldNode
90 Eigen::Isometry3d
pose{Eigen::Isometry3d::Identity()};
92 dart::dynamics::Frame *
parent{dart::dynamics::Frame::World()};
122 dart::gui::osg::InteractiveFramePtr
target;
123 dart::gui::osg::InteractiveFrameDnD *
dnd;
141 dart::gui::osg::BodyNodeDnD *
dnd;
166 std::size_t times = 1,
double fps = 60,
bool block =
true);
177 std::size_t times = 1,
double fps = 60,
bool block =
true);
218 class Widget :
public dart::gui::osg::ImGuiWidget
260 void render()
const override;
276 void render()
const override;
297 void render()
const override;
317 void render()
const override;
342 void render()
const override;
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
A checkbox element that modifies a boolean.
bool & boolean
Associated boolean.
CheckboxElement(const std::string &text, bool &boolean)
Constructor.
const std::string text
Display text.
void render() const override
Render method. Renders IMGUI contents.
A shared pointer wrapper for robowflex::darts::WindowWidget::Element.
virtual void render() const =0
Render method. Renders IMGUI contents.
Line plot element. Displays an updated line graph of data.
float minimum() const
Compute the minimum over the data.
bool show_avg
Display average value under plot.
std::vector< float > elements
All data points.
std::string units
Plot Units.
Eigen::Vector3d color
Color of plot.
std::size_t index
Index in data.
float latest
Last input data point.
float average() const
Compute the average over the data.
float maximum() const
Compute the maximum over the data.
void render() const override
Render method. Renders IMGUI contents.
bool recent
Display most recent value on plot.
bool show_min
Display minimum value under plot.
void addPoint(float x)
Add a point to the plot data.
std::size_t total_elements
Total elements inserted in data.
std::size_t max_size
Maximum size of plot data.
std::string label
Plot Label.
bool show_max
Display maximum value under plot.
A helper class to setup common OMPL structures for planning.
Generic rendered element. Use callback to display whatever GUI elements needed.
RenderElement(const RenderCallback &callback)
Constructor.
const RenderCallback callback
Callback.
void render() const override
Render method. Renders IMGUI contents.
A shared pointer wrapper for robowflex::darts::StateSpace.
A shared pointer wrapper for robowflex::darts::TSR.
A shared pointer wrapper for robowflex::darts::TSRSet.
The specification of a TSR.
TextElement(const std::string &text)
Constructor.
void render() const override
Render method. Renders IMGUI contents.
const std::string text
Text to display.
Open Scene Graph GUI for DART visualization.
WindowWidgetPtr widget_
IMGUI widget.
WorldPtr getWorld()
Get world used for visualization.
WindowWidgetPtr getWidget()
Get the IMGUI configurable widget.
Window(const WorldPtr &world)
Constructor.
void run(std::function< void()> thread={})
Run the GUI. Blocks.
void animatePath(const StateSpacePtr &space, const ompl::geometric::PathGeometric &path, std::size_t times=1, double fps=60, bool block=true)
Animate a motion plan using the world.
std::shared_ptr< std::thread > animation_
Animation thread.
std::vector< WidgetPtr > widgets_
Other widgets;.
::osg::ref_ptr< Window > node_
OSG Node.
void addWidget(const WidgetPtr &widget)
Add a new IMGUI widget.
WorldPtr world_
World to visualize.
InteractiveReturn createInteractiveMarker(const InteractiveOptions &options)
Create a new interactive marker in the GUI.
void customPreRefresh() override
const WorldPtr & getWorldConst() const
Get world used for visualization.
void customPostRefresh() override
DnDReturn enableNodeDragNDrop(dart::dynamics::BodyNode *node, const DnDCallback &callback={})
Enable drag 'n drop functionality on a body node being visualized. With DnD, the body node will autom...
A shared pointer wrapper for robowflex::darts::World.
std::string generateUUID()
Generate a unique identifier.
Main namespace. Contains all library classes and functions.
Return from creating a movable frame.
dart::gui::osg::BodyNodeDnD * dnd
Drag 'n Drop object.
dart::common::Connection signal
Connection from motion to callback.
Options for creating an interactive marker.
void disableControls()
Disables all controls.
std::string name
Name of marker.
bool rotation[3]
Rotation ring controls enabled.
void disableRotationControls()
Disables all rotation controls.
bool obstructable
Is this frame obstructable?
void disableLinearControls()
Disables all linear controls.
Eigen::Isometry3d pose
Relative pose of marker.
InteractiveCallback callback
Callback function on motion.
double size
Size of marker.
double thickness
Thickness of marker arrows.
bool linear[3]
Linear position controls enabled.
bool planar[3]
Planar translation controls enabled.
void disablePlanarControls()
Disables all planar controls.
dart::dynamics::Frame * parent
Parent frame.
Return from creating an interactive marker.
dart::gui::osg::InteractiveFrameDnD * dnd
Drag 'n Drop object.
dart::common::Connection signal
Connection from motion to callback.
dart::gui::osg::InteractiveFramePtr target
Interactive Frame generated.
void callback(movegroup::MoveGroupHelper::Action &action)