Sparrow
From DGC Wiki
Categories: Components | Veh/Emb Components
Sparrow is a real-time, dynamic display utility that provides a simple mechanism for displaying and manipulating information on an ASCII terminal. It is used as a front end for a number of the embedded systems and planning team modules.
If you like Sparrow, you might also be interested in SparrowHawk (C++ interface with enhanced functionality) and Falcon (library of functions for implementing control laws).
|
Quick Links
|
Component Description
Component Specifications
The main specifications for sparrow are to be compatible with the race hardware and to run in near real-time, with minimal overhead.
| Name | Specification description | Test to verify | Status | ||||||||||
|
[edit] Curses |
Provide a curses interface that allows color text on race computers |
Run chntest on race computers and verify color text displays correctly. |
This can be tested at any time. Not a blocker. | ||||||||||
|
[edit] Real-Time Operation |
Update display at 10 Hz with less than 1% CPU loading |
Execute chntest and verify using top that less than 1% of CPU is being used. |
This can be tested at any time. Not a blocker. | </tr>
</table>
| Name | Interface description | Components | Owner | Status |
|
[edit] Planning |
Sparrow is called by a variety of embedded, planning and terrain modules |
vdrive, vstate, adrive, astate, path follower, mode management, LADAR mapper |
Currently operational </table> [edit] Additional Information[edit] Compiling sparrow on your own linuxWhile installing linux on my own laptop I found that these packages are required for sparrow to compile (and I didn't find any documentation about this elsewhere so here it is):
You might also need the lib- version of curses/termcap and the -devel version. --Henrik 20:02, 10 Aug 2004 (PDT) [edit] Using the sparrow interfaceBuilding a sparrow interface is quite a large task. Easiest is probably to look at some of the existing modules like dgc/bob/RaceModules/Arbiter2, dgc/bob/RaceModules/LADARMapper or dgc/bob/DevModules/StereoMapper and copy the SparrowDisplayLoop() and UpdateSparrowVariablesLoop() for modifying later. To use debug messages easily, the last row in the sparrow display can be used for printing strings with: DD_PROMPT(char* text); --Henrik 00:12, 15 Oct 2004 (PDT) [edit] Creating second level displays in sparrowIf you display is getting too crowded, you can create a secondary display table in sparrow. These are usually bound to a button at the top or bottom of the screen, so that you can click to switch to a new view. To create a second display screen, you first have to create a .dd file that defines what you want to see. This is done just as normal, but you need to make sure to use the 'tblname' and 'bufname' entries in your .dd file to give unique names to the display and buffer tables: tblname: astune; bufname: astune_buf; You now need to include both of the .h files generated by cdd. If you call one display table from the other, you should define the second table first (so that the variables are defined). Alternatively, you can include the following lines at the top of your .dd file: DD_IDENT *astune; Now you need to call the new table from the old one. To do this, just create a buttom entry of the following form: button: %TUNE "TUNE" dd_usetbl_cb -userarg=astune; The function 'dd_usetbl_cb' is defined in sparrow and changes the display to the one pointed to by the argument to the '-userarg' option. Inside of your new table, you can either link back to the first table with an explicit buttom, or use the 'dd_prvtbl_cb' function, which will return you to the previous table (only one previous table is stored, just in case you are thinking you can get fancy with display hierarchies): button: %RETURN "RETURN" dd_prvtbl_cb;--Murray 13:51, 2 Jul 2005 (PDT) |
![[Main Page]](../../../../upload/alice.jpg)