主机无法接收到机器人的发送,通过tcpdump抓包,在主机向机器人发送数据时,两端都能够抓取到数据包,而机器人向主机发送时,仅在机器人端能够抓取到数据包。
想要完成在主机接受机身摄像头发布的图像数据,但是主机无法发现机器人发布的主题
主机无法接收到机器人的发送,通过tcpdump抓包,在主机向机器人发送数据时,两端都能够抓取到数据包,而机器人向主机发送时,仅在机器人端能够抓取到数据包。
想要完成在主机接受机身摄像头发布的图像数据,但是主机无法发现机器人发布的主题
安装mirco-ROS-Agent,colcon build时,出现如下错误
7fcd7191-e5ec-49f7-ad18-e878624fcd45-image.png
我的系统是ubuntu20.04,用的ros是galactic,我在同步之前录制了一个bag包,包含6个相机和一个激光雷达的信息系,下面是bag包的相关信息:
c606@ubuntu:~/fyx/data_bag$ ros2 bag info rosbag2_2025_07_10-03_25_26 Files: rosbag2_2025_07_10-03_25_26_0.db3 Bag size: 2.4 GiB Storage id: sqlite3 Duration: 17.252s Start: Jul 10 2025 03:25:28.197 (1752143128.197) End: Jul 10 2025 03:25:45.450 (1752143145.450) Messages: 999 Topic information: Topic: /rslidar_points | Type: sensor_msgs/msg/PointCloud2 | Count: 173 | Serialization Format: cdr Topic: /camera1/pylon_ros2_camera_node/image_raw | Type: sensor_msgs/msg/Image | Count: 135 | Serialization Format: cdr Topic: /camera3/pylon_ros2_camera_node/image_raw | Type: sensor_msgs/msg/Image | Count: 137 | Serialization Format: cdr Topic: /camera2/pylon_ros2_camera_node/image_raw | Type: sensor_msgs/msg/Image | Count: 123 | Serialization Format: cdr Topic: /camera4/pylon_ros2_camera_node/image_raw | Type: sensor_msgs/msg/Image | Count: 144 | Serialization Format: cdr Topic: /camera5/pylon_ros2_camera_node/image_raw | Type: sensor_msgs/msg/Image | Count: 146 | Serialization Format: cdr Topic: /camera6/pylon_ros2_camera_node/image_raw | Type: sensor_msgs/msg/Image | Count: 141 | Serialization Format: cdr接着我写了一个功能包,作用是接受相机和雷达的话题,将话题内容同步后再以话题的形式发送出去,在写好节点代码后,我先通过命令ros2 run sys_time sys_time_node开启节点,再通过ros2 bag record -o synced_bag /clock $(ros2 topic list | grep "synced")命令开启录制,最后通过ros2 bag play rosbag2_2025_07_10-03_25_26 --loop --clock --read-ahead-queue-size 10000命令播放原始bag包。
在播放bag包后我发现同步节点的回调函数没有被调用,结束录制命令后我通过rqt_bag synced_bag命令查看时间戳,发现没有时间戳,这证明同步未进行或者同步失败了。
下面是我同步节点的运行日志:
c606@ubuntu:~/fyx/e2e_ws$ ros2 run sys_time sys_time_node
[INFO] [1752477350.845923197] [multi_sensor_sync]: 🚀 多传感器同步节点已启动 (ApproximateTime策略)
[WARN] [1752477359.044116748] []: Messages of type 6 arrived out of order (will print only once)
[WARN] [1752477376.810937820] []: Messages of type 3 arrived out of order (will print only once)
[WARN] [1752477376.825926258] []: Messages of type 0 arrived out of order (will print only once)
[WARN] [1752477376.831166002] []: Messages of type 2 arrived out of order (will print only once)
[WARN] [1752477376.840478915] []: Messages of type 5 arrived out of order (will print only once)
[WARN] [1752477376.891147241] []: Messages of type 1 arrived out of order (will print only once)
[WARN] [1752477377.102514764] []: Messages of type 4 arrived out of order (will print only once)
下面是我的同步节点代码:
#include <rclcpp/rclcpp.hpp> #include <sensor_msgs/msg/image.hpp> #include <sensor_msgs/msg/point_cloud2.hpp> #include <message_filters/subscriber.h> #include <message_filters/synchronizer.h> #include <message_filters/sync_policies/approximate_time.h> using ImageMsg = sensor_msgs::msg::Image; using PointCloud2Msg = sensor_msgs::msg::PointCloud2; class MultiSensorSync : public rclcpp::Node { public: MultiSensorSync() : Node("multi_sensor_sync") { // 增强QoS配置 auto qos = rclcpp::SensorDataQoS() .keep_last(20) // 增大缓存队列 .reliable() // 可靠传输模式 .durability_volatile(); // 允许历史数据 initPublishers(qos); initSubscribersAndSync(qos); RCLCPP_INFO(this->get_logger(), "🚀 多传感器同步节点已启动 (ApproximateTime策略)"); } private: void initPublishers(const rclcpp::QoS& qos) { for (int i = 0; i < 6; ++i) { cam_pubs_.push_back( this->create_publisher<ImageMsg>("/camera" + std::to_string(i+1) + "/synced/image_raw", qos) ); } lidar_pub_ = this->create_publisher<PointCloud2Msg>("/rslidar_points/synced", qos); } void initSubscribersAndSync(const rclcpp::QoS& qos) { // 创建相机订阅器 for (int i = 0; i < 6; ++i) { cam_subs_.push_back( std::make_shared<message_filters::Subscriber<ImageMsg>>( this, "/camera" + std::to_string(i+1) + "/pylon_ros2_camera_node/image_raw", qos.get_rmw_qos_profile() ) ); } // 创建雷达订阅器 lidar_sub_ = std::make_shared<message_filters::Subscriber<PointCloud2Msg>>( this, "/rslidar_points", qos.get_rmw_qos_profile() ); // 配置ApproximateTime策略 using SyncPolicy = message_filters::sync_policies::ApproximateTime< ImageMsg, ImageMsg, ImageMsg, ImageMsg, ImageMsg, ImageMsg, PointCloud2Msg>; // 创建同步器(增大时间窗口) sync_ = std::make_shared<message_filters::Synchronizer<SyncPolicy>>( SyncPolicy(50), // 队列大小增至50 *cam_subs_[0], *cam_subs_[1], *cam_subs_[2], *cam_subs_[3], *cam_subs_[4], *cam_subs_[5], *lidar_sub_ ); // 注册回调并绑定生命周期 sync_->registerCallback( std::bind(&MultiSensorSync::syncCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7 ) ); } void syncCallback( const ImageMsg::ConstSharedPtr& cam1, const ImageMsg::ConstSharedPtr& cam2, const ImageMsg::ConstSharedPtr& cam3, const ImageMsg::ConstSharedPtr& cam4, const ImageMsg::ConstSharedPtr& cam5, const ImageMsg::ConstSharedPtr& cam6, const PointCloud2Msg::ConstSharedPtr& lidar) { // 使用第一个相机的时间戳作为基准 //const auto& base_stamp = cam1->header.stamp; const auto& base_stamp = lidar->header.stamp; // 发布所有相机数据(统一时间戳) publishWithStamp(cam_pubs_[0], cam1, base_stamp); publishWithStamp(cam_pubs_[1], cam2, base_stamp); publishWithStamp(cam_pubs_[2], cam3, base_stamp); publishWithStamp(cam_pubs_[3], cam4, base_stamp); publishWithStamp(cam_pubs_[4], cam5, base_stamp); publishWithStamp(cam_pubs_[5], cam6, base_stamp); // 发布雷达数据(统一时间戳) auto new_lidar = std::make_shared<PointCloud2Msg>(*lidar); new_lidar->header.stamp = base_stamp; lidar_pub_->publish(*new_lidar); // 修复时间戳访问方式 RCLCPP_INFO(this->get_logger(), "🔥 同步发布 @ %d.%09d", base_stamp.sec, base_stamp.nanosec); } void publishWithStamp(rclcpp::Publisher<ImageMsg>::SharedPtr pub, const ImageMsg::ConstSharedPtr& msg, const builtin_interfaces::msg::Time& stamp) { auto new_msg = std::make_shared<ImageMsg>(*msg); new_msg->header.stamp = stamp; pub->publish(*new_msg); } // 成员变量 std::vector<rclcpp::Publisher<ImageMsg>::SharedPtr> cam_pubs_; std::vector<std::shared_ptr<message_filters::Subscriber<ImageMsg>>> cam_subs_; rclcpp::Publisher<PointCloud2Msg>::SharedPtr lidar_pub_; std::shared_ptr<message_filters::Subscriber<PointCloud2Msg>> lidar_sub_; using SyncPolicy = message_filters::sync_policies::ApproximateTime< ImageMsg, ImageMsg, ImageMsg, ImageMsg, ImageMsg, ImageMsg, PointCloud2Msg>; std::shared_ptr<message_filters::Synchronizer<SyncPolicy>> sync_; }; int main(int argc, char** argv) { rclcpp::init(argc, argv); rclcpp::executors::MultiThreadedExecutor executor; auto node = std::make_shared<MultiSensorSync>(); executor.add_node(node); executor.spin(); rclcpp::shutdown(); return 0; }最后还有一点,我录制的原始bag中相机和雷达的频率在10hz左右,下面是原始bag中的时间戳截图:
Screenshot from 2025-07-14 00-46-07.png
20463530-d3c1-4bc8-b699-776cafed8f9d-image.png
rviz显示如下8f421ede-a828-4232-a3b4-0ae7983716fe-image.png
rqt显示如下3dcb6256-528d-483f-8a24-980a0329e5b0-image.png
查看 map 无数据输出 odom无相关话题62e41c4b-f894-4f64-b0a6-5683e2b3e1bc-image.png
f468274a-ce94-4134-b849-ba15812a7b10-image.png
scan有输出8aedd05c-c5b2-43da-91db-7c65337983a7-image.png
851cdefd-0755-4a22-beeb-0a5c4212a9fe-image.png
42917dc4-86c4-4dce-9796-ecfb8cbe83f5-d0680705-af49-4751-90f3-d136d009ab53.png,出现了如下bug,怎么解决呢
~/chapt4/chapt4_ws$ colcon build
Starting >>> chapt4_interfaces
--- stderr: chapt4_interfaces
CMake Error at /opt/ros/jazzy/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:57 (message):
execute_process(/usr/bin/python3 -m rosidl_adapter --package-name
chapt4_interfaces --arguments-file
/home/zhaoyibo/chapt4/chapt4_ws/build/chapt4_interfaces/rosidl_adapter__arguments__chapt4_interfaces.json
--output-dir
/home/zhaoyibo/chapt4/chapt4_ws/build/chapt4_interfaces/rosidl_adapter/chapt4_interfaces
--output-file
/home/zhaoyibo/chapt4/chapt4_ws/build/chapt4_interfaces/rosidl_adapter/chapt4_interfaces.idls)
returned error code 1:
TypeError processing template 'srv.idl.em'
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/__main__.py", line 19, in <module> sys.exit(main()) ^^^^^^ File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/main.py", line 53, in main abs_idl_file = convert_to_idl( ^^^^^^^^^^^^^^^ File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/__init__.py", line 24, in convert_to_idl return convert_srv_to_idl( ^^^^^^^^^^^^^^^^^^^ File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/srv/__init__.py", line 39, in convert_srv_to_idl expand_template('srv.idl.em', data, output_file, encoding='iso-8859-1') File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/resource/__init__.py", line 29, in expand_template content = evaluate_template(template_name, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/resource/__init__.py", line 65, in evaluate_template _interpreter = em( ^^^TypeError: 'module' object is not callable
Call Stack (most recent call first):
/opt/ros/jazzy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:132 (rosidl_adapt_interfaces)
CMakeLists.txt:13 (rosidl_generate_interfaces)
Failed <<< chapt4_interfaces [0.58s, exited with code 1]
按照配套视频2.1.1节写代码,ctrl+c退出后生成日志:
[main:7]:Hello Python Node!
^CTraceback (most recent call last):
File "/home/aokawayou/chapt2/ros2_python_node.py", line 12, in <module>
main()
File "/home/aokawayou/chapt2/ros2_python_node.py", line 8, in main
rclpy.spin(node)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/init.py", line 226, in spin
executor.spin_once()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 751, in spin_once
self._spin_once_impl(timeout_sec)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 740, in _spin_once_impl
handler, entity, node = self.wait_for_ready_callbacks(timeout_sec=timeout_sec)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 723, in wait_for_ready_callbacks
return next(self._cb_iter)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 620, in _wait_for_ready_callbacks
wait_set.wait(timeout_nsec)
KeyboardInterrupt
然后ros2 node list显示为空,请问是怎么回事,问deepseek说是什么防火墙配置有问题,但按他生成的代码改还是会报错
机械臂关节采用JointTrajectoryController控制器,但是运行时总是无法加载yaml文件中相关参数
controller_manager: ros__parameters: update_rate: 100 # Hz dm_joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster dm_arm_controller: type: joint_trajectory_controller/JointTrajectoryController joints: - joint1 - joint2 - joint3 - joint4 - joint5 - joint6 command_interfaces: - position - velocity state_interfaces: - position - velocity action_name: follow_joint_trajectory interpolation_method: splines constraints: stopped_velocity_tolerance: 0.05 goal_time: 0.0 joint1: trajectory: 0.1 goal: 0.05 joint2: trajectory: 0.1 goal: 0.05 joint3: trajectory: 0.1 goal: 0.05 joint4: trajectory: 0.1 goal: 0.05 joint5: trajectory: 0.1 goal: 0.05 joint6: trajectory: 0.1 goal: 0.05 dm_hand_controller: type: joint_trajectory_controller/JointTrajectoryController joints: - joint7 command_interfaces: - position - velocity state_interfaces: - position - velocity action_name: follow_joint_trajectory interpolation_method: splines constraints: stopped_velocity_tolerance: 0.05 goal_time: 0.0 joint7: trajectory: 0.1 goal: 0.05launch文件中加载参数
controller_manager_node = launch_ros.actions.Node( package='controller_manager', executable='ros2_control_node', name='controller_manager', parameters=[ {'robot_description': robot_description_value}, ros2_control_yaml_path ], output='screen' )启动信息
[INFO] [launch]: All log files can be found below /home/hizaml/.ros/log/2025-07-09-22-24-00-351696-Hizam-82561 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [82563] [INFO] [rviz2-2]: process started with pid [82565] [INFO] [ros2_control_node-3]: process started with pid [82567] [robot_state_publisher-1] [INFO] [1752071040.539492469] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1752071040.539638296] [robot_state_publisher]: got segment dummy [robot_state_publisher-1] [INFO] [1752071040.539650469] [robot_state_publisher]: got segment link1 [robot_state_publisher-1] [INFO] [1752071040.539655158] [robot_state_publisher]: got segment link2 [robot_state_publisher-1] [INFO] [1752071040.539659015] [robot_state_publisher]: got segment link3 [robot_state_publisher-1] [INFO] [1752071040.539662822] [robot_state_publisher]: got segment link4 [robot_state_publisher-1] [INFO] [1752071040.539666589] [robot_state_publisher]: got segment link5 [robot_state_publisher-1] [INFO] [1752071040.539670186] [robot_state_publisher]: got segment link6 [robot_state_publisher-1] [INFO] [1752071040.539673713] [robot_state_publisher]: got segment link7_1 [robot_state_publisher-1] [INFO] [1752071040.539677460] [robot_state_publisher]: got segment link7_2 [robot_state_publisher-1] [INFO] [1752071040.539681137] [robot_state_publisher]: got segment link_hand [rviz2-2] QStandardPaths: wrong permissions on runtime directory /run/user/1000/, 0755 instead of 0700 [ros2_control_node-3] [WARN] [1752071040.549684168] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use '~/robot_description' topic from 'robot_state_publisher' instead. [ros2_control_node-3] [INFO] [1752071040.550035775] [resource_manager]: Loading hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071040.550712710] [resource_manager]: Initialize hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071040.550881711] [DmArmHardware]: 对了,对了!!!关节数为:7 [ros2_control_node-3] [INFO] [1752071040.553177870] [DmArmHardware]: hardware initialize successfully [ros2_control_node-3] [INFO] [1752071040.553246200] [resource_manager]: Successful initialization of hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071040.553414089] [resource_manager]: 'configure' hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071040.553424699] [resource_manager]: Successful 'configure' of hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071040.553430690] [resource_manager]: 'activate' hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071041.254576291] [DmArmHardware]: all motors enable successfully [ros2_control_node-3] [INFO] [1752071041.254646475] [resource_manager]: Successful 'activate' of hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071041.261977552] [controller_manager]: update rate is 100 Hz [ros2_control_node-3] [INFO] [1752071041.262037335] [controller_manager]: Spawning controller_manager RT thread with scheduler priority: 50 [ros2_control_node-3] [WARN] [1752071041.262176690] [controller_manager]: No real-time kernel detected on this system. See [https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html] for details on how to enable realtime scheduling. [rviz2-2] [INFO] [1752071043.449363084] [rviz2]: Stereo is NOT SUPPORTED [rviz2-2] [INFO] [1752071043.449661230] [rviz2]: OpenGl version: 4.2 (GLSL 4.2) [rviz2-2] [INFO] [1752071043.506870636] [rviz2]: Stereo is NOT SUPPORTED [INFO] [spawner-4]: process started with pid [82676] [ros2_control_node-3] [INFO] [1752071044.152492026] [controller_manager]: Loading controller 'dm_joint_state_broadcaster' [ros2_control_node-3] [WARN] [1752071044.157073422] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [spawner-4] [INFO] [1752071044.202711759] [spawner_dm_joint_state_broadcaster]: Loaded dm_joint_state_broadcaster [ros2_control_node-3] [INFO] [1752071044.206101538] [controller_manager]: Configuring controller 'dm_joint_state_broadcaster' [ros2_control_node-3] [INFO] [1752071044.206280608] [controller_manager]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published [spawner-4] [INFO] [1752071044.244925844] [spawner_dm_joint_state_broadcaster]: Configured and activated dm_joint_state_broadcaster [INFO] [spawner-4]: process has finished cleanly [pid 82676] [INFO] [spawner-5]: process started with pid [82708] [ros2_control_node-3] [INFO] [1752071046.141788692] [controller_manager]: Loading controller 'dm_arm_controller' [ros2_control_node-3] [WARN] [1752071046.148223692] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [ros2_control_node-3] [WARN] [1752071046.163136248] [controller_manager]: [Deprecated]: "allow_nonzero_velocity_at_trajectory_end" is set to true. The default behavior will change to false. [spawner-5] [INFO] [1752071046.188710095] [spawner_dm_arm_controller]: Loaded dm_arm_controller [ros2_control_node-3] [INFO] [1752071046.190602551] [controller_manager]: Configuring controller 'dm_arm_controller' [ros2_control_node-3] [WARN] [1752071046.190727137] [controller_manager]: 'joints' parameter is empty. [ros2_control_node-3] [INFO] [1752071046.190740211] [controller_manager]: No specific joint names are used for command interfaces. Using 'joints' parameter. [ros2_control_node-3] [ERROR] [1752071046.190745992] [controller_manager]: 'command_interfaces' parameter is empty. [ros2_control_node-3] [ERROR] [1752071046.190754288] [controller_manager]: After configuring, controller 'dm_arm_controller' is in state 'unconfigured' , expected inactive. [spawner-5] [ERROR] [1752071046.191433815] [spawner_dm_arm_controller]: Failed to configure controller [ERROR] [spawner-5]: process has died [pid 82708, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner dm_arm_controller --controller-manager controller_manager --ros-args']. [INFO] [spawner-6]: process started with pid [82725] [ros2_control_node-3] [INFO] [1752071047.126284023] [controller_manager]: Loading controller 'dm_hand_controller' [ros2_control_node-3] [WARN] [1752071047.126583410] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [ros2_control_node-3] [WARN] [1752071047.140239527] [controller_manager]: [Deprecated]: "allow_nonzero_velocity_at_trajectory_end" is set to true. The default behavior will change to false. [spawner-6] [INFO] [1752071047.157263783] [spawner_dm_hand_controller]: Loaded dm_hand_controller [ros2_control_node-3] [INFO] [1752071047.159341579] [controller_manager]: Configuring controller 'dm_hand_controller' [ros2_control_node-3] [WARN] [1752071047.159564711] [controller_manager]: 'joints' parameter is empty. [ros2_control_node-3] [INFO] [1752071047.159711239] [controller_manager]: No specific joint names are used for command interfaces. Using 'joints' parameter. [ros2_control_node-3] [ERROR] [1752071047.159722059] [controller_manager]: 'command_interfaces' parameter is empty. [ros2_control_node-3] [ERROR] [1752071047.159741316] [controller_manager]: After configuring, controller 'dm_hand_controller' is in state 'unconfigured' , expected inactive. [spawner-6] [ERROR] [1752071047.160704752] [spawner_dm_hand_controller]: Failed to configure controller [ERROR] [spawner-6]: process has died [pid 82725, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner dm_hand_controller --controller-manager controller_manager --ros-args']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [rviz2-2] [INFO] [1752071595.186616144] [rclcpp]: signal_handler(signum=2) [robot_state_publisher-1] [INFO] [1752071595.186621174] [rclcpp]: signal_handler(signum=2) [ros2_control_node-3] [INFO] [1752071595.186613069] [rclcpp]: signal_handler(signum=2) [ros2_control_node-3] [INFO] [1752071595.186994806] [controller_manager]: Shutdown request received.... [ros2_control_node-3] [INFO] [1752071595.187377965] [controller_manager]: Shutting down all controllers in the controller manager. [ros2_control_node-3] [INFO] [1752071595.187514445] [controller_manager]: Deactivating controller 'controller_manager' [ros2_control_node-3] [INFO] [1752071595.187616679] [controller_manager]: Shutting down controller 'controller_manager' [ros2_control_node-3] [INFO] [1752071595.187846415] [controller_manager]: Shutting down controller 'controller_manager' [ros2_control_node-3] [INFO] [1752071595.187911499] [controller_manager]: Shutting down controller 'controller_manager' [ros2_control_node-3] [INFO] [1752071595.188175932] [resource_manager]: 'deactivate' hardware 'DmArmHardware' [INFO] [robot_state_publisher-1]: process has finished cleanly [pid 82563] [INFO] [rviz2-2]: process has finished cleanly [pid 82565] [ros2_control_node-3] [INFO] [1752071595.889474691] [DmArmHardware]: all motors disable successfully [ros2_control_node-3] [INFO] [1752071595.889542410] [resource_manager]: Successful 'deactivate' of hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071595.889551787] [resource_manager]: 'shutdown' hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071595.889557699] [resource_manager]: Successful 'shutdown' of hardware 'DmArmHardware' [ros2_control_node-3] [INFO] [1752071595.889590281] [controller_manager]: Shutting down the controller manager. [INFO] [ros2_control_node-3]: process has finished cleanly [pid 82567]``` code_text通过电脑PC端和MobaXterm工具ssh连接Ubuntu22.04下的ROS2系统会导致运行的机器人的导航崩溃。
以下是报错打印信息:
r dropping message: frame 'camera_depth_frame' at time 1752048089.514 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Jul 09 00:01:30 localhost.localdomain bash[846]: [map.py-2] [controller_server-1] [INFO] [1752048090.733266201] [local_costmap.local_costmap]: Message Filter dropping message: frame 'camera_depth_frame' at time 1752048089.619 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Jul 09 00:01:30 localhost.localdomain bash[846]: [map.py-2] [controller_server-1] [INFO] [1752048090.833015331] [local_costmap.local_costmap]: Message Filter dropping message: frame 'camera_depth_frame' at time 1752048089.716 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Jul 09 00:01:30 localhost.localdomain bash[846]: [map.py-2] [controller_server-1] [INFO] [1752048090.878677101] [local_costmap.local_costmap]: Message Filter dropping message: frame 'camera_depth_frame' at time 1752048089.818 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Jul 09 00:01:31 localhost.localdomain bash[846]: [charging_manager.py-4] [INFO] [1752048091.431151796] [charging_manager]: 电池电量: 67.0%
Jul 09 00:01:31 localhost.localdomain bash[846]: [charging_manager.py-4] [INFO] [1752048091.433845382] [charging_manager]: 当前机器人状态: IDLE
Jul 09 00:01:31 localhost.localdomain bash[846]: [charging_manager.py-4] [INFO] [1752048091.438878256] [charging_manager]: 电池电量: 67.0%
Jul 09 00:01:31 localhost.localdomain bash[846]: [charging_manager.py-4] [INFO] [1752048091.440975554] [charging_manager]: 充电请求标志: False
Jul 09 00:01:31 localhost.localdomain bash[846]: [charging_manager.py-4] [INFO] [1752048091.443213488] [charging_manager]: 恢复请求标志: False
Jul 09 00:01:32 localhost.localdomain bash[846]: [localization_manager.py-3] [amcl-2] [INFO] [1752048092.257164954] [amcl]: Message Filter dropping message: frame 'laser_link' at time 1752048091.180 for reason 'the timestamp on the message is earlier than all the data in the transform cache'
Jul 09 00:01:32 localhost.localdomain bash[846]: [localization_manager.py-3] [lifecycle_manager-3] [INFO] [1752048092.278662931] [lifecycle_manager_localization]: Have not received a heartbeat from amcl.
Jul 09 00:01:32 localhost.localdomain bash[846]: [localization_manager.py-3] [lifecycle_manager-3] [ERROR] [1752048092.278842934] [lifecycle_manager_localization]: CRITICAL FAILURE: SERVER amcl IS DOWN after not receiving a heartbeat for 4000 ms. Shutting down related nodes.
Jul 09 00:01:32 localhost.localdomain bash[846]: [localization_manager.py-3] [lifecycle_manager-3] [INFO] [1752048092.278918293] [lifecycle_manager_localization]: Terminating bond timer...
Jul 09 00:01:32 localhost.localdomain bash[846]: [localization_manager.py-3] [lifecycle_manager-3] [INFO] [1752048092.278970490] [lifecycle_manager_localization]: Resetting managed nodes...
Jul 09 00:01:32 localhost.localdomain bash[846]: [localization_manager.py-3] [lifecycle_manager-3] [INFO] [1752048092.279018979] [lifecycle_manager_localization]: Deactivating amcl
Jul 09 00:01:32 localhost.localdomain bash[846]: [make_robot_pose.py-6] [INFO] [1752048092.409753588] [make_robot_pose]: TF Status:
Jul 09 00:01:32 localhost.localdomain bash[846]: [make_robot_pose.py-6] map -> odom: OK
Jul 09 00:01:32 localhost.localdomain bash[846]: [make_robot_pose.py-6] odom -> base_footprint: OK
Jul 09 00:01:32 localhost.localdomain bash[846]: [make_robot_pose.py-6] Last successful pose: 6.2s ago
Jul 09 00:01:32 localhost.localdomain bash[846]: [make_robot_pose.py-6] Consecutive timeouts: 0
Jul 09 00:01:33 localhost.localdomain bash[846]: [map.py-2] [lifecycle_manager-8] [INFO] [1752048093.083513167] [lifecycle_manager_navigation]: Have not received a heartbeat from controller_server.
Jul 09 00:01:33 localhost.localdomain bash[846]: [map.py-2] [lifecycle_manager-8] [ERROR] [1752048093.083654637] [lifecycle_manager_navigation]: CRITICAL FAILURE: SERVER controller_server IS DOWN after not receiving a heartbeat for 4000 ms. Shutting down related nodes.
Jul 09 00:01:33 localhost.localdomain bash[846]: [map.py-2] [lifecycle_manager-8] [INFO] [1752048093.083700544] [lifecycle_manager_navigation]: Terminating bond timer...
Jul 09 00:01:33 localhost.localdomain bash[846]: [map.py-2] [lifecycle_manager-8] [INFO] [1752048093.083733537] [lifecycle_manager_navigation]: Resetting managed nodes...
Jul 09 00:01:33 localhost.localdomain bash[846]: [map.py-2] [lifecycle_manager-8] [INFO] [1752048093.083766405] [lifecycle_manager_navigation]: Deactivating velocity_smoother
Jul 09 00:01:37 localhost.localdomain bash[846]: [map.py-2] [behavior_server-4] [WARN] [1752048097.340890566] [behavior_server]: Exceeded time allowance before reaching the DriveOnHeading goal - Exiting DriveOnHeading
Jul 09 00:01:37 localhost.localdomain bash[846]: [map.py-2] [behavior_server-4] [WARN] [1752048097.341021872] [behavior_server]: backup failed
Jul 09 00:01:37 localhost.localdomain bash[846]: [map.py-2] [behavior_server-4] [WARN] [1752048097.341065612] [behavior_server]: [backup] [ActionServer] Aborting handle.
Jul 09 00:01:37 localhost.localdomain bash[846]: [make_robot_pose.py-6] [INFO] [1752048097.410241699] [make_robot_pose]: TF Status:
Jul 09 00:01:37 localhost.localdomain bash[846]: [make_robot_pose.py-6] map -> odom: OK
Jul 09 00:01:37 localhost.localdomain bash[846]: [make_robot_pose.py-6] odom -> base_footprint: OK
Jul 09 00:01:37 localhost.localdomain bash[846]: [make_robot_pose.py-6] Last successful pose: 11.2s ago
Jul 09 00:01:37 localhost.localdomain bash[846]: [make_robot_pose.py-6] Consecutive timeouts: 0
Jul 09 00:01:42 localhost.localdomain bash[846]: [make_robot_pose.py-6] [INFO] [1752048102.411102926] [make_robot_pose]: TF Status:
Jul 09 00:01:42 localhost.localdomain bash[846]: [make_robot_pose.py-6] map -> odom: OK
Jul 09 00:01:42 localhost.localdomain bash[846]: [make_robot_pose.py-6] odom -> base_footprint: OK
Jul 09 00:01:42 localhost.localdomain bash[846]: [make_robot_pose.py-6] Last successful pose: 16.2s ago
队列满(Queue is full):激光雷达消息产生速度超过 RViz 消息队列处理速度,导致队列溢出丢消息。
时间戳过期(Timestamp earlier):激光雷达消息时间戳早于 TF 变换缓存中的数据,无法找到对应坐标变换,所以丢弃。
use_sim_time看了下都是True
9251321e-c810-48f7-a391-3781cc9bacec-image.png
2c56dcc2-3fdf-4d47-8a4f-5cfb7fb84c46-image.png
config的demo.launch后plan总是failed。编译都成功了,不知道为什么这个总是失败
b96b6680-40e9-425c-ad94-826be8d0c082-8fcac261f63f6f452d8639840c18b0a.jpg
小鱼,请问一下最新的v1.8的板子排针按上后没有电信号也没有电流需要怎么激活呀
Traceback (most recent call last):
File "/home/ebox12/connect_ws/install/time_communication/lib/time_communication/time_publisher", line 11, in <module>
load_entry_point('time-communication', 'console_scripts', 'time_publisher')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/ebox12/connect_ws/build/time_communication/time_communication/time_publisher.py", line 4, in <module>
from time_communication.msg import TimeData
ModuleNotFoundError: No module named 'time_communication.msg'
daff6682-a791-405f-b75d-24080aa3f823-image.png
setup.py
a3c31ccf-6d6b-4dce-8e9f-5c010ede17d6-image.png
package.xml
74254411-83df-4f39-97da-03d00d3aae30-image.png
TimeData.msg
561a58d7-7430-4889-aa1a-eef0e00e28a4-image.png
现在我们的unitree g1机器人的ip为192.168.123.4,我么的自己的主机ip为192.168.123.123,二者通过网线连接,且可以相互ping通,两个主机都已经关闭了防火墙。
我们需要让192.168.123.4接收到来自192.168.123.123的topic,但是经过尝试,在192.168.123.123运行ros2 run demo_nodes_cpp talker; 在192.168.123.4运行ros2 run demo_nodes_cpp listener ,但是没有正常输出。关于二者的有关ROS的环境变量:
(g1) unitree@ubuntu:</del>/g1_deploy/g1$ printenv | grep ROS
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_DOMAIN_ID=42
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=foxy
(base) franka@franka-HP-Z2-Tower-G9-Workstation-Desktop-PC:<del>/zjm/Livox-SDK2$ printenv | grep ROS
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_DOMAIN_ID=42
ROS_LOCALHOST_ONLY=0
ROS_DISTRO=foxy
想问问可能是什么原因导致192.168.123.123的topic无法正常被192.168.123.4订阅?
bf1756a2-d40f-4b21-a569-ee6c57dcdae4-image.png
69a479b5-ad4a-4ce2-aeaa-903134d37400-image.png
1ed41aac-79a1-43ad-94fa-1cd629c4a743-image.png
944d2d0f-0237-4ced-b347-489e5dc90f21-image.png
大佬们,请教一个问题,我的环境是ros1 noetic。我利用moveit进行运动规划;启动以后,在rviz中的motionplanning中的scene objects添加物体,publish出去以后。我进行运动规划的时候感觉并没有识别到我发布的这个物体。不知道是什么原因;是没有成功发布?还是发布的物体没有看来障碍物?还是需要什么其他的设置呢。
5c3c591c-a5c7-4745-b751-0f3ddd78725d-image.png
《ROS 2机器人开发》书中114页通过节点修改参数,书里面讲述的例子是修改的模型这个参数,如果想修改检测次数upsample_times这个参数应该怎么做,我模仿书中修改模型model参数的例子写了但是不行,请教一下应该怎么办?
是不是SetParameters里面的integer_value不是检测次数
new_model_value.integer_value=int(detect_times)这一行应该是有问题,请教应该怎么修改。
51cfb266-ea72-47a5-b4c5-8f3b4649e5f5-image.png controller_manager:
ros__parameters:
update_rate: 100 # Hz
use_sim_time: true
fishbot_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
use_sim_time: true
update_rate: 50
rear_wheels_velocity_controller:
type: ackermann_steering_controller/AckermannSteeringController
fishbot_front_wheels_position_controller:
ros__parameters:
版块
-
1.3k
主题4.9k
帖子 -
445
主题2.9k
帖子 -
66
主题259
帖子 -
1.1k
主题4.3k
帖子 -
1.0k
主题3.6k
帖子 -
5
主题11
帖子 -
358
主题1.6k
帖子