分类 ROS开发 下的文章



一、安装PlotJuggler

     sudo apt install ros-$ROS_DISTRO-plotjuggler-ros, 例如 

   

     sudo apt install ros-humble-plotjuggler-ros



二、安装接收ROS topic的插件

         sudo apt install ros-${ROS_DISTRO}-plotjuggler-ros

          例如:  sudo apt install ros-humble-plotjuggler-ros



三、运行

    ROS1运行:

          rosrun  plotjuggler  plotjuggler


   ROS2运行:

      ros2  run  plotjuggler  plotjuggler


四、显示波形配置步骤
















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、原始文件

     见本博客附件.





// The client used to control the nav2 stack
std::shared_ptr<nav2_lifecycle_manager::LifecycleManagerClient> client_nav_;
std::shared_ptr<nav2_lifecycle_manager::LifecycleManagerClient> client_loc_;


1、启动map_server节点:
       ros2  run  nav2_map_server  map_server  --ros-args   --param  yaml_filename:=/home/xi/rviz2/start_up/share/nav2_bringup/maps/cszj_map.yaml



2、激活map_server节点:

        ros2   lifecycle   set  /map_server   configure
        ros2   lifecycle   set  /map_server   activate



3、启动map静态坐标系转换:

     因为点云地图是基于UTM坐标系的,其数值太大,RVIZ不能正确显示,因此通过一个静态坐标系转换节点,作一个坐标系偏移.

     ros2 launch  ./static_tf2_broadcaster.py

4、启动Nav2导航栈:

       去掉默认的定位: AMCL

       ros2 launch   nav2_bringup   citi_robot_navigation_launch.py




5、启动定位节点(自己基于NDT算法,ESKF定位):
       ./robot_localization_node     ../config/robot_local_param.yaml

       注意: topic:/amcl_pose(好像必须为这个topic名字,Nav2才行,待确认!),  

       负责坐标系转换:全局定位(地图)与里程计坐标系,  map<------odometry


6、启动里程计节点(自己实现的里程计:轮速计+IMU+ESKF):
      ./robot_odometry_node      ../config/odometry/robot_odometry_param.yaml