Commit 0bc1e7b3 authored by Joseph Mirabel's avatar Joseph Mirabel

Update usage of actions to fetch and send current configuration.

parent 0ebf366b
...@@ -154,6 +154,12 @@ namespace hpp { ...@@ -154,6 +154,12 @@ namespace hpp {
main->registerSlot("setCurrentConfig", this); main->registerSlot("setCurrentConfig", this);
main->registerSlot("getSelectedJoint", jointTreeWidget_); main->registerSlot("getSelectedJoint", jointTreeWidget_);
main->registerSignal(SIGNAL(appliedConfigAtParam(int,double)), pathPlayer_); main->registerSignal(SIGNAL(appliedConfigAtParam(int,double)), pathPlayer_);
QAction* action = main->findChild<QAction*>("actionFetch_configuration");
if (action != NULL) connect (action, SIGNAL(triggered()), SLOT(fetchConfiguration()));
else qDebug () << "Action actionFetch_configuration not found";
action = main->findChild<QAction*>("actionSend_configuration");
if (action != NULL) connect (action, SIGNAL(triggered()), SLOT(sendConfiguration()));
else qDebug () << "Action actionSend_configuration not found";
ActionSearchBar* asb = main->actionSearchBar(); ActionSearchBar* asb = main->actionSearchBar();
JointAction* a; JointAction* a;
...@@ -210,7 +216,12 @@ namespace hpp { ...@@ -210,7 +216,12 @@ namespace hpp {
void HppWidgetsPlugin::fetchConfiguration () void HppWidgetsPlugin::fetchConfiguration ()
{ {
hpp::floatSeq_var c = client()->robot ()->getCurrentConfig (); hpp::floatSeq_var c = client()->robot ()->getCurrentConfig ();
config_ = c.in(); setCurrentConfig (c.in());
}
void HppWidgetsPlugin::sendConfiguration ()
{
client()->robot ()->setCurrentConfig (config_);
} }
void HppWidgetsPlugin::setCurrentConfig (const hpp::floatSeq& q) void HppWidgetsPlugin::setCurrentConfig (const hpp::floatSeq& q)
......
...@@ -109,8 +109,6 @@ namespace hpp { ...@@ -109,8 +109,6 @@ namespace hpp {
return velocity_; return velocity_;
} }
void fetchConfiguration ();
signals: signals:
void configurationValidationStatus (bool valid); void configurationValidationStatus (bool valid);
void configurationValidationStatus (QStringList collision); void configurationValidationStatus (QStringList collision);
...@@ -136,6 +134,12 @@ signals: ...@@ -136,6 +134,12 @@ signals:
hpp::floatSeq const* getCurrentConfig () const; hpp::floatSeq const* getCurrentConfig () const;
/// Set internal configuration from HPP current config.
void fetchConfiguration ();
/// Set HPP configuration to internal current configuration
void sendConfiguration ();
/// Build a list of bodies in collision. /// Build a list of bodies in collision.
void configurationValidation (); void configurationValidation ();
......
Markdown is supported
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