Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2017-07-10 09:26:18 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2892caaca186ed4c46d4482e36b795a0fc417144
2892caac
1 parent
0c191f42
preparation appli outdoor
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
components/geojson.js
components/gpsinertialpose.js
components/geojson.js
View file @
2892caa
arcs_module
(
function
(
ARCS
,
three
)
{
var
PipeNetwork
=
ARCS
.
Component
.
create
(
function
(
jsonData
)
{
}
);
return
{
PipeNetwork
:
PipeNetwork
};
},
[
'deps/three.js/index'
]
);
\ No newline at end of file
...
...
components/gpsinertialpose.js
0 → 100644
View file @
2892caa
arcs_module
(
function
(
ARCS
)
{
var
GPSInertialPose
=
new
ARCS
.
Component
(
function
()
{
var
id
=
0
;
var
pose
=
{
position
:
[
0
,
0
,
0
],
rotation
:
[
[
1
,
0
,
0
],
[
0
,
1
,
0
],
[
0
,
0
,
1
]
]
};
var
cos
=
Math
.
cos
;
var
sin
=
Math
.
sin
;
var
meterToDegree
=
0.00001
;
this
.
setId
=
function
(
identifier
)
{
id
=
identifier
;
};
this
.
setPosition
=
function
(
longitude
,
latitude
)
{
pose
.
position
=
[
longitude
,
latitude
,
1.2
*
meterToDegree
];
this
.
emit
(
'sendPose'
,
[{
id
:
id
,
pose
:
pose
}]);
};
// this function computes the rotation matrix according to
// https://w3c.github.io/deviceorientation/spec-source-orientation.html
this
.
setOrientation
=
function
(
orientation
)
{
var
alpha
=
orientation
.
alpha
;
var
beta
=
orientation
.
beta
;
var
gamma
=
orientation
.
gamma
;
pose
.
rotation
=
[[
cos
(
alpha
)
*
cos
(
gamma
)
-
sin
(
alpha
)
*
sin
(
beta
)
*
sin
(
gamma
),
-
cos
(
beta
)
*
sin
(
alpha
),
cos
(
gamma
)
*
sin
(
alpha
)
*
sin
(
beta
)
+
cos
(
alpha
)
*
sin
(
gamma
)
],
[
cos
(
gamma
)
*
sin
(
alpha
)
+
cos
(
alpha
)
*
sin
(
beta
)
*
sin
(
gamma
),
cos
(
alpha
)
*
cos
(
beta
),
sin
(
alpha
)
*
sin
(
gamma
)
-
cos
(
alpha
)
*
cos
(
gamma
)
*
sin
(
beta
)
],
[
-
cos
(
beta
)
*
sin
(
gamma
),
sin
(
beta
),
cos
(
beta
)
*
cos
(
gamma
)
]
];
this
.
emit
(
'sendPose'
,
[{
id
:
id
,
pose
:
pose
}]);
};
},
[
'setPosition'
,
'setOrientation'
],
[
'sendPose'
]
);
return
{
GPSInertialPose
:
GPSInertialPose
};
}
);
\ No newline at end of file
Please
register
or
login
to post a comment