Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
e54b2ef7
Commit
e54b2ef7
authored
5 years ago
by
Sebastian Hahta
Browse files
Options
Downloads
Patches
Plain Diff
config proxy
parent
815e4c4b
No related branches found
No related tags found
1 merge request
!157
feature/vision parameters
Pipeline
#16122
passed
5 years ago
Stage: all
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/reconstruct/src/main.cpp
+52
-7
52 additions, 7 deletions
applications/reconstruct/src/main.cpp
with
52 additions
and
7 deletions
applications/reconstruct/src/main.cpp
+
52
−
7
View file @
e54b2ef7
...
...
@@ -58,15 +58,57 @@ using ftl::registration::loadTransformations;
using
ftl
::
registration
::
saveTransformations
;
static
Eigen
::
Affine3d
create_rotation_matrix
(
float
ax
,
float
ay
,
float
az
)
{
Eigen
::
Affine3d
rx
=
Eigen
::
Affine3d
(
Eigen
::
AngleAxisd
(
ax
,
Eigen
::
Vector3d
(
1
,
0
,
0
)));
Eigen
::
Affine3d
ry
=
Eigen
::
Affine3d
(
Eigen
::
AngleAxisd
(
ay
,
Eigen
::
Vector3d
(
0
,
1
,
0
)));
Eigen
::
Affine3d
rz
=
Eigen
::
Affine3d
(
Eigen
::
AngleAxisd
(
az
,
Eigen
::
Vector3d
(
0
,
0
,
1
)));
return
rz
*
rx
*
ry
;
Eigen
::
Affine3d
rx
=
Eigen
::
Affine3d
(
Eigen
::
AngleAxisd
(
ax
,
Eigen
::
Vector3d
(
1
,
0
,
0
)));
Eigen
::
Affine3d
ry
=
Eigen
::
Affine3d
(
Eigen
::
AngleAxisd
(
ay
,
Eigen
::
Vector3d
(
0
,
1
,
0
)));
Eigen
::
Affine3d
rz
=
Eigen
::
Affine3d
(
Eigen
::
AngleAxisd
(
az
,
Eigen
::
Vector3d
(
0
,
0
,
1
)));
return
rz
*
rx
*
ry
;
}
// TODO: Remove this class (requires more general solution). Also does not
// process disconnections/reconnections/types etc. correctly.
class
ConfigProxy
{
private:
vector
<
ftl
::
UUID
>
peers_
;
vector
<
std
::
string
>
uris_
;
ftl
::
net
::
Universe
*
net_
;
public:
ConfigProxy
(
ftl
::
net
::
Universe
*
net
)
{
net_
=
net
;
auto
response
=
net_
->
findAll
<
std
::
string
>
(
"node_details"
);
for
(
auto
&
r
:
response
)
{
auto
r_json
=
json_t
::
parse
(
r
);
peers_
.
push_back
(
ftl
::
UUID
(
r_json
[
"id"
].
get
<
std
::
string
>
()));
uris_
.
push_back
(
r_json
[
"title"
].
get
<
std
::
string
>
());
}
}
void
add
(
ftl
::
Configurable
*
root
,
const
std
::
string
&
uri
,
const
std
::
string
&
name
)
{
auto
config
=
json_t
::
parse
(
net_
->
call
<
string
>
(
peers_
[
0
],
"get_cfg"
,
uris_
[
0
]
+
"/"
+
uri
));
auto
*
proxy
=
ftl
::
create
<
ftl
::
Configurable
>
(
root
,
name
);
for
(
auto
&
itm
:
config
.
get
<
json
::
object_t
>
())
{
auto
key
=
itm
.
first
;
auto
value
=
itm
.
second
;
if
(
*
key
.
begin
()
==
'$'
)
{
continue
;
}
proxy
->
set
(
key
,
value
);
proxy
->
on
(
key
,
[
this
,
uri
,
key
,
value
,
proxy
](
const
ftl
::
config
::
Event
&
)
{
for
(
size_t
i
=
0
;
i
<
uris_
.
size
();
i
++
)
{
// TODO: check that config exists?
auto
peer
=
peers_
[
i
];
std
::
string
name
=
uris_
[
i
]
+
"/"
+
uri
+
"/"
+
key
;
net_
->
send
(
peer
,
"update_cfg"
,
name
,
proxy
->
getConfig
()[
key
].
dump
());
}
});
}
}
};
static
void
run
(
ftl
::
Configurable
*
root
)
{
Universe
*
net
=
ftl
::
create
<
Universe
>
(
root
,
"net"
);
ftl
::
ctrl
::
Slave
slave
(
net
,
root
);
...
...
@@ -117,6 +159,9 @@ static void run(ftl::Configurable *root) {
return
;
}
auto
configproxy
=
ConfigProxy
(
net
);
configproxy
.
add
(
root
,
"source/disparity"
,
"disparity"
);
// Create scene transform, intended for axis aligning the walls and floor
Eigen
::
Matrix4d
transform
;
if
(
root
->
getConfig
()[
"transform"
].
is_object
())
{
...
...
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