Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
ca6b878b
Commit
ca6b878b
authored
6 years ago
by
Fabian Paus
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/IMAGINERefactoring' into Ice3.7
parents
361ac7f9
a49e6763
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.cpp
+21
-21
21 additions, 21 deletions
source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.cpp
source/RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h
+3
-1
3 additions, 1 deletion
.../RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h
with
24 additions
and
22 deletions
source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.cpp
+
21
−
21
View file @
ca6b878b
...
@@ -34,25 +34,25 @@ namespace armarx
...
@@ -34,25 +34,25 @@ namespace armarx
size_t
DeviceContainer
::
load
(
const
MultiNodeRapidXMLReader
&
rootNodeConfigs
,
const
VirtualRobot
::
RobotPtr
&
robot
)
size_t
DeviceContainer
::
load
(
const
MultiNodeRapidXMLReader
&
rootNodeConfigs
,
const
VirtualRobot
::
RobotPtr
&
robot
)
{
{
size_t
addedDevices
=
0
;
size_t
addedDevices
=
0
;
auto
children
=
robot
->
getRobotNodes
();
//
auto children = robot->getRobotNodes();
auto
getSceneObject
=
[
&
](
const
std
::
string
&
name
)
//
auto getSceneObject = [&](const std::string & name)
{
//
{
for
(
auto
&
obj
:
children
)
//
for (auto& obj : children)
{
//
{
if
(
obj
->
getName
()
==
name
)
//
if (obj->getName() == name)
{
//
{
return
VirtualRobot
::
SceneObjectPtr
(
obj
);
//
return VirtualRobot::SceneObjectPtr(obj);
}
//
}
}
//
}
for
(
auto
&
s
:
robot
->
getSensors
())
//
for (auto& s : robot->getSensors())
{
//
{
if
(
s
->
getName
()
==
name
)
//
if (s->getName() == name)
{
//
{
return
VirtualRobot
::
SceneObjectPtr
(
s
);
//
return VirtualRobot::SceneObjectPtr(s);
}
//
}
}
//
}
return
VirtualRobot
::
SceneObjectPtr
();
//
return VirtualRobot::SceneObjectPtr();
};
//
};
//rootNode = rootNodeConfig;
//rootNode = rootNodeConfig;
ARMARX_DEBUG
<<
"Device factories: "
<<
VirtualDeviceFactory
::
getAvailableClasses
();
ARMARX_DEBUG
<<
"Device factories: "
<<
VirtualDeviceFactory
::
getAvailableClasses
();
auto
defaultNode
=
DefaultRapidXmlReaderNode
(
rootNodeConfigs
.
nodes
(
"DefaultConfiguration"
));
auto
defaultNode
=
DefaultRapidXmlReaderNode
(
rootNodeConfigs
.
nodes
(
"DefaultConfiguration"
));
...
@@ -64,9 +64,9 @@ namespace armarx
...
@@ -64,9 +64,9 @@ namespace armarx
}
}
auto
name
=
node
.
attribute_value
(
"name"
);
auto
name
=
node
.
attribute_value
(
"name"
);
ARMARX_DEBUG
<<
"Handling: "
<<
node
.
name
()
<<
" name: "
<<
name
;
ARMARX_DEBUG
<<
"Handling: "
<<
node
.
name
()
<<
" name: "
<<
name
;
auto
obj
=
getSceneObject
(
name
);
//
auto obj = getSceneObject(name);
// ARMARX_CHECK_EXPRESSION_W_HINT(obj, name);
// ARMARX_CHECK_EXPRESSION_W_HINT(obj, name);
auto
tuple
=
std
::
make_tuple
(
node
,
defaultNode
,
ob
j
);
auto
tuple
=
std
::
make_tuple
(
node
,
defaultNode
,
r
ob
ot
);
auto
instance
=
VirtualDeviceFactory
::
fromName
(
node
.
name
(),
tuple
);
auto
instance
=
VirtualDeviceFactory
::
fromName
(
node
.
name
(),
tuple
);
if
(
!
instance
)
if
(
!
instance
)
{
{
...
...
This diff is collapsed.
Click to expand it.
source/RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h
+
3
−
1
View file @
ca6b878b
...
@@ -29,12 +29,14 @@
...
@@ -29,12 +29,14 @@
#include
<ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h>
#include
<ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h>
#include
<ArmarXCore/core/system/AbstractFactoryMethod.h>
#include
<ArmarXCore/core/system/AbstractFactoryMethod.h>
#include
<VirtualRobot/VirtualRobot.h>
#include
<VirtualRobot/VirtualRobot.h>
#include
<VirtualRobot/Robot.h>
namespace
armarx
namespace
armarx
{
{
using
AbstractFunctionalDevicePtr
=
std
::
shared_ptr
<
class
AbstractFunctionalDevice
>
;
using
AbstractFunctionalDevicePtr
=
std
::
shared_ptr
<
class
AbstractFunctionalDevice
>
;
using
VirtualDeviceFactoryArgs
=
std
::
tuple
<
RapidXmlReaderNode
,
armarx
::
DefaultRapidXmlReaderNode
,
VirtualRobot
::
SceneObjec
tPtr
>
;
using
VirtualDeviceFactoryArgs
=
std
::
tuple
<
RapidXmlReaderNode
,
armarx
::
DefaultRapidXmlReaderNode
,
VirtualRobot
::
Robo
tPtr
>
;
class
VirtualDeviceFactory
:
class
VirtualDeviceFactory
:
public
AbstractFactoryMethod
<
VirtualDeviceFactory
,
VirtualDeviceFactoryArgs
,
AbstractFunctionalDevicePtr
>
public
AbstractFactoryMethod
<
VirtualDeviceFactory
,
VirtualDeviceFactoryArgs
,
AbstractFunctionalDevicePtr
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment