How to get celestial coordinates?

304 views
Skip to first unread message

joe hallenbeck

unread,
Feb 28, 2012, 3:09:37 PM2/28/12
to Google Sky Map
To begin hacking my telescope-interface, I need to know how to get the
celestial coordiantes (right ascension and declination) of an object
I'm pointing at with my device. Some hints where to look in the
sources are apprecciated.

I've found the geocentric coordinates of the line of sight, but for
telescope movement I need right ascension and declination. Interfacing
via Bluetooth-SPP and a cheap serial-adaptor (Sphinx Electronics Pico
Plug) to my Autostar isn't such big deal and the Autostar serial-
protocol is rather good documented by Meade.

So if someone could give me a hint how to get the celestial
coordinates of the line of sight, I could begin coding/testing.

thanks in advance,

Joe

Michael Kosowsky

unread,
Feb 28, 2012, 9:21:21 PM2/28/12
to Google Sky Map
maybe units/RaDec.java line 69: public static RaDec
getInstance(GeocentricCoordinates coords) ?

MK

joe hallenbeck

unread,
Feb 29, 2012, 2:24:31 AM2/29/12
to Google Sky Map
Thank you, I think that's exactly what I was looking for.

Joe

joe hallenbeck

unread,
Mar 1, 2012, 1:41:45 PM3/1/12
to Google Sky Map
Ok, what I've got so far:

1. Interfacing with telescope
I modified the BluetoothChat sample to connect to my telescope.
Serial communication is working, I can send commands to and read
parameters from the scope.

2. Getting RA/Dec of LineofSight
Was easy to accomplish, after I knew where to look at :)

So the basic functions are working.

What I need now is some sort of user-interface. I understand how to
build standard android-interfaces, but the skyrenderer with it's
layers is complicated.
I think I need 1 or 2 extra layers for the following task:

First I need a crosshair at the line of sight or exactly at the center
of the map.
This should act as an optical "Point-and-Shoot" interface. Should only
display, if connection to telescope is established.

Second I need a button to send the coordinates to the scope andd
trigger it to move. This button should only be active, when the user
points to a region above the horizon.
Alternatively a Longtouch-Event somewhere on the screen with a Toast-
Message "Telescope slew initiated" or so...

The last one is not so important, but would be nice:
Something like a circle or another crosshair in a different color to
indicate where the telescope is pointing at.

Are there some suggestions or tips on how to achieve this?

Thanks in advance

Joe

joe hallenbeck

unread,
Mar 2, 2012, 3:31:42 AM3/2/12
to Google Sky Map
I've integrated the BluetoothChat into SkyMap.
For testing I've just added 2 Buttons to skyrenderer.xml - one to
connect and one to send the target RA/Dec and move the telescope.

It works as expected. Just point the phone to the target, click a
button and the telescope moves.

The code is somewhat messy and without proper error-handling. Also the
UI is horrible - just for testing. I'm going to clean it up now and do
some fine-tuning.

Joe

Kevin Serafini

unread,
Mar 2, 2012, 7:28:05 AM3/2/12
to google-...@googlegroups.com
Sounds good!

I don't know much about Sky Map's UI, other guys did that. I was going to suggest adding a menu item or something, but it sounds like your solution works.

joe hallenbeck

unread,
Mar 2, 2012, 11:03:04 AM3/2/12
to Google Sky Map
As I'm totally new to Android/Java-Development I'm very surprised that
it took only about 8-10 hours to get it working.
I had absolutly no knowledge of Java-programming and some things are
different than in pascal.
But the basic principles are the same and online documentation is very
good so far.

Some technical information just for interest:

I'm using a Meade LXD-75 Mounting with a 6" 1200mm Newton-Telescope.
The serial command protocol can be found here:

http://www.meade.com/support/LX200CommandSet.pdf

For bluetooth connection I bought a cheap serial-adapter (17 EUR):
"Shpinx Electronics Pico Plug". This adapter needs hardware-handshake
on RS232, which isn't supported by the telescope. You need to bridge
pins 7+8 to get it working.

Also I ran into problems connecting to the adapter via Bluetooth-SPP.
My LG-Phone worked fine, but my two Archos tablets couldn't connect.
After some googleing I found a workaround, as it seems that this
problem is not uncommon on various devices:

tmp = createRfcommSocketToServiceRecord(UUID) with SPP-UUID
"00001101-0000-1000-8000-00805F9B34FB" has problems on some android-
devices.

I replaced it with the following workaround I found:

Method m = mmDevice.getClass().getMethod("createRfcommSocket",
new Class[] { int.class });
tmp = (BluetoothSocket)m.invoke(mmDevice, Integer.valueOf(1));

Now all of my androids connect to the adapter without problems.

Joe

Kevin Serafini

unread,
Mar 5, 2012, 11:59:32 AM3/5/12
to google-...@googlegroups.com
Joe,

I want you to know that you've made me very sad! My scope is about 20 years old and isn't computer controlled, so I can't utilize your changes. :-)

I do think that there is a guy in the office with a computer controlled scope, so we might able to try that. I would love to be able to include it in a new release, if you are willing. The problem that we are having right now is that both John and I are super busy at work, so we don't have a lot of time to dedicate to Sky Map. I'd like to dedicate some time in the next month to reviewing and integrating some changes. We'll see how it goes.

Later,
Kevin

joe hallenbeck

unread,
Mar 5, 2012, 12:18:21 PM3/5/12
to Google Sky Map
As long as I'm a bloody java-beginner, I'll be ashamed of my code
quality :)
Sure I got it working, but there's lots of unused code in it, since I
just copied my modified BluetoothChat-example into SkyMap. Also I
think I placed many functions/methods in the wrong place, so that it
is very confusing for anyone besides me. I'll try to clean it up and
comment it well enough for others to read and understand.

Joe

joe hallenbeck

unread,
Mar 5, 2012, 2:21:35 PM3/5/12
to google-...@googlegroups.com
Ok this is the main code, that does most of the magic.

Since the online-editor doesn't keep the formatting, I attached the code as unix-textfile.

Suggestions and tipps are always welcome :)

Joe





code.txt

joe hallenbeck

unread,
Mar 5, 2012, 4:21:42 PM3/5/12
to google-...@googlegroups.com
Here is a short video to proove, that it works:

joe hallenbeck

unread,
Mar 7, 2012, 4:03:09 PM3/7/12
to Google Sky Map
I am not very confident with my solution to implement everything into
skymap. My approach wasn't driver-independent. There are more
telescopes with different protocols out there, i.e. Celestron NexStar,
Ascom or INDI.
Also my code is blocking the interface while waiting for a response
from the telescope. This gets annoying, because I had to a delay of
200 ms after sending a command (It seems the Autostar isn't fast
enough).

So the last few days I read through the dev-guide, studied examples,
tested code, etc. - learning by doing. I think it would be better to
add an abstraction layer to the interface, and implement the driver as
an external service with a defined commandset. I've tested different
methods and stuck with a messenger-based service implementing a
seperate thread for communication with the telescope.

This would look like:

Physical Interface
(serial, bluetooth, wifi, ethernet...)
|
|
Telescope-Driver (Service)
|
|
SkyMap

Is this approach right?

Joe

Michael Kosowsky

unread,
Mar 8, 2012, 3:37:15 PM3/8/12
to Google Sky Map
I'm interested in something similar. I have a 1970s vintage orange
tube
Celestron, and I just added JMI rotary encoders and wired up the
Android
ADK's Arduino USB board (I originally got the board at Google I/O, but
I
just saw it at a local Radio Shack) so I can read the setting circles
in Android.

For me, the "telescope service" is just two calls:

SkyMap can call MoveTo(ra, dec) to tell the telescope where to point
(which in my case means turning LEDs on and off as I move the scope
around)

and

the telescope can call Pointing(ra, dec) to tell SkyMap where it's
looking

(I'm not wed to the function names).

Maybe that defines the base level telescope service.
I know that INDI and the others are much more complex, but
I don't think I need any of that complexity.

MK

joe hallenbeck

unread,
Mar 12, 2012, 4:09:29 PM3/12/12
to google-...@googlegroups.com
Since my last post i've been busy programming my first own android-app. It's a basic telescope-remote-control. From beginning on I implemented my idea of an abstraction layer, so this app consists of an activity an a service. The user-interface or activity is a type of a virtual joystick. I saw this on videos of the "ar.drone" interface and thougt it would fit my needs. So far it works well. Next I will refine the ipc-interface, so that other apps as well could use it. I also tried to keep it simple, so that I should be able to adapt it to direct-serial or network-connections. Currently it covers only the very basic commands like "move to target", "move up/right/down/left" and "set speed of movement". 
I'm very pleased with eclipse and the android sdk, as well as the corresponding documentation so far. I've never thought I get into programming again so fast and with a "foreign" language after a long time of absence. That's very cool.

Joe.

Harshad RJ

unread,
Mar 12, 2012, 10:57:41 PM3/12/12
to google-...@googlegroups.com
Joe and Michael,

I am the developer of SkEye (another planetarium for Android). I like the idea of having a separate "telescope server" that other clients could connect to. If the server uses TCP/IP for communication and uses INDI, then it opens up a whole world of possibilities. Any INDI client, running on Android or desktop/laptop, will be able to connect to the server running on Android. And Android clients which have been programmed to work with INDI will be able to connect to non-Android servers as well.

Programming INDI might require investing time in it but it will be better in the long term than having a custom protocol. We needn't cover the entire INDI spec initially; just the equivalent of "Pointing" and "MoveTo" are sufficient.

cheers,
--
Harshad RJ
http://lavadip.com

joe hallenbeck

unread,
Mar 13, 2012, 4:05:54 AM3/13/12
to Google Sky Map
I second your suggest. I'll dig into the INDI-protocol as soon as
possible, but this will take a while.

Joe

Bob

unread,
Apr 22, 2012, 9:04:54 PM4/22/12
to Google Sky Map
I'm still trying to come up to speed with where Android telescope
control is at and the path I'd been persuing is to try and get
something going between the now open source Skywatcher Panorama app
( http://code.google.com/p/skywatcher/source/checkout ) and Skydroid

I'm another beginner and am busily trying to get across what's
involved.
Panorama seems to implement a set of functionality for bluetooth
control of Skywatcher scopes and based on codes listed in one file
possibly other scopes as well (if not it may not be difficult to add
them where the relevant control codes are known). I've so far only
tested from my Galaxy 10.1 tab to an EQ6 Pro and that worked first
time. I've not tried out tracking, the camera interface etc.

It may not end up being a good solution but I suspect that it may
already have a lot of the stuff needed for the telescope control
aspect of this work. Add in (or locate) an service intent interface,
some functionaility to align a scope (similar to the tools in ASCOM
perhaps) and give Stardroid the ability to initiate a slew based on
selection of an object and a very useful tool would be availalable.

Based on my so far limited understanding one of the first tasks might
be to define some standards for identification data to be passed each
way with intents, I assume that it would also be useful for Stardroid
to be able to show where a scope is currently pointed.

Bob

joe hallenbeck

unread,
Apr 23, 2012, 12:44:02 AM4/23/12
to Google Sky Map
Hi Bob,

there is already an open standard called INDI: http://indilib.org/index.php
There also is a complete java-implementation of the INDI client/server
libs: http://indiforjava.sourceforge.net/wiki/index.php/Main_Page

I've got a working basic INDI-Server and a driver for LX200/Autostar
telescopes connected to Android via bluetooth-serial-profile.

I also have a basic PL2303 serial-to-usb driver for Android usb host
mode.

What is missing now is the INDI-Client code in Skymap. Because I'm not
good in UI-Design I don't have started this.

Best regards

Alex

Bob

unread,
Apr 24, 2012, 5:08:33 PM4/24/12
to Google Sky Map
Alex thanks for that. I've now started looking at the INDI doco and
will try and work out how to tie it into the Skywatcher control (I'll
try and stick with bluetooth for now).

I appreciate that info, its not something I'd seen before.

Bob

Harshad RJ

unread,
Apr 25, 2012, 12:27:47 PM4/25/12
to google-...@googlegroups.com
Hi,

There seem to be quite a few people interested in INDI for Android. I know about 6 of them (some of them are off-list on Cloudy Nights, for example)

Since, this is a mailing list specifically for Google SkyMap, can we have a separate mailing list for "INDI for Android"? I have tentatively created a Google Group here:
https://groups.google.com/forum/#!forum/indi-for-android

Please join and spread the word.

Harshad RJ

unread,
Apr 26, 2012, 12:32:21 AM4/26/12
to google-...@googlegroups.com
On Wed, Apr 25, 2012 at 9:57 PM, Harshad RJ <harsh...@gmail.com> wrote:
Since, this is a mailing list specifically for Google SkyMap, can we have a separate mailing list for "INDI for Android"? I have tentatively created a Google Group here:
https://groups.google.com/forum/#!forum/indi-for-android

A small update. The group membership is now fully open. For some reason, it had become a closed group and only when I received approval messages today did I realise this.

Reply all
Reply to author
Forward
0 new messages