15. File Transfer using CFDP
These instructions describe how to use our CFDP wrapper to transfer large files between flight and ground systems with cFS.
15.1. Setup
Note
Skip this part if you are using the Docker setup, as these steps are already done.
To use the CFDP ROS API to transfer files, you need to:
Make file transfer folders where the files transferred will be located: On the ground machine:
$ cd ~/code/brash $ mkdir -p cfdp/rosgsw
And on the flight machine:
$ cd ~/code/brash $ mkdir -p cfdp/rosfsw
Note that these locations can be really anywhere, these are the default locations (relative to the brash workspace).
15.2. Start the CFDP Wrapper Nodes
Note
Skip this part if you are using the Docker setup, as the wrapper nodes are started by default in that case.
Start the wrappers on each machine. On the ground machine:
$ cd ~/code/brash $ . install/local_setup.bash $ ros2 launch cfdp_wrapper cfdp_wrapper.launch.py entityID:=1 filestore:=cfdp/rosgsw
Note that the filestore is the folder defined above (relative to the brash workspace).
On the flight machine:
$ cd ~/code/brash $ . install/local_setup.bash $ ros2 launch cfdp_wrapper cfdp_wrapper.launch.py entityID:=2 filestore:=cfdp/rosfsw
15.3. Service Commands
To test these commands, you have to start the full setup (e.g. if in Docker, you need to be running gsw, rosgsw and rosfsw).
15.3.1. Listing directory contents
Ground : Directory listing of the flight system, put on ground system:
$ ros2 launch cfdp_wrapper cfdp_service_ls.launch.py dst:='dst1_ls.txt' dstid:=2
Flight : Directory listing of the ground system, put on flight system:
$ ros2 launch cfdp_wrapper cfdp_service_ls.launch.py dst:='dst2_ls.txt' dstid:=1
15.3.2. Get a file
Ground: Bring a file from flight system to the ground
$ ros2 launch cfdp_wrapper cfdp_service_get.launch.py src:='dst2_ls.txt' dst:='echodst2_ls.txt' dstid:=2
15.3.3. Put a file
Ground: Transfer a file from the ground system to the flight system (rosfsw):
$ ros2 launch cfdp_wrapper cfdp_service_put.launch.py src:='dst1_ls.txt' dst:='echodst1_ls.txt' dstid:=2
Ground: Transfer a file from the ground system to the cFE system:
$ ros2 launch cfdp_wrapper cfdp_service_put.launch.py src:='dst1_ls.txt' dst:='/cf/dst1_ls_fsw.txt' dstid:=25
Warning
Putting files from flight->ground (doing service call from rosfsw) is not working right now.
Flight: Command the flight software to initiate a put to send a file to the ground system:
$ ros2 launch cfdp_wrapper cfdp_service_put.launch.py src:='dst2_ls.txt' dst:='dst2_rosgsw.txt' dstid:=1