-
Notifications
You must be signed in to change notification settings - Fork 3
Relay example type3
Follow "Environment construction" in Manual.
-
Edit the following “roscfe/cfs_converter/config.ini” file according to the worker's environment.
[setting] ; Output cfe directory path cfe_path=/home/jaxa/roscfe_ws/cFE-6.5.0-OSS-release/apps ; Output ros directory path ros_path=/home/jaxa/catkin_ws/src ; Log directory path log_dir_path=./ ; Set path of convert target pkg directory path and read target launch file target_path=./convert_list.txt ; Whether to create relay_node and relay_app(1: create, 0: not create) create_relay_flag=0 ; Set path of main function name setting main_func_path=./main_func_name.yaml
-
Change 1: Change "cfe_path" to match the path of "apps" in your cFE project.
Example)
cfe_path=/home/yuyuqq/cFE-6.5.0-OSS-release/apps
-
Change 2: Change "ros_path" to match the path of the ROS workspace.
Example)
ros_path=/home/yuyuqq/catkin_ws/src
-
-
Copy the "sample_sub_1" & "test_sub_1" directory from "roscfe/tutorial/ros_cfe_relay/type3/cfe/apps/sample_sub_1" & "roscfe/tutorial/ros_cfe_relay/type3/cfe/apps/test_sub_1" to cFE "apps" directory.
Example)
cp -r /home/yuyuqq/roscfe/tutorial/ros_cfe_relay/type3/cfe/apps/sample_sub_1 /home/yuyuqq/cFE-6.5.0-OSS-release/apps/ cp -r /home/yuyuqq/roscfe/tutorial/ros_cfe_relay/type3/cfe/apps/test_sub_1 /home/yuyuqq/cFE-6.5.0-OSS-release/apps/
-
Copy the "convert_lib" directory from "roscfe/convert_lib" to cFE "apps" directory.
Example)
cp -r /home/yuyuqq/roscfe/convert_lib /home/yuyuqq/cFE-6.5.0-OSS-release/apps/
-
Copy the "sample_pub" directory from "roscfe/sample_pub" to ROS "src" directory.
Example)
cp -r /home/yuyuqq/roscfe/sample_pub /home/yuyuqq/catkin_ws/src/
-
Copy the "test_pub" directory from "roscfe/tutorial/ros_cfe_relay/type3/ros/src/test_pub" to ROS "src" directory.
Example)
cp -r /home/yuyuqq/roscfe/tutorial/ros_cfe_relay/type3/ros/src/test_pub /home/yuyuqq/catkin_ws/src/
-
Edit "roscfe/cfs_converter/relay_base/relay_node_base/launch/Connection.launch". (** You can leave the default **)
<launch> <ros_relay_node protocol="tcp" port="9876" port_send="9877" ip_addr="127.0.0.1" ring_length="30" /> <cfe_relay_app port="9877" port_send="9876" ip_addr="127.0.0.1" ring_length="30" /> <include file="./MsgId2Topic.launch" /> </launch>
- The items that can be set:
- ros_relay_node tag, cfe_relay_app tag
- protocol: "tcp" or "udp"
- port: Relay message receiving port number
- port_send: Relay message sending port number
- ip_addr: IP address of the relay message destination (specify "127.0.0.1" for local execution)
- ring_length: Buffer size of incoming messages
- ros_relay_node tag, cfe_relay_app tag
- The items that can be set:
-
Edit the "roscfe/cfs_converter/relay_base/relay_node_base/launch/MsgId2Topic.launch" as follows.
<launch> <correspond topic="/ros_cfe_msg" msg_id="0x1900" cfe_data_type="std_msgs::Header" ros_data_type="std_msgs::Header" sender="0" /> <correspond topic="/ros_cfe_msg2" msg_id="0x1901" cfe_data_type="geometry_msgs::Pose" ros_data_type="geometry_msgs::Pose" sender="0" /> </launch>
-
Go to "roscfe/cfs_converter" and run "start_cfs_relay.sh".
cd roscfe/cfs_converter chmod +x start_cfs_relay.sh ./start_cfs_relay.sh
-
If the execution is successful, the following message will be displayed at the end of the output.
Finish creating cFS relay app & ROS relay node
-
After execution, "relay_app" directories will be created in the cFE project directory as shown below.
cFE-6.5.0-OSS-release `-- apps |-- XXXX |-- relay_app |-- XXXX |-- XXXX `-- XXXX
The "relay_node" directory is created in the ROS workspace as shown below.
catkin_ws `-- src |-- relay_node |-- XXXX `-- XXXX
-
-
Copy the "Makefile" from "roscfe/tutorial/ros_cfe_relay/type3/cfe/build/cpu1/Makefile" to cFE "build/cpu1" directory.
Example)
cp -r /home/yuyuqq/roscfe/tutorial/ros_cfe_relay/type3/cfe/build/cpu1/Makefile /home/yuyuqq/cFE-6.5.0-OSS-release/build/cpu1/
-
Copy the "cfe_es_startup.scr" from "roscfe/tutorial/ros_cfe_relay/type3/cfe/build/cpu1/exe/cfe_es_startup.scr" to cFE "build/cpu1/exe" directory.
Example)
cp -r /home/yuyuqq/roscfe/tutorial/ros_cfe_relay/type3/cfe/build/cpu1/exe/cfe_es_startup.scr /home/yuyuqq/cFE-6.5.0-OSS-release/build/cpu1/exe/
-
Go to the ROS workspace and run the following command
catkin_make clean catkin_make -i catkin_make
-
Go to "cFE-6.5.0-OSS-release" and execute the following commands in order
. ./setvars.sh cd build/cpu1 make config make
Follow the procedure below to subscribe to the message delivered by the ROS sample_pub node with the cFE conversion sample_sub app. (** Be sure to execute from the ROS side **)
-
Execute the following command to start roscore
roscore
-
Open a new terminal, go to the ROS workspace and execute the following command to start the relay node.
source devel/setup.bash rosrun relay_node relay_node
-
Open a new terminal, go to the ROS workspace and run the following command to launch the sample_pub node
source devel/setup.bash roslaunch sample_pub bringup.launch
You can see publication log on terminal.
.... [ INFO] [1606222912.840545830]: send msg.data: 785, rostimenow.toSec: 1606222912.840536 ....
-
Open a new terminal, go to the ROS workspace and run the following command to launch the test_pub node
source devel/setup.bash roslaunch test_pub bringup.launch
You can see publication log on terminal.
.... [ INFO] [1606222912.839616205]: send msg.position.x: 2525.000000, rostimenow.toSec: 1606222912.839606 ....
-
Go to "cFE-6.5.0-OSS-release" and execute the following commands in order to start the relay application, sample_sub_1 and test_sub_1 application.
cd build/cpu1/exe sudo su ./core-linux.bin
You can see subscription log on terminal, which has the same data as publication log.
.... EVS Port1 66/1/TEST_SUB 0: received data: 2525.000000 EVS Port1 66/1/TEST_SUB 0: received data: 785 ....