Offset a position reference?

Hi all,
I’m trying to figure out the best way to add a simple, conic shape that follows a satellite and serves as a “sensor”. I’ve gotten very close to getting what I need, but it’s not quite there, and now I’m stymied. I’m no Cesium or javascript expert by any means.

Using Cesium 1.27, I created an object (an entity?) as part of a larger CZML file in which I’ve already defined the position of CubeSat1:

{
“id” : “obs1”,
“name” : “obs1cone_sat15”,
“cylinder” : {
“length” : 530000.0,
“topRadius” : 0.0,
“bottomRadius” : 400000.0,
“material” : {
“solidColor” : {
“color” : {
“rgba” : [255, 0, 0, 150]
}
}
},
“verticalorigin”: “TOP”,
“fill” : true,
“show”: [
{
“interval”: “2017-03-15T10:00:00Z/2017-03-15T11:00:00Z”,
“boolean”: false
},
{
“interval”: “2017-03-15T11:00:00Z/2017-03-16T09:00:00Z”,
“boolean”: true
},
{
“interval”: “2017-03-16T09:00:00Z/2017-03-16T10:00:00Z”,
“boolean”: false
}
]
},
“position”:{
“reference”:“Satellite/CubeSat1#position”
}

``

The cone shows up as in the attached pic. The problem is that it’s centered on the satellite, when I actually want it below that sat. Of course I could directly specify the position coordinates of the cone separately from the satellite, but I’d really like to be able to just reference its position.

Is there any way to specify a fixed offset from a position reference? Like, 10 km along the CubeSat1 -> Earth Center line?

Also, is there an easier way to do this? I see tantalizing hints of a easier world with the “ConicSensor”, but I have no idea how to use this in a CZML file. (https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/ConicSensor)

Another side question - when I specify a cone that follows CubeSat1 position, as above, it actually rotates with the sat’s orbit and manages to always face towards the center of the earth. Why is this? Is the sat’s orientation rotating constantly wrt to the earth center line?

Any help would be much appreciated! Thanks in advance!

-Kit Kennedy

Screen Shot 2017-03-10 at 5.52.08 PM.png

Hi Kit,

Are you able to share your source code?

I may be able to help on the Javascript side of things.

  • Harry

Hi Harry,
Sure thing, attaching what I think is all the relevant code

runner_lite.html is in a folder in the apps directory, sats_file_lite.czml is in the subdir app_data_files. Also, I removed my bing maps key from runner_lite

-Kit

runner_lite.html (1.04 KB)

sats_file_lite.czml (151 KB)

Offset positions in CZML are not currently supported. However, this has come up before, and would be a useful addition, if you are interested in pursuing it. Basically, this would entail defining a new way to define “position” properties in CZML, using a reference and a time-varying cartesian offset. Cesium would also need a new type of PositionProperty that calculates the resulting position value.

Thanks Scott, that’s helpful - I very well may end up going down that route in the future. For the time being, would “ConicSensor” be a solution for my problem? As I mentioned, it looks what I need, but I just don’t know how to use it in CZML…

thanks,

Kit

I suggest using a callback property for the position of the cone. That way you can reference the position of the cube sat, but offset the height by x metres. Tweaking the offset should allow you to position the cone as you wish.

To use a callback property you’ll need to create the cone in JS, not CZML, create a function that gets the position of the cube sat, and set the cones position as the callback property. I haven’t had time to make an example, will do if I find some time!

Great, thanks Harry! I’ll probably punt on this for now, but that’s a good suggestion.

-Kit