Robowflex  v0.1
Making MoveIt Easy
robowflex::darts::TSREditWidget Class Reference

IMGUI widget to design TSRs. More...

#include <gui.h>

+ Inheritance diagram for robowflex::darts::TSREditWidget:

Public Member Functions

 TSREditWidget (const std::string &name="TSR", const TSR::Specification &spec={})
 Constructor. More...
 
void initialize (Window *window) override
 Initialization with window context. More...
 
void prerefresh () override
 Called before window refresh. More...
 
void render () override
 Render GUI. More...
 
const TSR::SpecificationgetSpecification () const
 Get current TSR specification. More...
 
const TSRPtrgetTSR () const
 Get the current TSR. More...
 

Private Attributes

TSR Specification
const std::string name_
 Name of this window. More...
 
const TSR::Specification original_
 Original specification provided to the window. More...
 
TSR::Specification spec_
 Current specification. More...
 
TSR::Specification prev_
 Prior iteration specification. More...
 
TSRPtr tsr_
 Corresponding TSR. More...
 
std::mutex mutex_
 Solving mutex. More...
 
GUI Options
bool sync_bounds_ {true}
 Synchronize changes in volume on other bound. More...
 
bool show_volume_ {true}
 Show TSR volume. More...
 
bool show_bounds_ {true}
 Show TSR rotation bounds. More...
 
GUI Values
const double volume_alpha_ {0.2}
 Volume alpha. More...
 
const double rotation_alpha_ {0.6}
 Rotation bound alpha. More...
 
const double rotation_width_ {0.05}
 Rotation bound width. More...
 
const float max_position_ {5.0f}
 Max position value. More...
 
const float drag_step_ {0.01f}
 Slider drag amount. More...
 
float position_ [3]
 GUI frame position. More...
 
float rotation_ [3]
 GUI frame rotation. More...
 
float xp_ [2]
 GUI X position bounds. More...
 
float yp_ [2]
 GUI Y position bounds. More...
 
float zp_ [2]
 GUI Z position bounds. More...
 
float xr_ [2]
 GUI X orientation bounds. More...
 
float yr_ [2]
 GUI Y orientation bounds. More...
 
float zr_ [2]
 GUI Z orientation bounds. More...
 
float inner_radius {0.2}
 GUI Rotation bound inner radius. More...
 

Element Synchronization

bool gui_ {false}
 True if a synchronize call is coming from the GUI update loop. More...
 
void updateFrameCB (const dart::gui::osg::InteractiveFrame *frame)
 Frame update callback on moving the main interactive frame. More...
 
void updateLLCB (const dart::gui::osg::InteractiveFrame *frame)
 Frame update callback on moving the lower bound control. More...
 
void updateUUCB (const dart::gui::osg::InteractiveFrame *frame)
 Frame update callback on moving the upper bound control. More...
 
void updateMirror ()
 If synchronizing bounds, mirrors updates on other bound. More...
 
void syncTSR ()
 Updates the TSR to the specification. More...
 
void syncSpec ()
 Updates the specification to the GUI. More...
 
void syncGUI ()
 Updates the GUI to the specification. More...
 
void syncFrame ()
 Updates the display frames to the specification. More...
 

Interactive/Display Frames

dart::dynamics::SimpleFramePtr offset_
 Offset frame for bounds. More...
 
dart::dynamics::SimpleFramePtr shape_
 Display boundary shape frame. More...
 
dart::dynamics::SimpleFramePtr rbounds_ [3]
 Display rotation bounds. More...
 
Window::InteractiveReturn frame_
 Main interactive frame. More...
 
Window::InteractiveReturn ll_frame_
 Lower bound interactive frame. More...
 
Window::InteractiveReturn uu_frame_
 Upper bound interactive frame. More...
 
Eigen::Vector3d getVolume () const
 Get the volume for the bounds. More...
 
void updateShape ()
 Updates the displayed shape volume for the bounds. More...
 

Detailed Description

IMGUI widget to design TSRs.

Definition at line 417 of file gui.h.

Constructor & Destructor Documentation

◆ TSREditWidget()

TSREditWidget::TSREditWidget ( const std::string name = "TSR",
const TSR::Specification spec = {} 
)

Constructor.

Parameters
[in]nameName of TSR.
[in]specBase specification of the TSR

Definition at line 411 of file gui.cpp.

412  : name_(name), original_(spec), spec_(spec)
413 {
414 }
const TSR::Specification original_
Original specification provided to the window.
Definition: gui.h:510
TSR::Specification spec_
Current specification.
Definition: gui.h:511
const std::string name_
Name of this window.
Definition: gui.h:509

Member Function Documentation

◆ getSpecification()

const TSR::Specification & TSREditWidget::getSpecification ( ) const

Get current TSR specification.

Returns
The current TSR specification.

Definition at line 751 of file gui.cpp.

752 {
753  return spec_;
754 }

◆ getTSR()

const TSRPtr & TSREditWidget::getTSR ( ) const

Get the current TSR.

Returns
The current TSR.

Definition at line 756 of file gui.cpp.

757 {
758  return tsr_;
759 }
TSRPtr tsr_
Corresponding TSR.
Definition: gui.h:513

◆ getVolume()

Eigen::Vector3d TSREditWidget::getVolume ( ) const
private

Get the volume for the bounds.

Returns
The volume of bounds.

Definition at line 625 of file gui.cpp.

626 {
628 }
Eigen::Vector3d lower
Lower position tolerance.
Definition: tsr.h:92
struct robowflex::darts::TSR::Specification::@5 position
Position tolerances.
ROBOWFLEX_EIGEN Eigen::Vector3d upper
Upper position tolerance.
Definition: tsr.h:91

◆ initialize()

void TSREditWidget::initialize ( Window window)
overridevirtual

Initialization with window context.

Parameters
[in]windowGUI window.

Reimplemented from robowflex::darts::Widget.

Definition at line 416 of file gui.cpp.

417 {
418  auto world = window->world_;
419 
420  // Create main interactive marker.
421  Window::InteractiveOptions frame_opt;
422  frame_opt.name = "TSREditWidget-" + name_ + "-frame";
423  frame_opt.pose = spec_.pose;
425  frame_opt.parent = world->getRobot(spec_.base.structure)->getFrame(spec_.base.frame);
426  frame_opt.callback = [&](const dart::gui::osg::InteractiveFrame *frame) { updateFrameCB(frame); };
427  frame_ = window->createInteractiveMarker(frame_opt);
428 
429  // Create offset frame for bound frames.
430  offset_ = std::make_shared<dart::dynamics::SimpleFrame>(dart::dynamics::Frame::World(),
431  "TSREditWidget-" + name_ + "-offset");
432  world->getSim()->addSimpleFrame(offset_);
433 
434  // Create lower bound control.
436  ll_opt.name = "TSREditWidget-" + name_ + "-ll";
437  ll_opt.callback = [&](const dart::gui::osg::InteractiveFrame *frame) { updateLLCB(frame); };
438  ll_opt.parent = offset_.get();
439  ll_opt.rotation[0] = false;
440  ll_opt.rotation[1] = false;
441  ll_opt.rotation[2] = false;
442  ll_opt.planar[0] = false;
443  ll_opt.planar[1] = false;
444  ll_opt.planar[2] = false;
445  ll_opt.size = 0.1;
446  ll_opt.thickness = 2;
447  ll_frame_ = window->createInteractiveMarker(ll_opt);
448 
449  // Create upper bound control.
451  uu_opt.name = "TSREditWidget-" + name_ + "-uu";
452  uu_opt.callback = [&](const dart::gui::osg::InteractiveFrame *frame) { updateUUCB(frame); };
453  uu_opt.parent = offset_.get();
454  uu_opt.rotation[0] = false;
455  uu_opt.rotation[1] = false;
456  uu_opt.rotation[2] = false;
457  uu_opt.planar[0] = false;
458  uu_opt.planar[1] = false;
459  uu_opt.planar[2] = false;
460  uu_opt.size = 0.1;
461  uu_opt.thickness = 2;
462  uu_frame_ = window->createInteractiveMarker(uu_opt);
463 
464  // Create shape frame. Shape is separate since it can be offset from main bound TF.
465  shape_ =
466  std::make_shared<dart::dynamics::SimpleFrame>(offset_.get(), "TSREditWidget-" + name_ + "-shape");
467  world->getSim()->addSimpleFrame(shape_);
468 
469  // Create rotation bounds.
470  for (std::size_t i = 0; i < 3; ++i)
471  {
472  rbounds_[i] = std::make_shared<dart::dynamics::SimpleFrame>(
473  offset_.get(), "TSREditWidget-" + name_ + "-rb" + std::to_string(i));
474 
475  Eigen::Isometry3d tf = Eigen::Isometry3d::Identity();
476  if (i == 1)
477  tf.rotate(Eigen::AngleAxisd(-constants::half_pi, Eigen::Vector3d::UnitZ()));
478  else if (i == 2)
479  tf.rotate(Eigen::AngleAxisd(constants::half_pi, Eigen::Vector3d::UnitY()));
480 
481  rbounds_[i]->setRelativeTransform(tf);
482  world->getSim()->addSimpleFrame(rbounds_[i]);
483  }
484 
485  // Create TSR.
486  tsr_ = std::make_shared<darts::TSR>(world, spec_);
487  tsr_->initialize();
488 
489  // Synchronize elements.
490  syncGUI();
491  syncFrame();
492  updateShape();
493 }
void syncFrame()
Updates the display frames to the specification.
Definition: gui.cpp:495
void syncGUI()
Updates the GUI to the specification.
Definition: gui.cpp:528
dart::dynamics::SimpleFramePtr rbounds_[3]
Display rotation bounds.
Definition: gui.h:499
void updateUUCB(const dart::gui::osg::InteractiveFrame *frame)
Frame update callback on moving the upper bound control.
Definition: gui.cpp:586
Window::InteractiveReturn ll_frame_
Lower bound interactive frame.
Definition: gui.h:501
Window::InteractiveReturn frame_
Main interactive frame.
Definition: gui.h:500
void updateFrameCB(const dart::gui::osg::InteractiveFrame *frame)
Frame update callback on moving the main interactive frame.
Definition: gui.cpp:555
dart::dynamics::SimpleFramePtr shape_
Display boundary shape frame.
Definition: gui.h:498
void updateShape()
Updates the displayed shape volume for the bounds.
Definition: gui.cpp:630
void updateLLCB(const dart::gui::osg::InteractiveFrame *frame)
Frame update callback on moving the lower bound control.
Definition: gui.cpp:569
dart::dynamics::SimpleFramePtr offset_
Offset frame for bounds.
Definition: gui.h:497
Window::InteractiveReturn uu_frame_
Upper bound interactive frame.
Definition: gui.h:502
std::string structure
Structure target frame is in.
Definition: tsr.h:76
std::string frame
Name of target frame.
Definition: tsr.h:77
RobotPose pose
Pose of TSR.
Definition: tsr.h:86
struct robowflex::darts::TSR::Specification::@4 base
Base frame.
WorldPtr world_
World to visualize.
Definition: gui.h:206
InteractiveReturn createInteractiveMarker(const InteractiveOptions &options)
Create a new interactive marker in the GUI.
Definition: gui.cpp:113
static const double half_pi
Definition: constants.h:22
static const std::string ROOT_FRAME
Definition: tsr.h:31
Options for creating an interactive marker.
Definition: gui.h:88
std::string name
Name of marker.
Definition: gui.h:89
bool rotation[3]
Rotation ring controls enabled.
Definition: gui.h:98
Eigen::Isometry3d pose
Relative pose of marker.
Definition: gui.h:90
InteractiveCallback callback
Callback function on motion.
Definition: gui.h:91
double thickness
Thickness of marker arrows.
Definition: gui.h:94
bool planar[3]
Planar translation controls enabled.
Definition: gui.h:99
dart::dynamics::Frame * parent
Parent frame.
Definition: gui.h:92
T to_string(T... args)

◆ prerefresh()

void TSREditWidget::prerefresh ( )
overridevirtual

Called before window refresh.

Reimplemented from robowflex::darts::Widget.

Definition at line 746 of file gui.cpp.

747 {
748  updateShape();
749 }

◆ render()

void TSREditWidget::render ( )
override

Render GUI.

Definition at line 663 of file gui.cpp.

664 {
665  prev_ = spec_; // save previous spec
666 
667  // Draw main window.
668  ImGui::SetNextWindowBgAlpha(0.5f);
669  std::string title = "TSR Editor - " + name_;
670  if (!ImGui::Begin(title.c_str(), nullptr, ImGuiWindowFlags_HorizontalScrollbar))
671  {
672  ImGui::End();
673  return;
674  }
675 
676  // Draw frame position and orientation values.
677  if (ImGui::TreeNodeEx("Frame", ImGuiTreeNodeFlags_DefaultOpen))
678  {
679  ImGui::DragFloat3("Position", position_, drag_step_, -max_position_, max_position_, "%0.2f");
680  ImGui::DragFloat3("Rotation", rotation_, drag_step_, -constants::pi, constants::pi, "%0.2f");
681 
682  if (ImGui::Button("Reset Position"))
683  {
685  syncGUI();
686  }
687 
688  ImGui::SameLine();
689 
690  if (ImGui::Button("Reset Rotation"))
691  {
693  syncGUI();
694  }
695 
696  ImGui::TreePop();
697  }
698 
699  ImGui::Separator();
700  ImGui::Spacing();
701 
702  // Draw TSR bound interface.
703  if (ImGui::TreeNodeEx("Bounds", ImGuiTreeNodeFlags_DefaultOpen))
704  {
705  ImGui::Checkbox("Sync. Bounds", &sync_bounds_);
706  ImGui::Spacing();
707 
708  ImGui::Text("Position Bounds");
709  auto half = max_position_ / 2;
710  ImGui::DragFloat2("X##1", xp_, drag_step_, -half, half, "%0.4f");
711  ImGui::DragFloat2("Y##1", yp_, drag_step_, -half, half, "%0.4f");
712  ImGui::DragFloat2("Z##1", zp_, drag_step_, -half, half, "%0.4f");
713  ImGui::Checkbox("Show Volume", &show_volume_);
714  ImGui::Spacing();
715  ImGui::Spacing();
716 
717  ImGui::Text("Rotation Bounds");
718  ImGui::DragFloat2("X##2", xr_, drag_step_, -constants::pi, constants::pi, "%0.4f");
719  ImGui::DragFloat2("Y##2", yr_, drag_step_, -constants::pi, constants::pi, "%0.4f");
720  ImGui::DragFloat2("Z##2", zr_, drag_step_, -constants::pi, constants::pi, "%0.4f");
721 
722  ImGui::Checkbox("Show Rot. Bounds", &show_bounds_);
723  ImGui::DragFloat("Bound Rad.", &inner_radius, drag_step_, 0., 0.5, "%0.2f");
724 
725  if (ImGui::Button("Reset Bounds"))
726  {
729  prev_ = spec_;
730  syncGUI();
731  }
732 
733  ImGui::TreePop();
734  }
735 
736  if (ImGui::Button("Print TSR"))
738 
739  gui_ = true;
740  syncSpec();
741  syncGUI();
742  syncFrame();
743  gui_ = false;
744 }
T c_str(T... args)
float xr_[2]
GUI X orientation bounds.
Definition: gui.h:544
void syncSpec()
Updates the specification to the GUI.
Definition: gui.cpp:511
float yr_[2]
GUI Y orientation bounds.
Definition: gui.h:545
const float drag_step_
Slider drag amount.
Definition: gui.h:535
float yp_[2]
GUI Y position bounds.
Definition: gui.h:541
float zr_[2]
GUI Z orientation bounds.
Definition: gui.h:546
TSR::Specification prev_
Prior iteration specification.
Definition: gui.h:512
bool show_bounds_
Show TSR rotation bounds.
Definition: gui.h:523
bool gui_
True if a synchronize call is coming from the GUI update loop.
Definition: gui.h:481
float inner_radius
GUI Rotation bound inner radius.
Definition: gui.h:548
float zp_[2]
GUI Z position bounds.
Definition: gui.h:542
float xp_[2]
GUI X position bounds.
Definition: gui.h:540
float position_[3]
GUI frame position.
Definition: gui.h:537
float rotation_[3]
GUI frame rotation.
Definition: gui.h:538
bool sync_bounds_
Synchronize changes in volume on other bound.
Definition: gui.h:521
bool show_volume_
Show TSR volume.
Definition: gui.h:522
const float max_position_
Max position value.
Definition: gui.h:534
void setRotation(const Eigen::Quaterniond &orientation)
Set the rotation of the TSR.
Definition: tsr.cpp:74
Eigen::Quaterniond getRotation() const
Get the current desired orientation.
Definition: tsr.cpp:316
void print(std::ostream &out) const
Print out this TSR information.
Definition: tsr.cpp:425
struct robowflex::darts::TSR::Specification::@6 orientation
Orientation tolerances.
Eigen::Vector3d getPosition() const
Getters and Informative Methods.
Definition: tsr.cpp:311
void setPosition(const Eigen::Ref< const Eigen::Vector3d > &position)
Setting TSR Pose.
Definition: tsr.cpp:64
static const double half
Definition: constants.h:14
static const double pi
Definition: constants.h:21

◆ syncFrame()

void TSREditWidget::syncFrame ( )
private

Updates the display frames to the specification.

Definition at line 495 of file gui.cpp.

496 {
497  frame_.target->setRelativeTransform(spec_.pose);
498  offset_->setTranslation(frame_.target->getWorldTransform().translation());
499  ll_frame_.target->setRelativeTranslation(spec_.position.lower);
500  uu_frame_.target->setRelativeTranslation(spec_.position.upper);
501 }
dart::gui::osg::InteractiveFramePtr target
Interactive Frame generated.
Definition: gui.h:122

◆ syncGUI()

void TSREditWidget::syncGUI ( )
private

Updates the GUI to the specification.

Definition at line 528 of file gui.cpp.

529 {
530  auto pos = spec_.getPosition();
531  position_[0] = pos[0];
532  position_[1] = pos[1];
533  position_[2] = pos[2];
534 
535  auto rot = spec_.getEulerRotation();
536  rotation_[0] = rot[0];
537  rotation_[1] = rot[1];
538  rotation_[2] = rot[2];
539 
540  xp_[0] = spec_.position.lower[0];
541  xp_[1] = spec_.position.upper[0];
542  yp_[0] = spec_.position.lower[1];
543  yp_[1] = spec_.position.upper[1];
544  zp_[0] = spec_.position.lower[2];
545  zp_[1] = spec_.position.upper[2];
546 
547  xr_[0] = spec_.orientation.lower[0];
548  xr_[1] = spec_.orientation.upper[0];
549  yr_[0] = spec_.orientation.lower[1];
550  yr_[1] = spec_.orientation.upper[1];
551  zr_[0] = spec_.orientation.lower[2];
552  zr_[1] = spec_.orientation.upper[2];
553 }
Eigen::Vector3d getEulerRotation() const
Get the current desired orientation.
Definition: tsr.cpp:321

◆ syncSpec()

void TSREditWidget::syncSpec ( )
private

Updates the specification to the GUI.

Definition at line 511 of file gui.cpp.

512 {
515 
516  spec_.setXPosTolerance(xp_[0], xp_[1]);
517  spec_.setYPosTolerance(yp_[0], yp_[1]);
518  spec_.setZPosTolerance(zp_[0], zp_[1]);
519 
520  spec_.setXRotTolerance(xr_[0], xr_[1]);
521  spec_.setYRotTolerance(yr_[0], yr_[1]);
522  spec_.setZRotTolerance(zr_[0], zr_[1]);
523 
524  updateMirror();
525  syncTSR();
526 }
void syncTSR()
Updates the TSR to the specification.
Definition: gui.cpp:503
void updateMirror()
If synchronizing bounds, mirrors updates on other bound.
Definition: gui.cpp:603
void setZRotTolerance(double bound)
Set the Z orientation tolerance to (-bound, bound).
Definition: tsr.cpp:183
void setYPosTolerance(double bound)
Set the Y position tolerance to (-bound, bound).
Definition: tsr.cpp:133
void setYRotTolerance(double bound)
Set the Y orientation tolerance to (-bound, bound).
Definition: tsr.cpp:178
void setXPosTolerance(double bound)
Setting Position Tolerances.
Definition: tsr.cpp:128
void setZPosTolerance(double bound)
Set the Z position tolerance to (-bound, bound).
Definition: tsr.cpp:138
void setXRotTolerance(double bound)
Setting Orientation Tolerances.
Definition: tsr.cpp:173

◆ syncTSR()

void TSREditWidget::syncTSR ( )
private

Updates the TSR to the specification.

Definition at line 503 of file gui.cpp.

504 {
505  tsr_->getSpecification() = spec_;
506  tsr_->updatePose();
507  tsr_->updateBounds();
508  tsr_->updateSolver();
509 }

◆ updateFrameCB()

void TSREditWidget::updateFrameCB ( const dart::gui::osg::InteractiveFrame *  frame)
private

Frame update callback on moving the main interactive frame.

Parameters
[in]frameThe interactive frame.

Definition at line 555 of file gui.cpp.

556 {
557  if (gui_)
558  return;
559 
560  prev_ = spec_;
561  const auto &tf = frame->getRelativeTransform();
562  spec_.pose = tf;
563 
564  updateMirror();
565  syncGUI();
566  syncTSR();
567 }

◆ updateLLCB()

void TSREditWidget::updateLLCB ( const dart::gui::osg::InteractiveFrame *  frame)
private

Frame update callback on moving the lower bound control.

Parameters
[in]frameThe interactive frame.

Definition at line 569 of file gui.cpp.

570 {
571  if (gui_)
572  return;
573 
574  Eigen::Vector3d t = frame->getRelativeTransform().translation();
575  Eigen::Vector3d diff =
576  (sync_bounds_) ? Eigen::Vector3d(t - spec_.position.lower) : Eigen::Vector3d::Zero();
577 
578  spec_.setXPosTolerance(t[0], spec_.position.upper[0] - diff[0]);
579  spec_.setYPosTolerance(t[1], spec_.position.upper[1] - diff[1]);
580  spec_.setZPosTolerance(t[2], spec_.position.upper[2] - diff[2]);
581 
582  syncGUI();
583  syncTSR();
584 }

◆ updateMirror()

void TSREditWidget::updateMirror ( )
private

If synchronizing bounds, mirrors updates on other bound.

Definition at line 603 of file gui.cpp.

604 {
605  if (not sync_bounds_)
606  return;
607 
608  {
609  auto ld = spec_.position.lower - prev_.position.lower;
610  auto ud = spec_.position.upper - prev_.position.upper;
611 
612  spec_.position.lower -= ud;
613  spec_.position.upper -= ld;
614  }
615 
616  {
619 
620  spec_.orientation.lower -= ud;
621  spec_.orientation.upper -= ld;
622  }
623 }

◆ updateShape()

void TSREditWidget::updateShape ( )
private

Updates the displayed shape volume for the bounds.

Definition at line 630 of file gui.cpp.

631 {
632  // Position volume
633  {
634  Eigen::Vector3d abs = getVolume();
635 
636  shape_->setShape(makeBox(abs));
637  auto *va = shape_->getVisualAspect(true);
638  va->setColor(dart::Color::Gray(volume_alpha_));
639  va->setShadowed(false);
640  va->setHidden(not show_volume_);
641 
642  shape_->setRelativeTranslation(spec_.position.lower + abs / 2);
643  }
644 
645  // Rotation bounds
646  for (std::size_t i = 0; i < 3; ++i)
647  {
650  auto *va = rbounds_[i]->getVisualAspect(true);
651  va->setShadowed(false);
652  va->setHidden(not show_bounds_);
653 
654  if (i == 0)
655  va->setColor(dart::Color::Red(rotation_alpha_));
656  if (i == 1)
657  va->setColor(dart::Color::Green(rotation_alpha_));
658  if (i == 2)
659  va->setColor(dart::Color::Blue(rotation_alpha_));
660  }
661 }
Eigen::Vector3d getVolume() const
Get the volume for the bounds.
Definition: gui.cpp:625
const double volume_alpha_
Volume alpha.
Definition: gui.h:530
const double rotation_alpha_
Rotation bound alpha.
Definition: gui.h:531
const double rotation_width_
Rotation bound width.
Definition: gui.h:532
std::shared_ptr< dart::dynamics::MeshShape > makeArcsegment(double low, double high, double inner_radius, double outer_radius, std::size_t resolution=32)
Create a circle's arcsector from one angle to another, with a specified radius.
Definition: structure.cpp:419
std::shared_ptr< dart::dynamics::BoxShape > makeBox(const Eigen::Ref< const Eigen::Vector3d > &v)
Create a box.
Definition: structure.cpp:370

◆ updateUUCB()

void TSREditWidget::updateUUCB ( const dart::gui::osg::InteractiveFrame *  frame)
private

Frame update callback on moving the upper bound control.

Parameters
[in]frameThe interactive frame.

Definition at line 586 of file gui.cpp.

587 {
588  if (gui_)
589  return;
590 
591  Eigen::Vector3d t = frame->getRelativeTransform().translation();
592  Eigen::Vector3d diff =
593  (sync_bounds_) ? Eigen::Vector3d(t - spec_.position.upper) : Eigen::Vector3d::Zero();
594 
595  spec_.setXPosTolerance(spec_.position.lower[0] - diff[0], t[0]);
596  spec_.setYPosTolerance(spec_.position.lower[1] - diff[1], t[1]);
597  spec_.setZPosTolerance(spec_.position.lower[2] - diff[2], t[2]);
598 
599  syncGUI();
600  syncTSR();
601 }

Member Data Documentation

◆ drag_step_

const float robowflex::darts::TSREditWidget::drag_step_ {0.01f}
private

Slider drag amount.

Definition at line 535 of file gui.h.

◆ frame_

Window::InteractiveReturn robowflex::darts::TSREditWidget::frame_
private

Main interactive frame.

Definition at line 500 of file gui.h.

◆ gui_

bool robowflex::darts::TSREditWidget::gui_ {false}
private

True if a synchronize call is coming from the GUI update loop.

Definition at line 481 of file gui.h.

◆ inner_radius

float robowflex::darts::TSREditWidget::inner_radius {0.2}
private

GUI Rotation bound inner radius.

Definition at line 548 of file gui.h.

◆ ll_frame_

Window::InteractiveReturn robowflex::darts::TSREditWidget::ll_frame_
private

Lower bound interactive frame.

Definition at line 501 of file gui.h.

◆ max_position_

const float robowflex::darts::TSREditWidget::max_position_ {5.0f}
private

Max position value.

Definition at line 534 of file gui.h.

◆ mutex_

std::mutex robowflex::darts::TSREditWidget::mutex_
private

Solving mutex.

Definition at line 514 of file gui.h.

◆ name_

const std::string robowflex::darts::TSREditWidget::name_
private

Name of this window.

Definition at line 509 of file gui.h.

◆ offset_

dart::dynamics::SimpleFramePtr robowflex::darts::TSREditWidget::offset_
private

Offset frame for bounds.

Definition at line 497 of file gui.h.

◆ original_

const TSR::Specification robowflex::darts::TSREditWidget::original_
private

Original specification provided to the window.

Definition at line 510 of file gui.h.

◆ position_

float robowflex::darts::TSREditWidget::position_[3]
private

GUI frame position.

Definition at line 537 of file gui.h.

◆ prev_

TSR::Specification robowflex::darts::TSREditWidget::prev_
private

Prior iteration specification.

Definition at line 512 of file gui.h.

◆ rbounds_

dart::dynamics::SimpleFramePtr robowflex::darts::TSREditWidget::rbounds_[3]
private

Display rotation bounds.

Definition at line 499 of file gui.h.

◆ rotation_

float robowflex::darts::TSREditWidget::rotation_[3]
private

GUI frame rotation.

Definition at line 538 of file gui.h.

◆ rotation_alpha_

const double robowflex::darts::TSREditWidget::rotation_alpha_ {0.6}
private

Rotation bound alpha.

Definition at line 531 of file gui.h.

◆ rotation_width_

const double robowflex::darts::TSREditWidget::rotation_width_ {0.05}
private

Rotation bound width.

Definition at line 532 of file gui.h.

◆ shape_

dart::dynamics::SimpleFramePtr robowflex::darts::TSREditWidget::shape_
private

Display boundary shape frame.

Definition at line 498 of file gui.h.

◆ show_bounds_

bool robowflex::darts::TSREditWidget::show_bounds_ {true}
private

Show TSR rotation bounds.

Definition at line 523 of file gui.h.

◆ show_volume_

bool robowflex::darts::TSREditWidget::show_volume_ {true}
private

Show TSR volume.

Definition at line 522 of file gui.h.

◆ spec_

TSR::Specification robowflex::darts::TSREditWidget::spec_
private

Current specification.

Definition at line 511 of file gui.h.

◆ sync_bounds_

bool robowflex::darts::TSREditWidget::sync_bounds_ {true}
private

Synchronize changes in volume on other bound.

Definition at line 521 of file gui.h.

◆ tsr_

TSRPtr robowflex::darts::TSREditWidget::tsr_
private

Corresponding TSR.

Definition at line 513 of file gui.h.

◆ uu_frame_

Window::InteractiveReturn robowflex::darts::TSREditWidget::uu_frame_
private

Upper bound interactive frame.

Definition at line 502 of file gui.h.

◆ volume_alpha_

const double robowflex::darts::TSREditWidget::volume_alpha_ {0.2}
private

Volume alpha.

Definition at line 530 of file gui.h.

◆ xp_

float robowflex::darts::TSREditWidget::xp_[2]
private

GUI X position bounds.

Definition at line 540 of file gui.h.

◆ xr_

float robowflex::darts::TSREditWidget::xr_[2]
private

GUI X orientation bounds.

Definition at line 544 of file gui.h.

◆ yp_

float robowflex::darts::TSREditWidget::yp_[2]
private

GUI Y position bounds.

Definition at line 541 of file gui.h.

◆ yr_

float robowflex::darts::TSREditWidget::yr_[2]
private

GUI Y orientation bounds.

Definition at line 545 of file gui.h.

◆ zp_

float robowflex::darts::TSREditWidget::zp_[2]
private

GUI Z position bounds.

Definition at line 542 of file gui.h.

◆ zr_

float robowflex::darts::TSREditWidget::zr_[2]
private

GUI Z orientation bounds.

Definition at line 546 of file gui.h.


The documentation for this class was generated from the following files: