I understand that you want to send the position and orientation of your ground robot from ROS1 as a topic via UDP to a ROS2 environment and build a system that can properly display the robot's traversed position using a ‘Display’ block.
Follow the plan below to accomplish this:
System 1: ROS1 (Sender - Raspberry Pi)
Step 1) Subscribe to the concerned topic (robot_pose) using the ‘Subscribe’ block and split the received ‘msg’ into separate signals (x, y, z) using a ‘Bus Selector’ block. Your existing pipeline already performs these steps
Step 2) To prepare the data for packet-based transmission via UDP, ensure that all three values (x, y, z) are in the correct format (preferably double) that UDP transmission requires (‘Data Type Conversion’ block can be used for this use case). You can optionally combine the individual x, y, z values into a single vector [x; y; z] too
Step 3) Use the ‘Byte Packing’ block to prepare the data for UDP transmission and then send its output (uint8 array) to the target IP/Port of the ‘UDP Send’ block
System 2: ROS2 (Receiver - PC)
Step 1) Use the ‘UDP Receive’ block to receive data from ‘UDP Send’ block
Step 2) Unpack the received byte stream using the ‘Byte Unpacking’ block
Step 3) Use ‘Display’ or ‘Scope’ blocks to visualize each numeric value from the outputs. Additionally, you can also use a ‘MATLAB Function’ block OR directly plot X-Y plots to track the robot trajectory in 2D.
Here are some points to remember:
- Set an appropriate and consistent sample time across all blocks to reflect real-time updates
- Both systems must be on the same network and time-synced if needed
- Look if additional steps are needed to convert the received ROS1 message to correct format before passing further in the pipeline
Refer to the following documentation links for more details:
Hope this helps!