Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python stuff #19

Merged
merged 19 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 52 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,26 @@ and tracks the dome position using an encoder. It returns infomation
The c++ code is built around Software Bisque's X2 standard. For more
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The c++ code is built around Software Bisque's X2 standard. For more
The C++ code is built around Software Bisque's X2 standard. For more

infomation on this `see here <https://www.bisque.com/x2standard/class_x2_dome.html#a7ffd792950cdd0abe1b022e7a8caff9e>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
infomation on this `see here <https://www.bisque.com/x2standard/class_x2_dome.html#a7ffd792950cdd0abe1b022e7a8caff9e>`.
infomation on this `see here <https://www.bisque.com/x2standard/class_x2_dome.html#a7ffd792950cdd0abe1b022e7a8caff9e>`_.


C++/gRPC Component
==================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This section describes how to create a link between `The Sky X (TSX) <http://www.bisque.com/sc/pages/TheSkyX-Editions.aspx>`_ and the python gRPC interface to the dome hardware.

Requirements
---------------

``grpc python`` See instructions `here <https://grpc.io/docs/quickstart/python/>`_.
``grpc c++`` See instructions `here <https://grpc.io/docs/quickstart/cpp/>`_.

Getting Started
---------------

The code for the Huntsman dome driver is contained in the
``domehunter/protos/src`` directory. This directory contains both
human written files and files automatically generated by gRPC
tools. The human written files are,
``grpc c++`` See instructions `here <https://grpc.io/docs/quickstart/cpp/>`_.

* ``main.cpp`` - establishes main library to X2 driver (mostly copy/paste from example)
* ``main.h`` - header for main.cpp
* ``x2dome.cpp`` - the library code that serves the RPC from TSX to python server
* ``x2dome.h`` - header for x2dome.cpp
* ``hx2dome.proto`` - language agnostic RPC definitions used by everthing
* ``hx2dome.proto_server.py`` - python server that receives RPC from TSX
To install the above on OSX, run::

The remaining cpp and python files are automatically produced
by gRPC and shouldn't need to be looked at. If for some reason
you want to generate these files yourself, see the
*gRPC automatically generated files* section below.
pip install --upgrade pip
pip install grpcio
brew install protobuf-c
brew install grpc

Getting Started
---------------

The files for compilation and installation are found in the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't give a suggestion on the wording below, but maybe move "In order to compile the driver simply run the makefile recipe." before you state "You should be able to simply run the shell script" so someone can just follow the flow in order.

Also good to have a clear set of commands:

cd domehunter/protos/
make
sh TheSkyX_plugin_install.sh

``domehunter/protos/`` directory. The relevant files are,
Expand Down Expand Up @@ -90,8 +85,48 @@ adjusted to your local machine. You shouldn't need to worry about
this as the generated files are committed to the repositry and
shouldn't need to be generated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
shouldn't need to be generated.
shouldn't need to be generated. These files were used in the previous "Getting Started" step to create the `libHuntsmanDome.so` file, so no further editing of anything below is needed unless you need to XXX.


The code for the Huntsman dome driver is contained in the
``domehunter/protos/src`` directory. This directory contains both
human written files and files automatically generated by gRPC
tools. The human written files are,

* ``main.cpp`` - establishes main library to X2 driver (mostly copy/paste from example)
* ``main.h`` - header for main.cpp
* ``x2dome.cpp`` - the library code that serves the RPC from TSX to python server
* ``x2dome.h`` - header for x2dome.cpp
* ``hx2dome.proto`` - language agnostic RPC definitions used by everthing
* ``hx2dome.proto_server.py`` - python server that receives RPC from TSX

The remaining cpp and python files are automatically produced
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be moved somewhere else? It references its own section.

by gRPC and shouldn't need to be looked at. If for some reason
you want to generate these files yourself, see the
*gRPC automatically generated files* section below.


Python RaspberryPi Component
============================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This section shows how to setup and test the python dome controler, which is designed to work on a RaspberryPi AutomationHAT.

Requirements
---------------
Required:

* ``gpiozero`` python library

Optional:

* ``smbus`` and ``sn3218`` python libraries

Note:

The ``smbus`` and ``sn3218`` are used to control the automationHAT status
LEDs. If you plan on running the code without the automationHAT these libraries
aren't required.

Getting Started
---------------
Follow the example jupyter notebook in the examples direction
(``dome_control_example``). The automationHAT hardware is not required to run the
code in testing mode.


License
Expand All @@ -102,8 +137,3 @@ the terms of the BSD 3-Clause license. This package is based upon
the `Astropy package template <https://github.com/astropy/package-template>`_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe strip out the Astropy stuff in the readme (including the Astropy badge at top), unless you're really using it?

which is licensed under the BSD 3-clause licence. See the licenses folder for
more information.





Loading