项目作者: danielTobon43

项目描述 :
missioncontrolspaceservices inc entry test
高级语言: C
项目地址: git://github.com/danielTobon43/udp-client-server.git
创建时间: 2020-12-18T10:30:25Z
项目社区:https://github.com/danielTobon43/udp-client-server

开源协议:

下载


Height sensing subsystem (HSS)

Description: Implementation of the height sensing susbsytem in C and Windows 10, gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0, and CMake version 3.18.0-rc2.

Design decisions: I usually work in Ubuntu 16.04 but, my current laptop does not let me have two operating systems. On the other hand, I usually work in C++ or Python, but the program was made in C because I thought that was the programming language for this application. This program does not use any classes, just functions (a simple implementation).

How works

According to the documentation provided, there are two modules:

  1. listener:
    In this module I defined the UDP server interface to read data from the Lunar lander. It was set to port=12777 and host=”127.0.0.1”. This program initialize winsock (windows module for socket development), start a socket and then, wait for incoming data.

  2. publisher:
    In this module I defined the UDP client interface to send data from the Lunar lander. It was set to port=12777 and host=”127.0.0.1”. This program
    initialize winsock (windows module for socket development), start a socket and then, read the simulator file 2bytes-per line, apply a big-endian alignment and then, publish a message to the server.

The height is calculated with the following formula:

  1. height = (raw reading/65535)*1000

Then, I check if the height is close to zero to detect a landing event. For eacg LASER_ALTIMETER data from the simulator file, a message is send to the server with the following format:

  1. standard reading:
  2. HEIGHT val
  3. landing event:
  4. ENGINE_CUTOFF 0.0000

NOTE:

I assumed that the simulator file contain the raw readings from one or all of the sensing heads (since I did not find information about this in the documentation).

How to compile

Run these commands in the /build folder.

  1. create cmake files

    1. cmake ../ -G "MinGW Makefiles"
  2. compile

    1. make

How to run program:

Open two command lines and:

  1. for listener file.

    1. ./listener.exe
  2. for publisher file.
    ```
    ./publisher.exe

e.g.

./publisher.exe ../docs/simulator.txt
```

Example