Commit 14e72d8e authored by Guilhem Saurel's avatar Guilhem Saurel

Merge tag 'v4.4.0'

Release of version 4.4.0.
parents 76f9e3a7 14161a20
Pipeline #3675 failed with stages
in 5 minutes and 59 seconds
...@@ -24,15 +24,16 @@ SET(CXX_DISABLE_WERROR TRUE) ...@@ -24,15 +24,16 @@ SET(CXX_DISABLE_WERROR TRUE)
INCLUDE(cmake/base.cmake) INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake) INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/python.cmake) INCLUDE(cmake/python.cmake)
INCLUDE(cmake/hpp.cmake)
# Tells pkg-config to read qtversion and cmake_plugin from pkg config file. # Tells pkg-config to read qtversion and cmake_plugin from pkg config file.
LIST(APPEND PKG_CONFIG_ADDITIONAL_VARIABLES qtversion cmake_plugin) LIST(APPEND PKG_CONFIG_ADDITIONAL_VARIABLES qtversion cmake_plugin)
SET(PROJECT_NAME "hpp-gui") SET(PROJECT_NAME "hpp-gui")
SET(PROJECT_URL "https://github.com/jmirabel/hpp-gui") SET(PROJECT_URL "https://github.com/humanoid-path-planner/hpp-gui")
SET(PROJECT_DESCRIPTION "Graphical interface for HPP ") SET(PROJECT_DESCRIPTION "Graphical interface for HPP ")
SETUP_PROJECT() SETUP_HPP_PROJECT()
ADD_REQUIRED_DEPENDENCY("gepetto-viewer-corba >= 1.3") ADD_REQUIRED_DEPENDENCY("gepetto-viewer-corba >= 1.3")
...@@ -96,4 +97,4 @@ ELSE () ...@@ -96,4 +97,4 @@ ELSE ()
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/gepetto-gui) DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/gepetto-gui)
ENDIF () ENDIF ()
SETUP_PROJECT_FINALIZE() SETUP_HPP_PROJECT_FINALIZE()
Subproject commit 37328d715825baa3bdd7860f8561c68a0a3ff76c Subproject commit ecaf20c28c8ce33de312fbd812f88037cf995b73
FILE_PATTERNS = *.hh FILE_PATTERNS = *.hh *.py
INPUT = @CMAKE_SOURCE_DIR@/plugins/hppcorbaserverplugin \ INPUT = @CMAKE_SOURCE_DIR@/pyplugins \
@CMAKE_SOURCE_DIR@/plugins/hppcorbaserverplugin \
@CMAKE_SOURCE_DIR@/plugins/hppwidgetsplugin \ @CMAKE_SOURCE_DIR@/plugins/hppwidgetsplugin \
@CMAKE_SOURCE_DIR@/plugins/hppmanipulationwidgetsplugin \ @CMAKE_SOURCE_DIR@/plugins/hppmanipulationwidgetsplugin \
TAGFILES = @HPP_CORBASERVER_DOXYGENDOCDIR@/hpp-core.doxytag=@HPP_CORE_DOXYGENDOCDIR@ \
@HPP_MANIPULATION_CORBA_DOXYGENDOCDIR@/hpp-manipulation-corba=@HPP_MANIPULATION_CORBA_DOXYGENDOCDIR@
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "hppmanipulationwidgetsplugin/hppmanipulationwidgetsplugin.hh" #include "hppmanipulationwidgetsplugin/hppmanipulationwidgetsplugin.hh"
#include <sstream>
#include <QAction> #include <QAction>
#include <QDockWidget> #include <QDockWidget>
#include <QLayout> #include <QLayout>
......
...@@ -235,6 +235,20 @@ namespace hpp { ...@@ -235,6 +235,20 @@ namespace hpp {
return &config_; return &config_;
} }
void HppWidgetsPlugin::setCurrentQtConfig (const QVector<double>& q)
{
config_ .length (q.size());
for (ULong i = 0; i < config_.length(); ++i) config_[i] = q[i];
MainWindow::instance()->requestApplyCurrentConfiguration();
}
QVector<double> HppWidgetsPlugin::getCurrentQtConfig () const
{
QVector<double> c (config_.length());
for (ULong i = 0; i < config_.length(); ++i) c[i] = config_[i];
return c;
}
bool HppWidgetsPlugin::corbaException(int jobId, const CORBA::Exception &excep) const bool HppWidgetsPlugin::corbaException(int jobId, const CORBA::Exception &excep) const
{ {
try { try {
......
...@@ -134,6 +134,10 @@ signals: ...@@ -134,6 +134,10 @@ signals:
hpp::floatSeq const* getCurrentConfig () const; hpp::floatSeq const* getCurrentConfig () const;
void setCurrentQtConfig (const QVector<double>& q);
QVector<double> getCurrentQtConfig () const;
/// Set internal configuration from HPP current config. /// Set internal configuration from HPP current config.
void fetchConfiguration (); void fetchConfiguration ();
......
...@@ -267,11 +267,8 @@ namespace hpp { ...@@ -267,11 +267,8 @@ namespace hpp {
switch (type) { switch (type) {
case JointTreeItem::SkipType: case JointTreeItem::SkipType:
return; return;
case JointTreeItem::IntegratorType:{ case JointTreeItem::IntegratorType:
hpp::floatSeq_var q = plugin_->client()->robot()->getJointConfig (ji->name().c_str()); return;
ji->updateConfig(q.in());
return;
}
case JointTreeItem::BoundedValueType: { case JointTreeItem::BoundedValueType: {
SliderBoundedJoint* slider = static_cast <SliderBoundedJoint*> (editor); SliderBoundedJoint* slider = static_cast <SliderBoundedJoint*> (editor);
q = slider->getValue(); q = slider->getValue();
...@@ -288,11 +285,12 @@ namespace hpp { ...@@ -288,11 +285,12 @@ namespace hpp {
} }
model->setData(index, q, Qt::EditRole); model->setData(index, q, Qt::EditRole);
assert (ji); assert (ji);
ULong idxCfg = (ULong)index.data(JointTreeItem::IndexRole).toInt();
switch (type) { switch (type) {
case JointTreeItem::BoundedValueType: case JointTreeItem::BoundedValueType:
return; return;
case JointTreeItem::UnboundedValueType: case JointTreeItem::UnboundedValueType:
plugin_->client()->robot()->setJointConfig (ji->name().c_str(), ji->config()); plugin_->currentConfig()[ji->rankInConfig()+idxCfg] = q;
break; break;
case JointTreeItem::BoundType: case JointTreeItem::BoundType:
plugin_->client()->robot()->setJointBounds (ji->name().c_str(), ji->bounds()); plugin_->client()->robot()->setJointBounds (ji->name().c_str(), ji->bounds());
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "hppwidgetsplugin/pathplayer.hh" #include "hppwidgetsplugin/pathplayer.hh"
#include <sstream>
#include <QProgressDialog> #include <QProgressDialog>
#include <QSlider> #include <QSlider>
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0)) #if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
......
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
<height>64</height> <height>64</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Path player</string> <string>Path player</string>
</property> </property>
......
...@@ -96,7 +96,7 @@ namespace hpp { ...@@ -96,7 +96,7 @@ namespace hpp {
vecDouble[i + 1] = ui->secondYPosition->value(); vecDouble[i + 1] = ui->secondYPosition->value();
vecDouble[i + 2] = ui->secondZPosition->value(); vecDouble[i + 2] = ui->secondZPosition->value();
} }
emit finished(std::make_pair<QVector<double>, QVector<bool> >(vecDouble, vecBool)); emit finished(std::make_pair (vecDouble, vecBool));
this->deleteLater(); this->deleteLater();
this->close(); this->close();
} }
......
...@@ -30,3 +30,6 @@ INSTALL( ...@@ -30,3 +30,6 @@ INSTALL(
${CMAKE_CURRENT_SOURCE_DIR}/hpp/gui/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/hpp/gui/__init__.py
DESTINATION ${PYTHON_SITELIB}/hpp/gui DESTINATION ${PYTHON_SITELIB}/hpp/gui
) )
GEPETTO_GUI_PYPLUGIN(hpp/gui/plugin.py)
GEPETTO_GUI_PYPLUGIN(hpp/gui/dynamicbuild.py)
# GEPETTO_GUI_PYPLUGIN(hpp/gui/graphutility.py)
# This file is only necessary for generating the documentation
# of Python code in hpp.gui package. This __init__ file
# makes Doxygen understand hpp is a package.
...@@ -17,14 +17,22 @@ class DirectPathBox(QtGui.QGroupBox): ...@@ -17,14 +17,22 @@ class DirectPathBox(QtGui.QGroupBox):
def shootRandom(self): def shootRandom(self):
q = self.plugin.client.robot.shootRandomConfig() q = self.plugin.client.robot.shootRandomConfig()
self.plugin.client.robot.setCurrentConfig(q) self.plugin.hppPlugin.setCurrentQtConfig(q)
self.plugin.main.requestApplyCurrentConfiguration()
def applyConstraints (self):
q0 = self.plugin.hppPlugin.getCurrentQtConfig()
res, q1, err = self.plugin.client.problem.applyConstraints (q0)
self.plugin.hppPlugin.setCurrentQtConfig(q1)
if not res:
self.plugin.main.logError ("Projection failed: " + str(err))
else:
self.plugin.main.logError ("Projection succeeded.")
def getFrom (self): def getFrom (self):
self.fromCfg = self.plugin.client.robot.getCurrentConfig() self.fromCfg = self.plugin.hppPlugin.getCurrentQtConfig()
def getTo (self): def getTo (self):
self.toCfg = self.plugin.client.robot.getCurrentConfig() self.toCfg = self.plugin.hppPlugin.getCurrentQtConfig()
def makePath (self): def makePath (self):
n = self.plugin.client.robot.getConfigSize() n = self.plugin.client.robot.getConfigSize()
...@@ -47,6 +55,8 @@ class DirectPathBox(QtGui.QGroupBox): ...@@ -47,6 +55,8 @@ class DirectPathBox(QtGui.QGroupBox):
box = QtGui.QVBoxLayout(self) box = QtGui.QVBoxLayout(self)
random = QtGui.QPushButton(self) random = QtGui.QPushButton(self)
box.addWidget(random) box.addWidget(random)
applyConstraints = QtGui.QPushButton(self)
box.addWidget(applyConstraints)
setFrom = QtGui.QPushButton(self) setFrom = QtGui.QPushButton(self)
box.addWidget(setFrom) box.addWidget(setFrom)
setTo = QtGui.QPushButton(self) setTo = QtGui.QPushButton(self)
...@@ -58,12 +68,14 @@ class DirectPathBox(QtGui.QGroupBox): ...@@ -58,12 +68,14 @@ class DirectPathBox(QtGui.QGroupBox):
makePath = QtGui.QPushButton(self) makePath = QtGui.QPushButton(self)
box.addWidget(makePath) box.addWidget(makePath)
random.text = "Shoot random config" random.text = "Shoot random config"
applyConstraints.text = "Apply constraints"
setFrom.text = 'Save config as origin' setFrom.text = 'Save config as origin'
setTo.text = 'Save config as destination' setTo.text = 'Save config as destination'
self.validatePath.text = 'Validate path' self.validatePath.text = 'Validate path'
self.projectPath.text = "Project path" self.projectPath.text = "Project path"
makePath.text = 'Create path' makePath.text = 'Create path'
random.connect('clicked()', self.shootRandom) random.connect('clicked()', self.shootRandom)
applyConstraints.connect('clicked()', self.applyConstraints)
setFrom.connect('clicked()', self.getFrom) setFrom.connect('clicked()', self.getFrom)
setTo.connect('clicked()', self.getTo) setTo.connect('clicked()', self.getTo)
makePath.connect('clicked()', self.makePath) makePath.connect('clicked()', self.makePath)
...@@ -204,7 +204,7 @@ class _GraspMode(QWidget): ...@@ -204,7 +204,7 @@ class _GraspMode(QWidget):
def graspCurrent(self): def graspCurrent(self):
if (len(self.handles) > 0 and len(self.grippers) > 0): if (len(self.handles) > 0 and len(self.grippers) > 0):
self.grasp(self.parentInstance.plugin.client.basic.robot.getCurrentConfig()) self.grasp(self.parentInstance.plugin.hppPlugin.getCurrentQtConfig())
def graspRandom(self): def graspRandom(self):
if (len(self.handles) > 0 and len(self.grippers) > 0): if (len(self.handles) > 0 and len(self.grippers) > 0):
...@@ -224,12 +224,11 @@ class _GraspMode(QWidget): ...@@ -224,12 +224,11 @@ class _GraspMode(QWidget):
self.parentInstance.plugin.client.basic.problem.addNumericalConstraints("constraints", [name,], [0,]) self.parentInstance.plugin.client.basic.problem.addNumericalConstraints("constraints", [name,], [0,])
res = self.parentInstance.plugin.client.basic.problem.applyConstraints(config) res = self.parentInstance.plugin.client.basic.problem.applyConstraints(config)
if res[0] == True: if res[0] == True:
self.parentInstance.plugin.client.basic.robot.setCurrentConfig(res[1]) self.parentInstance.plugin.hppPlugin.setCurrentQtConfig(res[1])
self.mainWindow.requestApplyCurrentConfiguration()
def pregraspCurrent(self): def pregraspCurrent(self):
if (len(self.handles) > 0 and len(self.grippers) > 0): if (len(self.handles) > 0 and len(self.grippers) > 0):
self.pregrasp(self.parentInstance.plugin.client.basic.robot.getCurrentConfig()) self.pregrasp(self.parentInstance.plugin.hppPlugin.getCurrentQtConfig())
def pregraspRandom(self): def pregraspRandom(self):
if (len(self.handles) > 0 and len(self.grippers) > 0): if (len(self.handles) > 0 and len(self.grippers) > 0):
...@@ -242,10 +241,9 @@ class _GraspMode(QWidget): ...@@ -242,10 +241,9 @@ class _GraspMode(QWidget):
name = self.grippers[self.currentGripper] + " pregrasps " + self.handles[self.currentHandle] name = self.grippers[self.currentGripper] + " pregrasps " + self.handles[self.currentHandle]
self.parentInstance.plugin.client.manipulation.problem.createGrasp(name, self.grippers[self.currentGripper], self.handles[self.currentHandle]) self.parentInstance.plugin.client.manipulation.problem.createGrasp(name, self.grippers[self.currentGripper], self.handles[self.currentHandle])
self.parentInstance.plugin.client.basic.problem.addNumericalConstraints("constraints", [name], [True]) self.parentInstance.plugin.client.basic.problem.addNumericalConstraints("constraints", [name], [True])
res = self.parentInstance.plugin.client.basic.problem.applyConstraints(self.parentInstance.plugin.client.basic.robot.getCurrentConfig()) res = self.parentInstance.plugin.client.basic.problem.applyConstraints(self.parentInstance.plugin.hppPlugin.getCurrentQtConfig())
if (res[0] == True): if (res[0] == True):
self.parentInstance.plugin.client.basic.robot.setCurrentConfig(res[1]) self.parentInstance.plugin.hppPlugin.setCurrentQtConfig(res[1])
self.mainWindow.requestApplyCurrentConfiguration()
def lock(self): def lock(self):
if (self.selected != ""): if (self.selected != ""):
...@@ -314,10 +312,9 @@ class _PlacementMode(QWidget): ...@@ -314,10 +312,9 @@ class _PlacementMode(QWidget):
[self.surfaceName], [self.carryName]) [self.surfaceName], [self.carryName])
self.parent().plugin.client.basic.problem.addNumericalConstraints("numerical", ["placement"], [True]) self.parent().plugin.client.basic.problem.addNumericalConstraints("numerical", ["placement"], [True])
res = self.parent().plugin.client.basic.problem.applyConstraints(self.parent().plugin.client.basic.robot.getCurrentConfig()) res = self.parent().plugin.client.basic.problem.applyConstraints(self.parent().plugin.hppPlugin.getCurrentQtConfig())
if res[0]: if res[0]:
self.parent().plugin.client.basic.robot.setCurrentConfig(res[1]) self.parent().plugin.hppPlugin.setCurrentQtConfig(res[1])
self.parent().mainWindow.requestApplyCurrentConfiguration()
def createWidget(self): def createWidget(self):
box = QVBoxLayout(self) box = QVBoxLayout(self)
...@@ -379,6 +376,7 @@ class Plugin(QDockWidget): ...@@ -379,6 +376,7 @@ class Plugin(QDockWidget):
self.setObjectName ("hpp.gui.dynamicbuild") self.setObjectName ("hpp.gui.dynamicbuild")
self.osg = None self.osg = None
self.mainWindow = mainWindow self.mainWindow = mainWindow
self.hppPlugin = mainWindow.getFromSlot("getHppIIOPurl")
self.resetConnection() self.resetConnection()
mainWindow.registerShortcut("Dynamic builder", "Toggle view", self.toggleViewAction()) mainWindow.registerShortcut("Dynamic builder", "Toggle view", self.toggleViewAction())
self.dynamicBuilder = _DynamicBuilder(mainWindow, self) self.dynamicBuilder = _DynamicBuilder(mainWindow, self)
......
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