diff --git a/groundStation/documentation/getting_started.md b/groundStation/documentation/getting_started.md index f167d25354b710bcc1bbbabb2b4687d973d781b8..8f389ccb39b9bccae7b27e75ec352e14b31057fc 100644 --- a/groundStation/documentation/getting_started.md +++ b/groundStation/documentation/getting_started.md @@ -7,7 +7,7 @@ communicate with each other. The Ground Station has four main components includi * Graphical User Interface (GUI) * Frontend * Backend -Both the CLI and GUI are user interfaces. The GUI uses all the same commands and the +Both the CLI and GUI are user interfaces. The GUI uses all the same commands as the CLI but has extra functionality. The GUI shows the controls graph, provides extra navigation help, and will soon support real time graphing of the data. The Frontend does all the reading from and writing to the backend via a socket connected to the @@ -25,7 +25,7 @@ from the quad, an initialization file, and the Crazyflie adapter. The initializa and Crazyflie adapter are both proposed changes to the system. The VRPN connection gets trackable information from the camera system with an identifier for the trackable object. This allows for distinguishing between multiple trackables. The packets used between the -quad and the ground station as custom packets created specifically for reliable communication +quad and the ground station are custom packets created specifically for reliable communication over wifi to the quad. The initialization file will help with connecting multiple quads, or other flying machines to be connected into the lab setup. The Crazyflie adapter will allow the Crazyflies to work with the MicroCART system. diff --git a/groundStation/documentation/packets.md b/groundStation/documentation/packets.md index aae06aff451e55c18f58113169e85335cf285ff1..290d29d7ecde5975f66f979f72b83e158046e59a 100644 --- a/groundStation/documentation/packets.md +++ b/groundStation/documentation/packets.md @@ -1,7 +1,7 @@ # Packet Information # -The MicroCART project uses custom packets to communicate with the quad. This may seem complex at first -but the structure of all packets is the same it is just the way the data is formatted that changes +The MicroCART project uses custom packets to communicate with the quad. This may seem complex at first, +but the structure of all packets is the same, only the formatting of the data differs between packets. ## Introduction ## @@ -34,8 +34,7 @@ to copy the files from another command and change what you need. **CLI** -Adding to the CLI is an easy process as most of the code is used to display help messages to the user so that correct information is entered to be sent to the frontend -function that is talked about next. First, create a c file and c header file for your new commands. The [cli.c](../../groundStation/src/cli/cli.c) does not need to be editted +Adding to the CLI is an easy process as most of the code is used to display help messages to the user. First, create a c file and c header file for your new commands. The [cli.c](../../groundStation/src/cli/cli.c) does not need to be edited at all, but the header [cli.h](../../groundStation/src/cli/cli.h) needs to be changed to recognize the command that you enter. Include your new header file and add to CommandNameIds, cli_functions, and commandsNames. The header file you create only needs the functions your intend to create. Inside the c write the functions declared in the h file and make sure that you have all the checks for help and display the correct usage if need be. Then call the frontend function you create in the next step and print @@ -46,7 +45,7 @@ out the return if there is one. The GUI is programmed using QT as such it is written in C++ and uses a thread to do communication with the backend. The main files of the GUI to edit are [controlworker.h](../../groundStation/gui/MicroCART/controlworker.h) and [mainwindow.h](../../groundStation/gui/MicroCART/mainwindow.h) and the corresponding source files. To add connectivity to the backend add a slot and signal to the controlworker.h file and add a corresponding signal and slot on the mainwindow.h. Next, -connect the slots and signals in the mainwindow.cpp file and add any additional UI to the mainwindow.ui form. +connect the slots and signals in the [mainwindow.cpp](../../groundStation/gui/MicroCART/mainwindow.cpp) file and add any additional UI to the mainwindow.ui form. ### Frontend ### @@ -63,10 +62,10 @@ either your header file or [frontend_common.h](../../groundStation/src/frontend/ ### Backend ### The file that contains the main function in the backend is [backend.c](../../groundStation/src/backend/backend.c) and the message that is written by the frontend -is passed here. If a client connection sent the message that is being the function client_recv() will be called to handle the request. This function decides how -to process the data based upon the first word. If it is a command the is meant for the quadcopter a different path will be taken than if it is data being send from +is passed here. If a client connection sent the message that is being called, the function client_recv() will be called to handle the request. This function decides how +to process the data based upon the first word. If it is a command that is meant for the quadcopter a different path will be taken than if it is data being sent from the VRPN system. If you intend to send a packet this is where the first difference comes in, a command for the quadcopter should be declared in commands in the -quad directory (discussed later) so that it is recognized by the findCommand() function. If your function is not intended to send a packet your changes should be made +quad directory (discussed later) so that it is recognized by the findCommand() function. If your function is not intended to send a packet, your changes should be made in the condition that has msg_type = -1, otherwise take a look at the else condition. **The rest of the description is only needed when sending a packet**. You must create a file for encoding your new command. This will require a c file and c header @@ -88,8 +87,8 @@ add to the MessageTypes array so that the command, data type, and callback are a ### Quad_app ### -The only thing that needs to be done here is add the callback you defined in [commands.c](../../quad/src/commands/commands.c) to [callbacks.c](../../quad/src/quad_app/callbacks.c). -This callback should parse the data sent and all send a response if that is required. Here is also where you should define the data portion of the packet sent in a table so that +The only thing that needs to be done here is to add the callback you defined in [commands.c](../../quad/src/commands/commands.c) to [callbacks.c](../../quad/src/quad_app/callbacks.c). +This callback should parse the data sent and also send a response if that is required. Here is also where you should define the data portion of the packet sent in a table so that it can be understood by the next MicroCART team. Also remember to add the created tables to this markdown file to provide an easier means of seeing all the packets currently defined in the system. @@ -98,7 +97,7 @@ in the system. For all commands other than the message bundle packet there is a defined length and format for sending and receiving packets. Many of the formats will be discussed below. These packet formats are referenced from [callbacks.c](../../quad/src/quad_app/callbacks.c). -**Note:** this document may get out of date, [callbacks.c](../../quad/src/quad_app/callbacks.c) should have all the up to data packet formats. +**Note:** this document may get out of date. [callbacks.c](../../quad/src/quad_app/callbacks.c) should have all the up to date packet formats. ### setparam ### diff --git a/groundStation/src/backend/backend.c b/groundStation/src/backend/backend.c index 43e23cb4df38fa9b9f66d4a0d82a91492f83df70..a32de916f06618d31ead92445686d05bfd0f01ea 100644 --- a/groundStation/src/backend/backend.c +++ b/groundStation/src/backend/backend.c @@ -3,7 +3,6 @@ * Interface between Quad, front end, Virtual and VRPN tracker. * Main uses a standard socket select loop to receive data from any source described above. * Based on the data received from sockets it calls receive functions based on the socket received from. - * within the receive functions data is parsed using various */ #define _GNU_SOURCE diff --git a/groundStation/src/backend/param.c b/groundStation/src/backend/param.c index 91170cbb8907b811e286f9c2cf839a953cd50097..b5e027b0c0142d7ceddcb44cc9f4042172e008a1 100644 --- a/groundStation/src/backend/param.c +++ b/groundStation/src/backend/param.c @@ -61,7 +61,7 @@ ssize_t EncodeSetParam( struct metadata * m, /* data_len and msg_type will be populated*/ uint8_t * data, /* Output buffer */ size_t data_size, /* Max buffer size */ - const char * msg) /* Message to encode */ + const char * msg) /* Message to encode */ { m->msg_type = SETPARAM_ID; m->data_len = SP_DATA_SIZE;