Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • sw/armarx/robot-api
  • uwkce_singer/robot-api
  • untcg_hofmann/robot-api
  • ulqba_korosakov/RobotAPI
4 results
Show changes
Showing
with 724 additions and 187 deletions
......@@ -284,7 +284,9 @@ module armarx
void deactivateAndDeleteNJointControllers(Ice::StringSeq controllerInstanceNames)throws InvalidArgumentException, LogicError;
//loading libs
["deprecate:loadLibFromPath(string path) has dangerous implications on the RT thread. Use the scenario config instead to load additional libraries. See https://git.h2t.iar.kit.edu/sw/armarx-integration/robots/armar7/documentation/-/issues/85"]
bool loadLibFromPath(string path);
["deprecate:loadLibFromPackage(string package, string libname) has dangerous implications on the RT thread. Use the scenario config instead to load additional libraries. See https://git.h2t.iar.kit.edu/sw/armarx-integration/robots/armar7/documentation/-/issues/85"]
bool loadLibFromPackage(string package, string libname);
};
interface RobotUnitSelfCollisionCheckerInterface
......
......@@ -82,7 +82,6 @@ armarx_enable_aron_file_generation_for_target(
"${LIB_NAME}"
ARON_FILES
aron/ObjectID.xml
aron/ObjectNames.xml
aron/ObjectPose.xml
aron/ObjectType.xml
aron/PoseManifoldGaussian.xml
......
......@@ -6,6 +6,8 @@
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <ArmarXCore/core/logging/Logging.h>
#include <RobotAPI/libraries/core/json_conversions.h>
namespace armarx::priorknowledge::util
{
FramedLocationPtr
......@@ -53,8 +55,18 @@ namespace armarx::priorknowledge::util
pose,
framedPose.at("pose").get<std::vector<std::vector<float>>>()); // load the 4x4 matrix
FramedLocationPtr loc(new FramedLocation(
LocationId(source, locationName), LocationType::FRAMED_LOCATION, frame, agent, pose));
std::optional<Names> names;
if (auto it = j.find("names"); it != j.end())
{
it->get_to(names.emplace());
}
FramedLocationPtr loc(new FramedLocation(LocationId(source, locationName),
LocationType::FRAMED_LOCATION,
frame,
agent,
pose,
names));
return loc;
}
......@@ -111,12 +123,19 @@ namespace armarx::priorknowledge::util
extents,
framedOrientedBox.at("extents").get<std::vector<float>>()); // load the 4x4 matrix
std::optional<Names> names;
if (auto it = j.find("names"); it != j.end())
{
it->get_to(names.emplace());
}
FramedBoxedLocationPtr loc(new FramedBoxedLocation(LocationId(source, locationName),
LocationType::FRAMED_BOXED_LOCATION,
frame,
agent,
pose,
extents));
extents,
names));
return loc;
}
......@@ -133,7 +152,7 @@ namespace armarx::priorknowledge::util
}
for (const auto& [locationName, j] :
js["locations"].get<std::map<std::string, nlohmann::json>>())
js.at("locations").get<std::map<std::string, nlohmann::json>>())
{
if (j.find("framedPose") != j.end())
{
......
#pragma once
#include <memory>
#include <optional>
#include <string>
#include <SimoxUtility/shapes/OrientedBox.h>
#include <RobotAPI/libraries/core/FramedPose.h>
#include <RobotAPI/libraries/core/Names.h>
namespace armarx::priorknowledge::util
{
......@@ -31,8 +33,12 @@ namespace armarx::priorknowledge::util
{
LocationId id;
LocationType type;
std::optional<Names> names;
Location(const LocationId& i, const LocationType t) : id(i), type(t)
Location(const LocationId& i,
const LocationType t,
const std::optional<Names>& names = std::nullopt) :
id(i), type(t), names(names)
{
}
......@@ -45,12 +51,13 @@ namespace armarx::priorknowledge::util
std::string agent;
Eigen::Matrix4f pose;
FramedLocation(const LocationId& i,
const LocationType t,
const std::string& f,
const std::string& a,
const Eigen::Matrix4f& p) :
Location(i, t), frame(f), agent(a), pose(p)
FramedLocation(const LocationId& id,
const LocationType type,
const std::string& frame,
const std::string& agent,
const Eigen::Matrix4f& pose,
const std::optional<Names>& names = std::nullopt) :
Location(id, type, names), frame(frame), agent(agent), pose(pose)
{
}
......@@ -63,13 +70,14 @@ namespace armarx::priorknowledge::util
{
Eigen::Vector3f extents;
FramedBoxedLocation(const LocationId& i,
const LocationType t,
const std::string& f,
const std::string& a,
const Eigen::Matrix4f& p,
const Eigen::Vector3f& e) :
FramedLocation(i, t, f, a, p), extents(e)
FramedBoxedLocation(const LocationId& id,
const LocationType type,
const std::string& frame,
const std::string& agent,
const Eigen::Matrix4f& pose,
const Eigen::Vector3f& extents,
const std::optional<Names>& names = std::nullopt) :
FramedLocation(id, type, frame, agent, pose, names), extents(extents)
{
}
......
......@@ -7,6 +7,7 @@ armarx_set_target("Library: ${LIB_NAME}")
set(LIBS
ArmarXCoreInterfaces
ArmarXCore
DebugObserverHelper
RemoteGui
aron
aroncommon
......@@ -64,8 +65,9 @@ set(LIB_FILES
client/plugins/PluginUser.cpp
client/plugins/Plugin.cpp
client/util/SubscriptionHandle.cpp
client/util/MemoryListener.cpp
client/util/MemoryToDebugObserver.cpp
client/util/SubscriptionHandle.cpp
client/util/SimpleReaderBase.cpp
client/util/SimpleWriterBase.cpp
......@@ -157,10 +159,11 @@ set(LIB_HEADERS
client/query/detail/NameSelectorOps.h
client/query/detail/SelectorOps.h
client/util/SubscriptionHandle.h
client/util/MemoryToDebugObserver.h
client/util/MemoryListener.h
client/util/SimpleReaderBase.h
client/util/SimpleWriterBase.h
client/util/SubscriptionHandle.h
server.h
......
/*
* 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 RobotAPI::ArmarXObjects::MemoryToDebugObserver
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2023
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <SimoxUtility/json/json.h>
#include <ArmarXCore/libraries/DebugObserverHelper/DebugObserverHelper.h>
#include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
#include <RobotAPI/libraries/armem/client/Reader.h>
#include <RobotAPI/libraries/armem/client/plugins/PluginUser.h>
#include <RobotAPI/libraries/armem/core/wm/memory_definitions.h>
namespace armarx::armem::client::util
{
/**
* @brief ID of an ARON value in the memory.
*/
struct MemoryValueID
{
armem::MemoryID entityID;
aron::Path aronPath;
};
/**
* @brief Transfers data from memory servers to the DebugObserver.
*
* Transfers data from the memory system to the \ref Component-DebugObserver "Debug Observer",
* allowing to visualize them in the \ref ArmarXGui-GuiPlugins-PlotterPlugin "Live Plotter".
*/
class MemoryToDebugObserver
{
public:
/**
* @brief Configuration.
*
* Can be converted to and from JSON.
*/
struct Properties
{
std::vector<MemoryValueID> plottedValues;
};
/**
* @brief Required services.
*/
struct Services
{
MemoryNameSystem& memoryNameSystem;
armarx::DebugObserverHelper& debugObserver;
};
/**
* @brief Constructor.
*/
MemoryToDebugObserver(const Properties& properties, const Services& services);
/**
* @brief Query values from the memory and send them to the debug observer.
*/
void pollOnce();
private:
static std::string makeChannelName(const armem::MemoryID& memoryID);
static std::string makeDatafieldName(const aron::Path& path);
armem::client::Reader* getReader(const armem::MemoryID& memoryID);
Properties properties;
Services services;
std::map<armem::MemoryID, armem::client::Reader> memoryReaders;
};
void to_json(simox::json::json& j, const MemoryValueID& id);
void from_json(const simox::json::json& j, MemoryValueID& id);
void to_json(simox::json::json& j, const MemoryToDebugObserver::Properties& p);
void from_json(const simox::json::json& j, MemoryToDebugObserver::Properties& p);
} // namespace armarx::armem::client::util
......@@ -37,6 +37,8 @@ namespace armarx::armem::server
data::CommitResult commit(const data::Commit& commitIce, Time timeArrived);
data::CommitResult commit(const data::Commit& commitIce);
armem::CommitResult commit(const armem::Commit& commit);
data::CommitResult commitLocking(const data::Commit& commitIce, Time timeArrived);
data::CommitResult commitLocking(const data::Commit& commitIce);
armem::CommitResult commitLocking(const armem::Commit& commit);
......
......@@ -48,7 +48,7 @@ namespace armarx::armem::server::plugins
ReadWritePluginUser::commit(const data::Commit& commitIce, const Ice::Current&)
{
ARMARX_TRACE;
return iceAdapter().commit(commitIce);
return iceAdapter().commitLocking(commitIce);
}
// READING
......