Hello,
first I congratulate the team for your work on this great project.
I'm using java components from STK in a server to generate from a TLE a satellite trajectory but I have problem to orientate the sensor in the right direction (on Earth...).
1- The satellite hang a sensor which has axes offset with the trajectory of the satellite.
JAVA code on server side: (quaternionOffSet and tle have been created before)
Sgp4Propagator propagator = new Sgp4Propagator(tle);
Axes axeSatellite = new AxesVehicleVelocityLocalHorizontal(
propagator.getReferenceFrame(), propagator.createPoint());
Platform plateformeChild = new Platform();
AxesFixedOffset axes = new AxesFixedOffset(axeSatellite,quaternionOffSet);
plateformeChild.setOrientationAxes(axes);
AxesEvaluator evaluatorAxis=GeometryTransformer.getAxesTransformation(earth.getOrientationAxes(), axes);
2- With AxesEvaluator evaluatorAxis, the server generates the quaternions of sensor rotation and send the result to the client side of the application.
JAVA code on server side:(pasComputation is a Duration instance in STK components representing 60 seconds)
UnitQuaternion evaluation;// the quaternion of sensor rotation at each moment
ArrayList<double>quaternion; // the quaternion to save for each moment
String chrono;// the date of evaluation
for (JulianDate tampon = begin; JulianDate.lessThan(tampon, end); tampon = tampon.add(pasComputation)) {
evaluation=axeEvaluateur.evaluate(tampon);
quaternion=new ArrayList<double>(4);
quaternion.add(evaluation.getX()); quaternion.add(evaluation.getY()); quaternion.add(evaluation.getZ()); quaternion.add(evaluation.getW());
chrono=tampon.toGregorianDate().toIso8601String();
// codes to aggregate and send data to the client side (web browser)
...
}
3- In the client side (web browser), a CZML is created with the data received from server.
JAVASCRIPT code on client side: (senseur.orientation is an array listing the chrono coupled with quaternion attribute giving by server side.
var tabOrientation=new Array();
for(var i=0; i < senseur.orientation.length; i++){
var orientation=senseur.orientation[i]; tabOrientation.push(orientation['chrono']); // time in iso8601
tabOrientation.push(orientation['quaternion'][0]); //X attribute of quaternion
tabOrientation.push(orientation['quaternion'][1]);//Y attribute of quaternion
tabOrientation.push(orientation['quaternion'][2]);//Z attribute of quaternion
tabOrientation.push(orientation['quaternion'][3]);//W attribute of quaternion
}
var czml={
"id":sensor['name'],
"orientation":{
"interpolationAlgorithm":"LINEAR",
"interpolationDegree":1,
"unitQuaternion": tabOrientation
},
"position":{
"cartographicRadians":tabPosition // list of data position with time. This is well documentated
},
.
.
. (others attributes of sensor)
};
Questions:
In the documentation, I can't find which is the attributes order of quaternion (w,x,y,z or x,y,z,w??) and above all I can't find any data on the reference frame in which I must create the rotations in order to direct rightly the sensor.
Could you help me please?
Sincerely