공부/SPACE

cFS 설치 및 실행하는방법

JUNFUTURE 2024. 4. 22. 00:26

Part1 - Setup

아래 깃허브 링크에서 cFS를 git clone 해준다.

https://github.com/nasa/cFS

 

GitHub - nasa/cFS: The Core Flight System (cFS)

The Core Flight System (cFS). Contribute to nasa/cFS development by creating an account on GitHub.

github.com

git clone https://github.com/nasa/cFS.git
cd cFS

# submodule 설치
git checkout bootes-rc2
git submodule init
git submodule update

 

이때 submodule update를 해주면 아래와 같이 뜨며
cFS/apps/*

cFS/tools/*

에 있는 폴더들이 채워진다.

 

 

default makefile 과 definitions 를 복사해주자 :

# cFS 경로에서
cp cfe/cmake/Makefile.sample Makefile
cp -r cfe/cmake/sample_defs sample_defs

이렇게 되면 된다.

 

리눅스 standard 빌드에서 일반 유저로 실습중이라면
OSAL의 “permissive mode” 를 키면 메세지 큐 깊이와 우선순위에 좋다고 한다.

OSAL_CONFIG_DEBUG_PERMISSIVE_MODE FALSE -> TRUE로

Part2 - Build and Run

cmake를 이용해서 cFS Framework를 실행 및 빌드할 수 있음

make prep
make
make install
cd build/exe/cpu1/
./core-cpu1

 

startup 메시지랑 CFE_ES_Main 이 OPERATIONAL state에 돌입하는 것을 확인할 수 있다.
startup script랑 shared objects 경로로 인해서 ./core-cpu1 (cFS 시작 스크립트)은
반드시 build/exe/cpu1 디렉터리에서 실행해야된다.

 

 

 

Exercise 2 - Command cFE Executive Service

Part 1 – Start the Ground System

cFS-GroundSystem tool을 이용해서 commands를 보내거나 telemetry를 받을 수 있다.

(see https://github.com/nasa/cFS-GroundSystem/tree/master/Guide-GroundSystem.txt, the Guide-GroundSystem.txt).

 

PyQt5랑 PyZMQ를 다운받아줘야한다.

pip install PyQt5
pip install PyZMQ

 

이후 GroundSystem을 실행해주자.

cd ~/cFS/tools/cFS-GroundSystem/Subsystems/cmdUtil
make
cd ../..
python3 GroundSystem.py

 

이후 다음과 같이 Sample_App에 No-op 커맨드를 전송해볼 수 있다.