Tutorial Eight: Rotator
This tutorial demonstrates how to create a simple rotator device driver. A rotator is a device that can rotate a camera or other instrument to a specific angle, which is useful for framing targets or for field de-rotation during long exposures.
What You’ll Learn
- How to create a rotator driver by inheriting from
INDI::RotatorInterface
- How to implement angle control and movement simulation
- How to handle rotator-specific properties and commands
- How to integrate the rotator interface with the DefaultDevice class
Source Code
The source code for this tutorial can be found in the INDI library repository under the examples/tutorial_eight
directory.
INDI Rotator Interface
The INDI Rotator Interface provides a standard way to control rotator devices. The key components are:
- Angle Control: Setting and reporting the rotator’s angle
- Movement Control: Starting, stopping, and monitoring rotator movement
- Reverse Direction: Ability to reverse the direction of rotation
Code Explanation
This tutorial demonstrates:
-
Rotator Implementation:
- Creating a class that inherits from
INDI::DefaultDevice
and implementsINDI::RotatorInterface
- Initializing rotator properties
- Implementing the required interface methods
- Creating a class that inherits from
-
Angle Control:
- Setting the target angle
- Simulating movement to the target angle
- Reporting the current angle
-
Additional Features:
- Implementing reverse direction functionality
- Handling abort commands
- Simulating realistic rotator behavior
Running the Tutorial
To run this tutorial:
-
Build the tutorial using CMake:
cd /path/to/indi/build make
-
Run the INDI server with the tutorial driver:
indiserver -v ./tutorial_eight
-
Connect to the server using an INDI client (like KStars/EKOS or INDI Control Panel).
-
You should see the rotator device in the client, and you can connect to it and control its angle.
Conclusion
This tutorial completes our series on INDI driver development. We’ve covered a wide range of topics, from basic device drivers to specialized interfaces and inter-driver communication. With these examples, you should have a solid foundation for developing your own INDI drivers for various astronomical devices.
For more information and advanced topics, please refer to the INDI Library Documentation and the INDI GitHub Repository.