Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
World Storage ASP.NET Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
ARF
World Storage API Helpers
World Storage ASP.NET Server
Commits
35d29c13
Commit
35d29c13
authored
11 months ago
by
Stephane LOUIS DIT PICARD
Browse files
Options
Downloads
Patches
Plain Diff
feat: add support for requesting relocalization information with a trackable UUID
parent
a8be8987
No related branches found
Branches containing commit
Tags
1.1.0
Tags containing commit
2 merge requests
!8
New API generated code using abstract class instead of virtual.
,
!7
Milestone B version (relocalization information, last openapi)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs
+39
-0
39 additions, 0 deletions
...ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs
with
39 additions
and
0 deletions
server/worldstorage/src/ETSI.ARF.OpenAPI.WorldStorage/ETSI-ARF/ControllersImpl/RelocalizationInformationImpl.cs
+
39
−
0
View file @
35d29c13
...
@@ -55,6 +55,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers
...
@@ -55,6 +55,7 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers
public
override
IActionResult
GetRelocalizationInformation
([
FromQuery
(
Name
=
"uuids"
)][
Required
()]
List
<
GetRelocalizationInformationUuidsParameterInner
>
uuids
,
[
FromQuery
(
Name
=
"capabilities"
)][
Required
()]
List
<
Capability
>
capabilities
,
[
FromHeader
(
Name
=
"token"
)]
string
token
)
public
override
IActionResult
GetRelocalizationInformation
([
FromQuery
(
Name
=
"uuids"
)][
Required
()]
List
<
GetRelocalizationInformationUuidsParameterInner
>
uuids
,
[
FromQuery
(
Name
=
"capabilities"
)][
Required
()]
List
<
Capability
>
capabilities
,
[
FromHeader
(
Name
=
"token"
)]
string
token
)
{
{
WorldAnchorService
_worldAnchorService
=
WorldAnchorService
.
Singleton
as
WorldAnchorService
;
WorldAnchorService
_worldAnchorService
=
WorldAnchorService
.
Singleton
as
WorldAnchorService
;
TrackableService
_trackableService
=
TrackableService
.
Singleton
as
TrackableService
;
var
history
=
new
List
<
Guid
>();
var
history
=
new
List
<
Guid
>();
var
result
=
new
GetRelocalizationInformation200Response
();
var
result
=
new
GetRelocalizationInformation200Response
();
...
@@ -63,6 +64,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers
...
@@ -63,6 +64,13 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers
foreach
(
var
request
in
uuids
)
foreach
(
var
request
in
uuids
)
{
{
var
anchor
=
_worldAnchorService
.
Get
(
request
.
Uuid
);
var
anchor
=
_worldAnchorService
.
Get
(
request
.
Uuid
);
Trackable
trackable
=
null
;
if
(
anchor
==
null
)
{
// anchor not found, try to find uuid as a trackable
trackable
=
_trackableService
.
Get
(
request
.
Uuid
);
}
if
(
anchor
!=
null
)
if
(
anchor
!=
null
)
{
{
...
@@ -77,6 +85,37 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers
...
@@ -77,6 +85,37 @@ namespace ETSI.ARF.OpenAPI.WorldStorage.Controllers
result
.
RelocInfo
.
Add
(
relocalizationInformation
);
result
.
RelocInfo
.
Add
(
relocalizationInformation
);
}
}
else
if
(
trackable
!=
null
)
{
history
.
Add
(
trackable
.
UUID
);
Matrix4x4
matrix
=
Matrix4x4
.
Identity
;
var
relocalizationInformation
=
new
RelocalizationInformation
();
relocalizationInformation
.
RequestUUID
=
trackable
.
UUID
;
relocalizationInformation
.
RequestType
=
TypeWorldStorage
.
TRACKABLEEnum
;
relocalizationInformation
.
RelocObjects
=
new
List
<
RelocalizationInformationRelocObjectsInner
>();
if
(
trackable
.
Match
(
capabilities
))
{
// add itself with matrix identity as Transform3D
var
itself
=
new
RelocalizationInformationRelocObjectsInner
();
itself
.
Trackable
=
trackable
;
itself
.
Mode
=
request
.
Mode
;
itself
.
Transform3D
=
new
List
<
float
>()
{
matrix
.
M11
,
matrix
.
M12
,
matrix
.
M13
,
matrix
.
M14
,
matrix
.
M21
,
matrix
.
M22
,
matrix
.
M23
,
matrix
.
M24
,
matrix
.
M31
,
matrix
.
M32
,
matrix
.
M33
,
matrix
.
M34
,
matrix
.
M41
,
matrix
.
M42
,
matrix
.
M43
,
matrix
.
M44
,
};
relocalizationInformation
.
RelocObjects
.
Add
(
itself
);
}
relocalizationInformation
.
RelocObjects
.
AddRange
(
FindRelocInfo
(
trackable
.
UUID
,
request
.
Mode
,
matrix
,
capabilities
,
ref
history
));
result
.
RelocInfo
.
Add
(
relocalizationInformation
);
}
else
else
{
{
Console
.
WriteLine
(
$"WorldAnchor with UUID
{
request
.
Uuid
}
does not exist in database"
);
Console
.
WriteLine
(
$"WorldAnchor with UUID
{
request
.
Uuid
}
does not exist in database"
);
...
...
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