Software output distance between current coordinates of telescope and desired object

Asked by Harry Stuart on 2017-08-15

Hi there,

I have Stellarium and am using it a push-to controller for my telescope using the Nexus II from Astrodevices. On the Stellarium display, it reads what the current azimuth and altitude coordinates are of the telescope, and it also reads the current azimuth and altitude coordinates of a selected object be it Saturn, Mars etc. I am hoping to be able to write a short program for an Arduino that essentially calculates the difference in distance of the target's coordinates and the current coordinates of the telescope, to use with stepper motors down the track but that’s irrelevant. In order to do so, I require two pieces of information, the current coordinates of the target, from which I will subtract the current coordinates of the telescope. I was wondering if there is any possible way I can have Stellarium actually output those coordinates to another program? Or, if there is any program I can write that actually retrieves those coordinates from Stellarium in real-time? Or is there a way I can calculate the distance between the current scope’s position and the object within Stellarium, whilst outputting it in such a way that it can be read by an external program?

I am also keen to hear about any other software that may be able to accomplish this.

I greatly appreciate your time and hope this makes some sense.

Kind Regards, Harry

Question information

English Edit question
Stellarium Edit question
No assignee Edit question
Last query:
Last reply:
Alexander Wolf (alexwolf) said : #1

Please read the code of Angle Measure plugin for get an idea for calculation of angular distance between 2 points.

Harry Stuart (harrystuart) said : #2

How do I receive this in real-time though?

Alexander Wolf (alexwolf) said : #3

I'm sorry, but I don't understand you: are you write an own protocol for management of telescope (in this case you define all data for exchange by yourself) or you are tried use LX200 or NexStar protocols for your device?

Harry Stuart (harrystuart) said : #4

No no no. I will put it simply. I would like stellarium to output the coordinates of my telescope and the coordinates of an object such as Jupiter. I don't care what protocol I have to use to request that information or if I could even write a script in stellarium. I just need the two coordinates outputted in real time to a device such as an arduino, but that's irrelevant. All il after is how to get stellarium to send out the coordinates.

Thanks for all your help

Alexander Wolf (alexwolf) said : #5

You can use Remote Control plugin to get an data through web interface:

For example:
1) Run Stellarium
2) Activate Remote Control plugin
3) Run in terminal: curl -G http://localhost:8090/api/objects/info?format=map to get a data for selected object as JSON map

Harry Stuart (harrystuart) said : #6

Thanks for that. That is very helpful and convenient. I was wondering if it would be possible to simultaneously display the telescope's coordinates on that webpage, as well as the object's coordinates. At the moment it only displays the object's coordinates.

Thanks again, I really appreciate it

Alexander Wolf (alexwolf) said : #7

curl -G -d 'name=Telescope1&format=map' http://localhost:8090/api/objects/info

Harry Stuart (harrystuart) said : #8

How do use this "curl -G -d" command to request both the telescope and object's coordinates? In command prompt?


gzotti (georg-zotti) said : #9

curl -G -d 'name=Telescope1&format=map' http://localhost:8090/api/objects/info
curl -G -d 'name=Jupiter&format=map' http://localhost:8090/api/objects/info

and then process the answers.

Depending on your programming language, you may prefer to connect without curl, following

Can you help with this problem?

Provide an answer of your own, or ask Harry Stuart for more information if necessary.

To post a message you must log in.