Skip to content
Snippets Groups Projects
Commit 09d7b1dd authored by Roland Ottensamer's avatar Roland Ottensamer
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
**************************************
* ARIEL FGS HFS Repository CHANGELOG *
**************************************
################################################################################
V0.1:
4.May, 2022 Gerald Mösenlechner <gerald.moesenlechner@univie.ac.at>
Known open issues:
- HFS does not support centroid delays larger than the integration period of
the image. If a larger delay is configured, no centroid packet will be
sent, as the centroid is overwritten before it is sent, reseting the
delay.
- The error induced by random spacecraft jitter is only implemented as a
gaussian error term that is added at the end, which is configurable. This
will be adressed in a future version where the jitter error shall be based
of given power spectra.
- The transition between operating modes and channels is currently
implemented as a delay of a single integration period of the old mode
before the new mode/channel is applied. This will be changed once more
information on the detectors operation is available.
- The centroids are given with respect to the FBA and FBT reference frame
which are both centered on the center of the Detector reference frame.
Future version shall allow for configurable offsets between the frames.
################################################################################
This diff is collapsed.
This diff is collapsed.
MANUAL 0 → 100644
************************
* ARIEL FGS HFS MANUAL *
************************
The FGS HFS is based on the c++ object "FGS" defined in HFS_API.hpp. The
constructor for this object has following notation:
FGS(const char* config_file)
The config_file is the name and relative path to the xml config file. An example
of such a file is given in HFS_config.xml
################################################################################
To simulate measurement data, the method set_params is called. This method is
defined as:
int FGS::set_params(hfs_parameters update, centroid_packet *cent_packet)
################################################################################
The input signal coming from the simulation environment must be given in the
from of a hfs_parameters struct update. The struct is defined as follows:
- double position_quat[4]: unit quaterion for the attitude of the SC
(J2000-SC reference frame)
- double ang_rate[3]: angular rate of the SC in arcsec/s
- double time: simulation time of the update
- unsigned int sync_flag: 8Hz Sync flag comming from the environment
- unsigned int channel: FGS channel to be used (1 or 2)
- unsigned int save: Flag for generation of xml config file containing the
current status of the HFS, named after the current
simulation time (BEWARE: leaving this flag as 1 will
cause the HFS to continuously generate xml-files)
- unsigned int reset: Flag to reset the HFS to the original configuration
- unsigned int set_invalid: Flag to set the validity of all measuremets to false
- unsigned int mode: Operational mode, defined as an interger due to Simulink
not supporting chars. The equiviliant modes and numbers
are:
1: Acquisition
2: Tracking
Other: Standby (will result in mode 0 in the output)
################################################################################
The HFS will the generate an image and calculate a centroid that will update
the given output pointer once the simulation time matches the centroid packet
time-stamp. The output is the pointer centroid_packet *cent_packet which is a
cnetroid packet struct with following attributes:
- float x: Star position in x-direction of the FBT in mas
- float y: Star position in y-direction of the FBT in mas
- float time: time stamp of the measurement
- float last_sync: time stamp of the last excepted sync flag
- int validity_flag: flag if measurement shall be used for correction (0 or 1)
- float validity_index: Quality metric of the measurement: is either a float
from 0 - 1 for valid measurements or a tree digit
error code. The possible codes are:
100: Measurement set to invalid
111: image dimension is set to 0
101: image is constant
102: no star inside the image
103: star is not distinct feature
104: signal is below the given threshold
105: signal sigma is below the given threshold
106: Validity index is below the given threshold
107: No star matched the defined signal
(Acq only, signal outside of set tolerance)
- unsigned int magnitude: magnitude of the star in ADU
- unsigned int channel: configured channel
- unsigned int mode: configured mode
Makefile 0 → 100644
ifeq ($(OS), Windows_NT)
DLLEXT := .dll
else
DLLEXT := .so
endif
CC = gcc
CFLAGS += -fPIC -shared -lm -lfftw3 -fopenmp -O3 -lfftw3_omp -Wall -Werror
SRC_DIR = $(shell pwd)/src
TEST_DIR = $(shell pwd)/test
DEST_DIR = $(shell pwd)/src
INCLUDE_DIR = $(shell pwd)/src
TESTS = $(TEST_DIR)/HFSTest.o $(TEST_DIR)/HFSTestMain.o
LIBRARIES = $(DEST_DIR)/libutilities$(DLLEXT) $(DEST_DIR)/libdetector_features$(DLLEXT) $(DEST_DIR)/libfcu_algorithms$(DLLEXT)
TARGET_API = $(DEST_DIR)/libHFS_API$(DLLEXT)
$(LIBRARIES): $(DEST_DIR)/lib%$(DLLEXT): $(SRC_DIR)/%.c
$(CC) $< -shared -o $@ $(CFLAGS)
$(TARGET_API): $(DEST_DIR)/lib%$(DLLEXT): $(SRC_DIR)/%.cpp
$(CC) $< -shared -o $@ -L$(SRC_DIR) -lfcu_algorithms -lutilities -ldetector_features -ltinyxml2 -fopenmp -O3 -lstdc++ -xc++ -fPIC -Wall -Werror -Wl,-rpath=$(SRC_DIR)
$(TESTS): $(TEST_DIR)/%.o: $(TEST_DIR)/%.cpp
g++ -c $< -o $@ -L$(SRC_DIR) -lHFS_API -lcppunit -ltinyxml2 -lstdc++ -Wall -Wl,-rpath=$(SRC_DIR)
API_Test: $(TEST_DIR)/HFSTest.o $(TEST_DIR)/HFSTestMain.o
g++ $(TEST_DIR)/HFSTestMain.o $(TEST_DIR)/HFSTest.o -o $(TEST_DIR)/API_Test -L$(SRC_DIR) -lHFS_API -lcppunit -ltinyxml2 -lstdc++ -Wall -Werror -Wl,-rpath=$(SRC_DIR)
example: $(TEST_DIR)/example.cpp
g++ $(TEST_DIR)/example.cpp -o ./example.out -L$(SRC_DIR) -lHFS_API -ltinyxml2 -lstdc++ -Wall -Werror -Wl,-rpath=$(SRC_DIR)
scan:
@echo "+-----------------------+"
@echo "| running static checks |"
@echo "+-----------------------+"
@echo
@echo "1. CLANG"
scan-build -V make all
@echo "+--------------------------------+"
@echo "| finished running static checks |"
@echo "+--------------------------------+"
@echo
@echo "+--------------------+"
@echo "| running unit tests |"
@echo "+--------------------+"
@echo
make API_Test
$(TEST_DIR)/API_Test
@echo "+---------------------+"
@echo "| finished unit tests |"
@echo "+---------------------+"
@echo
all: $(LIBRARIES) $(TARGET_API)
@echo "finished building all targets"
.PHONY: clean
clean:
-${RM} $(SRC_DIR)/*.so
-${RM} $(TEST_DIR)/*.o
-${RM} example.out
ifeq ($(OS), Windows_NT)
DLLEXT := .dll
else
DLLEXT := .so
endif
CC = gcc
CFLAGS += -fPIC -shared -lm -lfftw3 -fopenmp -O3 -lfftw3_omp -Wall -Werror
SRC_DIR = $(shell pwd)/src
TEST_DIR = $(shell pwd)/test
DEST_DIR = $(shell pwd)/src
INCLUDE_DIR = $(shell pwd)/src
TESTS = $(TEST_DIR)/HFSTest.o $(TEST_DIR)/HFSTestMain.o
LIBRARIES = $(DEST_DIR)/libutilities$(DLLEXT) $(DEST_DIR)/libdetector_features$(DLLEXT) $(DEST_DIR)/libfcu_algorithms$(DLLEXT)
TARGET_API = $(DEST_DIR)/libHFS_API$(DLLEXT)
$(LIBRARIES): $(DEST_DIR)/lib%$(DLLEXT): $(SRC_DIR)/%.c
$(CC) $< -shared -o $@ $(CFLAGS)
$(TARGET_API): $(DEST_DIR)/lib%$(DLLEXT): $(SRC_DIR)/%.cpp
$(CC) $< -shared -o $@ -L$(SRC_DIR) -lfcu_algorithms -lutilities -ldetector_features -l:libtinyxml2.so.2 -lstdc++ -xc++ -fPIC -Wall -Werror -Wl,-rpath=$(SRC_DIR)
$(TESTS): $(TEST_DIR)/%.o: $(TEST_DIR)/%.cpp
g++ -c $< -o $@ -L$(SRC_DIR) -lHFS_API -lcppunit -l:libtinyxml2.so.2 -lstdc++ -Wall -Wl,-rpath=$(SRC_DIR)
API_Test: $(TEST_DIR)/HFSTest.o $(TEST_DIR)/HFSTestMain.o
g++ $(TEST_DIR)/HFSTestMain.o $(TEST_DIR)/HFSTest.o -o $(TEST_DIR)/API_Test -L$(SRC_DIR) -lHFS_API -lcppunit -l:libtinyxml2.so.2 -lstdc++ -Wall -Werror -Wl,-rpath=$(SRC_DIR)
example: $(TEST_DIR)/example.cpp
g++ $(TEST_DIR)/example.cpp -o ./example.out -L$(SRC_DIR) -lHFS_API -l:libtinyxml2.so.2 -lstdc++ -Wall -Werror -Wl,-rpath=$(SRC_DIR)
scan:
@echo "+-----------------------+"
@echo "| running static checks |"
@echo "+-----------------------+"
@echo
@echo "1. CLANG"
scan-build -V make all
@echo "+--------------------------------+"
@echo "| finished running static checks |"
@echo "+--------------------------------+"
@echo
@echo "+--------------------+"
@echo "| running unit tests |"
@echo "+--------------------+"
@echo
make API_Test
$(TEST_DIR)/API_Test
@echo "+---------------------+"
@echo "| finished unit tests |"
@echo "+---------------------+"
@echo
all: $(LIBRARIES) $(TARGET_API)
@echo "finished building all targets"
.PHONY: clean
clean:
-${RM} $(SRC_DIR)/*.so
-${RM} $(TEST_DIR)/*.o
-${RM} example.out
"""
file calculate_quaternion.py
author Gerald Mösenlechner (gerald.moesenlechner@univie.ac.at)
date May, 2022
Copyright
---------
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Brief
-----
Small command line tool for calculation of a quaternion
Overview
--------
This python script takes the star-name as given in the catalouge as a command
line input and calculates the quaternion needed to place the star in the center
of the detector. Requires pandas and numpy
"""
import numpy as np
import pandas as pd
import sys
def dot(vec1, vec2):
if len(vec1) != len(vec2):
raise Exception("Vectors must have the same size")
sum = 0
for i in range(len(vec1)):
sum += vec1[i]*vec2[i]
return sum
def cross3d(vec1, vec2):
if len(vec1) != len(vec2):
raise Exception("Vectors must have the same size")
output = np.zeros(3)
output[0] = vec1[1]*vec2[2] - vec1[2]*vec2[1]
output[1] = vec1[2]*vec2[0] - vec1[0]*vec2[2]
output[2] = vec1[0]*vec2[1] - vec1[1]*vec2[0]
return output
def norm(vec):
sum = 0
for i in range(len(vec)):
sum += vec[i]**2
return np.sqrt(sum)
def mult_quaternion(q1, q2):
q_out = np.zeros(4)
q_out[0] = q1[0]*q2[0] + dot(q1,q2)
vec = q1[0]*q2[1:] + q2[0]*q1[1:] + cross3d(q1[1:], q2[1:])
q_out[1] = vec[0]
q_out[2] = vec[1]
q_out[3] = vec[2]
return q_out
def calc_quaternion(star, sc):
quaternion_vector = cross3d(sc, star)
quaternion = np.zeros(4)
quaternion[0] = norm(sc)*norm(star)+dot(sc, star)
quaternion[1] = quaternion_vector[0]
quaternion[2] = quaternion_vector[1]
quaternion[3] = quaternion_vector[2]
quaternion = quaternion/norm(quaternion)
return quaternion
if __name__ == "__main__":
star_cat = pd.read_csv("./src/Star_catalouge.csv")
id = sys.argv[1]
star = star_cat.loc[star_cat['Name'] == id]
print("Quaternion for Star:", id)
star_vec = np.array((np.cos(star.dec)*np.cos(star.ra), np.cos(star.dec)*np.sin(star.ra), np.sin(star.dec)))
sc_vec = np.array((1.00000197, 0, -0.00017)) #target sc-vector
quat = calc_quaternion(sc_vec, star_vec)
print("\ts =", quat[0])
print("\tv1 =", quat[1])
print("\tv2 =", quat[2])
print("\tv3 =", quat[3])
print("Expected Signals:")
print("\tFGS1:")
print("\t\tTracking:", float(star.FGS1*0.125))
print("\t\tAcquisition:", float(star.FGS1*0.5))
print("\tFGS2:")
print("\t\tTracking:", float(star.FGS2*0.125))
print("\t\tAcquisition:", float(star.FGS2*0.5))
README 0 → 100644
****************************
* ARIEL FGS HFS Repository *
****************************
This repository contains the HFS, the simulator SW used to simulate the
behaviour of the FGS IASW for the AOCS closed loop test.
Files:
src/detector_features ........... Library for detector simulation (.c/.h)
src/utilities ................... Utility functions used by HFS (.c/.h)
src/fcu_algorithms .............. Implementation of IASW methods and algorithms (.c/.h)
src/HFS_API ..................... Main simulator and interface (.cpp/.hpp)
src/HFS_bus.mat ................. Simulink bus object definitions for HFS
src/HFS.config.xml .............. Config file for the HFS
src/Star_catalouge.csv .......... Catalouge containing the star data
matlab_model/HFS_Wrapper ........ Simulink implementation example using legacy code tools (.cpp/.hpp/.m)
matlab_model/Example_model.slx .. Simulink example showing the bus usage
test/HFSTest .................... Unit tests for the HFS library (.cpp/.hpp)
test/example.cpp ................ Example script showing the function of the library
Quaternion_Calulator.pxy ........ Python command-line tool for quaternion determination
CHANGELOG
README
MANUAL
Dependencies:
- tinyxml2 (2.6.2)
- fftw3-devel (3.3.3)
- openmpi-devel (1.10.7)
- cppunit (optional, needed by unit tests)
- doxygen (optional, needed by documenation)
- plantuml (optional, needed by documentation)
- python numpy (optional, needed by Quaternion_Calulator)
- python pandas (optional, needed by Quaternion_Calulator)
Build Library on CentOs 7.9
> make all -f Makefile_Centos
Run example:
> make example -f Makefile_Centos
> ./example.out
Build S-Function block example:
Build library:
> make all -f Makefile_Centos
Run HFS_Wrapper.m in Matlab
Run Quaternion_Calulator:
> python3 Quaternion_Calulator.py TARGET_STAR_ID
The software provided here is ©University of Vienna.
GM 5.May, 2022
This diff is collapsed.
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.11 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<detaileddescription title=""/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<detaileddescription title=""/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>
CSSFILES = $(shell ls *.css)
JSFILES = $(shell ls *.js)
HTFILES = header.html footer.html
.PHONY: all
all:
@which plantuml
@test -d html || mkdir html
doxygen
cp $(CSSFILES) $(JSFILES) $(HTFILES) html/
.PHONY: clean
clean:
rm -rf html
be sure to copy the .js and .css files to the html/ directory or they will not be found by the browser
doxygen requires plantuml to be installed in the current configuration
This diff is collapsed.
This diff is collapsed.
/*
h1, .h1, h2, .h2, h3, .h3{
font-weight: 200 !important;
}
*/
h1,.h1 {
font-size: 24px;
}
h2,.h2 {
font-size: 20px;
}
h3,.h3 {
font-size: 16px;
}
h4,.h4 {
font-size: 14px;
}
h5,.h5 {
font-size: 12px;
}
h6,.h6 {
font-size: 10px;
}
#navrow1, #navrow2, #navrow3, #navrow4, #navrow5{
border-bottom: 1px solid #706d6e;
}
.adjust-right {
margin-left: 30px !important;
font-size: 1.15em !important;
}
.navbar{
border: 0px solid #222 !important;
}
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
img {
max-width:100%;
max-height:100%;
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto;
/* Negative indent footer by its height */
margin: 0 auto -60px;
/* Pad bottom by footer height */
padding: 0 0 60px;
}
/* Set the fixed height of the footer here */
#footer {
font-size: 0.9em;
padding: 8px 0px;
background-color: #f5f5f5;
}
.footer-row {
line-height: 44px;
}
#footer > .container {
padding-left: 15px;
padding-right: 15px;
}
.footer-follow-icon {
margin-left: 3px;
text-decoration: none !important;
}
.footer-follow-icon img {
width: 20px;
}
.footer-link {
padding-top: 5px;
display: inline-block;
color: #999999;
text-decoration: none;
}
.footer-copyright {
text-align: center;
}
@media (min-width: 992px) {
.footer-row {
text-align: left;
}
.footer-icons {
text-align: right;
}
}
@media (max-width: 991px) {
.footer-row {
text-align: center;
}
.footer-icons {
text-align: center;
}
}
/* DOXYGEN Code Styles
----------------------------------- */
div.ingroups {
font-size: 16pt;
width: 50%;
text-align: left;
padding-top: 10px;
}
a.qindex {
font-size: 8pt;
}
a.qindexHL {
font-size: 9pt;
font-weight: bold;
background-color: #9CAFD4;
color: #ffffff;
border: 1px double #869DCA;
}
.contents a.qindexHL:visited {
color: #ffffff;
}
a.code, a.code:visited, a.line, a.line:visited {
color: #4665A2;
}
a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
color: #4665A2;
}
/* @end */
dl.el {
margin-left: -1cm;
}
pre.fragment {
border: 1px solid #C4CFE5;
background-color: #FBFCFD;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
word-wrap: break-word;
font-size: 8pt;
line-height: 125%;
font-family: monospace, fixed;
}
div.navtab {
text-align: left;
padding-left: 5px;
margin-right: 5px;
}
div.fragment {
padding: 4px 6px;
margin: 4px 8px 4px 2px;
border: 1px solid #C4CFE5;
}
div.line {
font-family: monospace, fixed;
font-size: 13px;
min-height: 13px;
line-height: 1.0;
text-wrap: unrestricted;
white-space: -moz-pre-wrap; /* Moz */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
text-indent: -53px;
padding-left: 53px;
padding-bottom: 0px;
margin: 0px;
-webkit-transition-property: background-color, box-shadow;
-webkit-transition-duration: 0.5s;
-moz-transition-property: background-color, box-shadow;
-moz-transition-duration: 0.5s;
-ms-transition-property: background-color, box-shadow;
-ms-transition-duration: 0.5s;
-o-transition-property: background-color, box-shadow;
-o-transition-duration: 0.5s;
transition-property: background-color, box-shadow;
transition-duration: 0.5s;
}
div.line.glow {
background-color: cyan;
box-shadow: 0 0 10px cyan;
}
span.lineno {
padding-right: 4px;
text-align: right;
border-right: 2px solid #0F0;
background-color: #E8E8E8;
white-space: pre;
}
span.lineno a {
background-color: #D8D8D8;
}
span.lineno a:hover {
background-color: #C8C8C8;
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
}
.caption {
font-weight: bold;
padding-top: 10px;
padding-bottom: 20px;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
blockquote {
background-color: #F7F8FB;
border-left: 2px solid #9CAFD4;
margin: 0 24px 0 4px;
padding: 0 12px 0 16px;
}
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
</div>
</div>
</div>
</div>
</div>
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
</a> $doxygenversion
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- For Mobile Devices -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<script type="text/javascript" src="jquery.js"></script>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<!--<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>-->
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="$relpath^bootstrap.min.css">
$extrastylesheet
<script src="$relpath^bootstrap.min.js"></script>
<script type="text/javascript" src="$relpath^doxy-boot.js"></script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand">
<img alt="Logo" align="left" style="margin-right: 1em;" src=$projectlogo/>
$projectname $projectnumber</a>
</div>
</div>
</nav>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div class="content" id="content">
<div class="container">
<div class="row">
<div class="col-sm-12 panel panel-default" style="padding-bottom: 15px;">
<div style="margin-bottom: 15px;">
<!-- end header part -->
File added
/**
* @file HFS_Wrapper.cpp
* @author Gerald Mösenlechner (gerald.moesenlechner@univie.ac.at)
* @date May, 2022
*
* @copyright
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* @brief Code for the Matlab Simulink S-function implementation example
*
*
* ## Overview
* This file contains functions to be used for the implementation of the HFS
* using the Matlab legacy code tool
*
*/
#include "../src/HFS_API.hpp"
FGS* fgsSim;
/**
* @brief Method to be used in legacy code tool of Matlab for creating FGS obj.
*
* @param config: Configuration file
*
*/
void createFGS()
{
fgsSim = new FGS("./HFS_config_model.xml");
}
/**
* @brief Method to be used in legacy code tool of Matlab for deleting FGS obj.
*
*/
void deleteFGS()
{
delete fgsSim;
}
/**
* @brief Method to be used in legacy code tool of Matlab
*
* @param fgs: FGS object to store state of simulation
* @param update: hfs parameters for update of state
*
* @return centroid packet containing the measurement
*/
void updateFGS(hfs_parameters *update, centroid_packet *output)
{
hfs_parameters u_new;
u_new.mode = update -> mode;
u_new.channel = update -> channel;
u_new.ang_rate[0] = update -> ang_rate[0];
u_new.ang_rate[1] = update -> ang_rate[1];
u_new.ang_rate[2] = update -> ang_rate[2];
u_new.position_quat[0] = update -> position_quat[0];
u_new.position_quat[1] = update -> position_quat[1];
u_new.position_quat[2] = update -> position_quat[2];
u_new.position_quat[3] = update -> position_quat[3];
u_new.time = update -> time;
u_new.reset = update -> reset;
u_new.save = update -> save;
u_new.set_invalid = update -> set_invalid;
u_new.sync_flag = update -> sync_flag;
fgsSim -> set_params(u_new, output);
}
#include "../src/HFS_API.hpp"
extern FGS *fgsSim;
extern void createFGS();
extern void deleteFGS();
extern void updateFGS(hfs_parameters*, centroid_packet*);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment