summaryrefslogtreecommitdiff
path: root/RocketView.mdwn
blob: 939597f657cd7d344ee01e8cd397c0756b468aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# <a name="&quot;_RocketView&quot;: PSAS Launch Vehic"></a> "RocketView": PSAS Launch Vehicle Telemetry Viewer

## <a name="Introduction"></a> Introduction

`rocketview` is PSAS' telemetry viewer for LV1b and later launch vehicles. LV1b's `rocketview` was a C/GTK+ application (see the below) and the current LV2 `rocketview` is a Java SDK 1.2 application.

## <a name="Specifications"></a> Specifications

- [[RocketViewRecoveryNode]] - Spec on how to display recovery node information in rocketview
- [[RocketViewGpsNode]] - Spec on how to display the GPS node info
- [[RocketViewApsNode]] - Spec on how to display the Avionics Power System node info
- [[RocketViewImuNode]] - Spec on how to display the IMU node info
- [[RocketViewLaunchPanel]] - Spec on the integrated [[LaunchControl]] panel.

----

## <a name="ALL OF THIS STUFF IS OUTMODED? O"></a> ALL OF THIS STUFF IS OUTMODED? OR?

_Yes, most of this should be moved to an old-rockview page. The archictecture and layout of [[RocketView]] changes frequently, so it shouldn't be documented here._

## <a name="Architecture"></a> Architecture

The Java implementation of our telemetry display software, RocketView, has several components. These are:

- an interface to [[CanMuxer]]
- a set of CAN message renderers
- a message dispatcher from CAN to the renderers
- a specialized stripchart GUI component
- a driver which integrates the other parts of the system together

### <a name="CanMuxer Interface"></a> [[CanMuxer]] Interface

`CanMessage` and `CanSocket` are defined as follows.

    public class CanMessage
    {
      protected short id;
      protected Date timestamp;
      protected byte body[];

      public CanMessage(short id, Date timestamp, byte body[])
      {
        this.id = id;
        this.timestamp = timestamp;
        this.body = body;
      }

      public short getId()
      {
        return id;
      }

      public Date getTimestamp()
      {
        return timestamp;
      }

      public byte[] getBody()
      {
        return body;
      }
    }

    interface CanSocket
    {
      public CanMessage read() throws IOException;
      public void write(CanMessage msg) throws IOException;
      public void close() throws IOException;
    }

The `TCPCanSocket` class implements `CanSocket` to provide a connection to a running [[CanMuxer]] instance.

The `LogCanSocket` class acts as a filter, passing calls to its methods through to an underlying `CanSocket` instance, but also logging all `CanMessage`s it sees to a file.

### <a name="CAN Renderers"></a> CAN Renderers

The `CanRenderer` interface is implemented by classes that wish to recieve `CanMessage`s from the dispatcher, presumably in order to display the contents of those messages through a GUI or other user interface. This interface is defined as follows.

    interface CanRenderer
    {
      public void render(CanMessage msg);
    }

### <a name="CAN Message Dispatcher"></a> CAN Message Dispatcher

The `Dispatcher` class tracks CAN renderers which have been registered with it and provides an event loop for processing messages from the rocket.

### <a name="Stripchart Widget"></a> Stripchart Widget

The `JStripChart` class accepts timestamped numbers and renders them on a scrolling timestamp-scaled scatterplot.

### <a name="Main Driver"></a> Main Driver

The `RocketView` class initializes the renderers, lays out a GUI, and passes control to the dispatcher.

## <a name="Assignments"></a> Assignments

Nathan Matsuda:

- Write dispatcher class

David Cassard:

- Write stripchart class

Greg Cheong:

- Read up on [java.net.Socket](http://java.sun.com/j2se/1.3/docs/api/java/net/Socket.html), [java.io](http://java.sun.com/j2se/1.3/docs/api/java/io/package-summary.html).InputStream/OutputStream, [java.awt.GridBagLayout](http://java.sun.com/j2se/1.3/docs/api/java/awt/GridBagLayout.html), and [Swing](http://java.sun.com/docs/books/tutorial/uiswing/index.html) in general
- Write CAN network class
- Write main (layout) class

----

# <a name="C/Gtk+ _RocketView"></a> C/Gtk+ RocketView

> This page is an attempt to document Rocketview, our current telemetry display software. Comments and questions are requested to help me make this documentation more complete.
>
> -- [[JameySharp]] - 09 Jan 2002

The source code for LV1b's version of Rocketview may be browsed online at <http://bart.cs.pdx.edu/cvsweb/cgi-bin/cvsweb.cgi/rocketview/> . The new version for LV2 is under development at <http://bart.cs.pdx.edu/cvsweb/cgi-bin/cvsweb.cgi/fc/rocketview/> . (As of this writing, the new version is nearly identical to the old one.)

## <a name="Telemetry transport: can.c"></a> <a name="Transport">Telemetry transport: can.c</a>

The transport is intended to be the same as that used by [[CanMuxer]], so that no special-purpose software is needed to deliver telemetry data to the ground. Transport details are mostly abstracted by libcan, part of [[CanMuxer]].

The transport handles splitting the telemetry stream into packets, but Rocketview is still responsible for interpreting the data in those packets. This layer selects a [[RocketView#DataProcessor]] to handle each packet based on the [[CanBusIDs]].

> **LV1b specifics: serial.c and the packet/ directory**
>
> The transport was over radio modems, so Rocketview communicated with a serial port. The protocol used is documented at [[GroundSupport#Telemetry]].
>
> serial.c handled opening and reading the serial port, buffering input until a complete packet arrived, calling the right packet decoder when a complete packet had been read, and passing the decoded packet to a [[RocketView#DataProcessor]].
>
> A domain-specific language was created to describe packet formats, including the order, types, and names of the fields in each type of packet. These descriptions were used to generate the packet decoders in the packet/ subdirectory.

## <a name="Data processing: processor.c"></a> <a name="DataProcessor">Data processing: processor.c</a>

Some calculations are done on the ground before presenting the telemetry data to the user.

- Samples from the pressure sensor are converted into altitude.

The remaining processing involves reporting the data to the right [[RocketView#GUI]] widgets.

- Altitude from pressure and/or GPS
- GPS latitude and longitude, status, and number of visible satellites
- Flight computer's current time
- [[StateMachineApr2003]] state transition messages
- IMU acceleration and rotation measurements

## <a name="Graphical interface: callbacks.c"></a> <a name="GUI">Graphical interface: callbacks.c, message.c, interface.c, support.c</a>

The GUI is written in GTK ( <http://www.gtk.org/> ), built using Glade ( <http://glade.gnome.org/> ).

### <a name="Chart widget: gtkchart.c"></a> Chart widget: gtkchart.c

[[BartMassey]] wrote a custom stripchart widget for this project.

## <a name="Authors"></a> Authors

[[BartMassey]] wrote the original GUI code. [[JameySharp]] wrote the original packet parsing and processing code. Both collaborated to complete the result.