ROS2 的底层通信修改为UDP的方法
1、创建 udp的xml文件,比如(udp.xml),内容如下:
<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastrtps_profiles">
<transport_descriptors>
<transport_descriptor>
<transport_id>udp_transport</transport_id>
<type>UDPv4</type>
</transport_descriptor>
</transport_descriptors>
<participant profile_name="udp_participant">
<rtps>
<userTransports>
<transport_id>udp_transport</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
</profiles>
<!--export FASTRTPS_DEFAULT_PROFILES_FILE=/home/nvidia/ros2/udpset.xml-->
2、使用方法
export FASTRTPS_DEFAULT_PROFILES_FILE=/xxx/....../udp.xml,例如:
export FASTRTPS_DEFAULT_PROFILES_FILE=/home/nvidia/ros2/udpset.xml
3、原始文件
见本博客附件.
评论已关闭