Skip to content
Snippets Groups Projects
Commit d7b1c8b3 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge remote-tracking branch 'origin/master' into armem/dev

# Conflicts:
#	source/RobotAPI/libraries/armem/core/base/EntityBase.h
parents ba610367 78a958b5
No related branches found
No related tags found
1 merge request!188ArMem Updates
Showing
with 43 additions and 295 deletions
#pragma once #pragma once
#include <RobotAPI/interface/ArViz/Elements.h>
#include <SimoxUtility/EigenStdVector.h>
#include <SimoxUtility/math/normal/normal_to_mat4.h>
#include <SimoxUtility/math/convert/rpy_to_mat3f.h>
#include <SimoxUtility/math/pose/transform.h>
#include <SimoxUtility/shapes/OrientedBoxBase.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <string>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include "Color.h" #include "Color.h"
#include "elements/ElementOps.h" #include "elements/ElementOps.h"
...@@ -22,6 +12,22 @@ ...@@ -22,6 +12,22 @@
#include "elements/Robot.h" #include "elements/Robot.h"
//#include "elements/RobotHand.h" // Not included by default (exposes additional headers). //#include "elements/RobotHand.h" // Not included by default (exposes additional headers).
#include <RobotAPI/interface/ArViz/Elements.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <SimoxUtility/EigenStdVector.h>
#include <SimoxUtility/math/normal/normal_to_mat4.h>
#include <SimoxUtility/math/convert/rpy_to_mat3f.h>
#include <SimoxUtility/math/pose/transform.h>
#include <SimoxUtility/shapes/OrientedBoxBase.h>
#include <Eigen/Geometry>
#include <Eigen/Core>
#include <ctime>
#include <string>
// The has_member macro causes compile errors if *any* other header uses // The has_member macro causes compile errors if *any* other header uses
// the identifier has_member. Boost.Thread does, so this causes compile // the identifier has_member. Boost.Thread does, so this causes compile
// errors down the line. // errors down the line.
...@@ -118,7 +124,7 @@ namespace armarx::viz ...@@ -118,7 +124,7 @@ namespace armarx::viz
template<class T> template<class T>
Box( Box(
const simox::OrientedBoxBase<T>& b, const simox::OrientedBoxBase<T>& b,
const std::string& name = std::to_string(std::chrono::high_resolution_clock::now().time_since_epoch().count()) const std::string& name = std::to_string(std::time(0))
) )
: Box(name, b) : Box(name, b)
{} {}
......
...@@ -119,12 +119,15 @@ namespace armarx::viz ...@@ -119,12 +119,15 @@ namespace armarx::viz
return; return;
} }
state = CoinVisualizerState::STOPPED;
/*
state = CoinVisualizerState::STOPPING; state = CoinVisualizerState::STOPPING;
while (state != CoinVisualizerState::STOPPED) while (state != CoinVisualizerState::STOPPED)
{ {
QCoreApplication::processEvents(); QCoreApplication::processEvents();
usleep(1000); usleep(1000);
} }
*/
} }
CoinVisualizer_ApplyTiming CoinVisualizer::apply(data::LayerUpdate const& update) CoinVisualizer_ApplyTiming CoinVisualizer::apply(data::LayerUpdate const& update)
......
set(LIB_NAME RobotAPIUnitListenerRelays) #set(LIB_NAME RobotAPIUnitListenerRelays)
armarx_set_target("RobotAPI Unit Listener Relays Library: ${LIB_NAME}") #armarx_set_target("RobotAPI Unit Listener Relays Library: ${LIB_NAME}")
set(LIBS ArmarXCore RobotAPIInterfaces) #set(LIBS ArmarXCore RobotAPIInterfaces)
set(LIB_HEADERS #set(LIB_HEADERS
KinematicUnitListenerRelay.h # KinematicUnitListenerRelay.h
InertialMeasurementUnitListenerRelay.h # InertialMeasurementUnitListenerRelay.h
ForceTorqueUnitListenerRelay.h # ForceTorqueUnitListenerRelay.h
RobotStateListenerRelay.h # RobotStateListenerRelay.h
) #)
set(LIB_FILES syntaxcheck.cpp) #set(LIB_FILES syntaxcheck.cpp)
armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}") #armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package VisionX::ArmarXObjects::ForceTorqueUnitListenerRelay
* @author Raphael Grimm ( raphael dot grimm at kit dot edu )
* @date 2016
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/util/noop.h>
#include <RobotAPI/interface/units/ForceTorqueUnit.h>
namespace armarx
{
class ForceTorqueUnitListenerRelay :
virtual public ManagedIceObject,
virtual public ForceTorqueUnitListener
{
public:
using CallbackFunctionSensorValues = std::function<void(const std::string&, const FramedDirectionBasePtr&, const FramedDirectionBasePtr&)>;
// ForceTorqueUnitListener interface
void reportSensorValues(const std::string& sensorNodeName, const FramedDirectionBasePtr& forces, const FramedDirectionBasePtr& torques, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportSensorValues(sensorNodeName, forces, torques);
}
protected:
// ManagedIceObject interface
void onInitComponent() override
{
usingTopic(topicName);
}
void onConnectComponent() override {}
std::string getDefaultName() const override
{
return "ForceTorqueUnitListenerRelay";
}
public:
std::string topicName;
CallbackFunctionSensorValues callbackReportSensorValues {noop<const std::string&, const FramedDirectionBasePtr&, const FramedDirectionBasePtr&>};
};
using ForceTorqueUnitListenerRelayPtr = IceInternal::Handle<ForceTorqueUnitListenerRelay>;
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package VisionX::ArmarXObjects::InertialMeasurementUnitListenerRelay
* @author Raphael Grimm ( raphael dot grimm at kit dot edu )
* @date 2016
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/util/noop.h>
#include <RobotAPI/interface/units/InertialMeasurementUnit.h>
namespace armarx
{
class InertialMeasurementUnitListenerRelay :
virtual public ManagedIceObject,
virtual public InertialMeasurementUnitListener
{
public:
using CallbackFunctionSensorValues = std::function<void(const std::string&, const std::string&, const IMUData&, const TimestampBasePtr&)>;
// InertialMeasurementUnitListener interface
void reportSensorValues(const std::string& device, const std::string& name, const IMUData& values, const TimestampBasePtr& timestamp, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportSensorValues(device, name, values, timestamp);
}
protected:
// ManagedIceObject interface
void onInitComponent() override
{
usingTopic(topicName);
}
void onConnectComponent() override {}
std::string getDefaultName() const override
{
return "InertialMeasurementUnitListenerRelay";
}
public:
std::string topicName;
CallbackFunctionSensorValues callbackReportSensorValues {noop<const std::string&, const std::string&, const IMUData&, const TimestampBasePtr&>};
};
using InertialMeasurementUnitListenerRelayPtr = IceInternal::Handle<InertialMeasurementUnitListenerRelay>;
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package VisionX::ArmarXObjects::KinematicUnitListenerRelay
* @author Raphael Grimm ( raphael dot grimm at kit dot edu )
* @date 2016
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/util/noop.h>
#include <RobotAPI/interface/units/KinematicUnitInterface.h>
namespace armarx
{
class KinematicUnitListenerRelay :
virtual public ManagedIceObject,
virtual public KinematicUnitListener
{
public:
using CallbackFunctionModes = std::function<void(const NameControlModeMap&, Ice::Long, bool)>;
using CallbackFunctionState = std::function<void(const NameStatusMap&, Ice::Long, bool)>;
using CallbackFunctionValue = std::function<void(const NameValueMap&, Ice::Long, bool)>;
// KinematicUnitListener interface
void reportControlModeChanged(const NameControlModeMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportControlModeChanged(map, time, changes);
}
void reportJointAngles(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointAngles(map, time, changes);
}
void reportJointVelocities(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointVelocities(map, time, changes);
}
void reportJointTorques(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointTorques(map, time, changes);
}
void reportJointAccelerations(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointAccelerations(map, time, changes);
}
void reportJointCurrents(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointCurrents(map, time, changes);
}
void reportJointMotorTemperatures(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointMotorTemperatures(map, time, changes);
}
void reportJointStatuses(const NameStatusMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent) override
{
callbackReportJointStatuses(map, time, changes);
}
protected:
// ManagedIceObject interface
void onInitComponent() override
{
usingTopic(topicName);
}
void onConnectComponent() override {}
std::string getDefaultName() const override
{
return "KinematicUnitListenerRelay";
}
public:
std::string topicName;
CallbackFunctionModes callbackReportControlModeChanged {noop<const NameControlModeMap&, Ice::Long, bool>};
CallbackFunctionValue callbackReportJointAngles {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionValue callbackReportJointVelocities {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionValue callbackReportJointTorques {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionValue callbackReportJointAccelerations {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionValue callbackReportJointCurrents {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionValue callbackReportJointMotorTemperatures {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionState callbackReportJointStatuses {noop<const NameStatusMap&, Ice::Long, bool>};
};
using KinematicUnitListenerRelayPtr = IceInternal::Handle<KinematicUnitListenerRelay>;
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package VisionX::ArmarXObjects::KinematicUnitListenerRelay
* @author Raphael Grimm ( raphael dot grimm at kit dot edu )
* @date 2016
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/util/noop.h>
#include <RobotAPI/interface/core/RobotState.h>
namespace armarx
{
class RobotStateListenerRelay :
virtual public ManagedIceObject,
virtual public RobotStateListenerInterface
{
public:
using CallbackFunctionValue = std::function<void(const NameValueMap&, Ice::Long, bool)>;
using CallbackFunctionPose = std::function<void(const FramedPoseBasePtr&, Ice::Long, bool)>;
virtual void reportJointValues(const NameValueMap& map, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent)
{
callbackReportJointValues(map, time, changes);
}
void reportGlobalRobotRootPose(const FramedPoseBasePtr& pose, Ice::Long time, bool changes, const Ice::Current& = Ice::emptyCurrent)
{
callbackReportGlobalRobotRootPose(pose, time, changes);
}
protected:
// ManagedIceObject interface
virtual void onInitComponent()
{
usingTopic(topicName);
}
virtual void onConnectComponent() {}
virtual std::string getDefaultName() const
{
return "RobotStateListener";
}
public:
std::string topicName;
CallbackFunctionValue callbackReportJointValues {noop<const NameValueMap&, Ice::Long, bool>};
CallbackFunctionPose callbackReportGlobalRobotRootPose {noop<const FramedPoseBasePtr&, Ice::Long, bool>};
};
using RobotStateListenerRelayPtr = IceInternal::Handle<RobotStateListenerRelay>;
}
#include "KinematicUnitListenerRelay.h"
#include "InertialMeasurementUnitListenerRelay.h"
#include "ForceTorqueUnitListenerRelay.h"
...@@ -176,8 +176,6 @@ namespace armarx ...@@ -176,8 +176,6 @@ namespace armarx
void ArVizWidgetController::onDisconnectComponent() void ArVizWidgetController::onDisconnectComponent()
{ {
visualizer.stop();
// Changes to UI elements are only allowed in the GUI thread // Changes to UI elements are only allowed in the GUI thread
emit disconnectGui(); emit disconnectGui();
} }
...@@ -195,6 +193,7 @@ namespace armarx ...@@ -195,6 +193,7 @@ namespace armarx
void ArVizWidgetController::onDisconnectGui() void ArVizWidgetController::onDisconnectGui()
{ {
timingObserverTimer->stop(); timingObserverTimer->stop();
visualizer.stop();
changeMode(ArVizWidgetMode::NotConnected); changeMode(ArVizWidgetMode::NotConnected);
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "NJointControllerClassesWidget.h" #include "NJointControllerClassesWidget.h"
#include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> #include <ArmarXCore/core/system/cmake/CMakePackageFinder.h>
#include <ArmarXCore/core/util/StringHelpers.h> #include <ArmarXCore/core/util/StringHelpers.h>
#include <ArmarXCore/core/logging/Logging.h>
#include <QGridLayout> #include <QGridLayout>
#include <QDir> #include <QDir>
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include "NJointControllersWidget.h" #include "NJointControllersWidget.h"
#include "StyleSheets.h" #include "StyleSheets.h"
#include <ArmarXCore/core/logging/Logging.h>
namespace armarx namespace armarx
{ {
NJointControllersWidget::NJointControllersWidget(QWidget* parent) : NJointControllersWidget::NJointControllersWidget(QWidget* parent) :
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include "SlaveIdentifier.h" #include "SlaveIdentifier.h"
#include <ArmarXCore/core/logging/Logging.h>
using namespace armarx; using namespace armarx;
SlaveIdentifier::SlaveIdentifier(const RapidXmlReaderNode& node) SlaveIdentifier::SlaveIdentifier(const RapidXmlReaderNode& node)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <SimoxUtility/shapes/OrientedBox.h> #include <SimoxUtility/shapes/OrientedBox.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h> #include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <ArmarXCore/core/logging/Logging.h>
namespace armarx namespace armarx
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#include <RobotAPI/libraries/armem_robot/aron_conversions.h> #include <RobotAPI/libraries/armem_robot/aron_conversions.h>
#include <ArmarXCore/core/logging/Logging.h>
namespace armarx::armem::articulated_object namespace armarx::armem::articulated_object
{ {
std::optional<robot::RobotDescription> std::optional<robot::RobotDescription>
...@@ -31,4 +33,4 @@ namespace armarx::armem::articulated_object ...@@ -31,4 +33,4 @@ namespace armarx::armem::articulated_object
return robotDescription; return robotDescription;
} }
} // namespace armarx::armem::articulated_object } // namespace armarx::armem::articulated_object
\ No newline at end of file
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <RobotAPI/libraries/armem_robot/aron/RobotDescription.aron.generated.h> #include <RobotAPI/libraries/armem_robot/aron/RobotDescription.aron.generated.h>
#include <RobotAPI/libraries/armem_robot/aron_conversions.h> #include <RobotAPI/libraries/armem_robot/aron_conversions.h>
#include <ArmarXCore/core/logging/Logging.h>
namespace fs = ::std::filesystem; namespace fs = ::std::filesystem;
......
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