<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with 获取关节弧度失败]]></title><description><![CDATA[A list of topics that have been tagged with 获取关节弧度失败]]></description><link>https://fishros.org.cn/forum/tags/获取关节弧度失败</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 19:29:36 GMT</lastBuildDate><atom:link href="https://fishros.org.cn/forum/tags/获取关节弧度失败.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[使用getCurrentJointValues()出错。error:Failed to fetch current robot state]]></title><description><![CDATA[<p dir="auto">我看到moveit2有getCurrentJointValues()这个函数就想尝试用这个函数而不是从/joint_states订阅获取关节弧度。我之前使用moveit::planning_interface::MoveGroupInterface下的轨迹规划，执行的函数都没有问题，但是使用的getCurrentJointValues（）就会报错。<br />
我的操作方法是创建完规划组之后直接调用：</p>
<pre><code class="language-cpp">std::shared_ptr&lt;moveit::planning_interface::MoveGroupInterface&gt; move_group;  //创建规划组
move_group = std::make_shared&lt;moveit::planning_interface::MoveGroupInterface&gt;(
    node, "arm");
auto request = std::make_shared&lt;ArmposeToTrajectory::Request&gt;() ; 
</code></pre>
<p dir="auto">这样有问题吗。日志是这样的：</p>
<pre><code class="language-bash">tree@Ubuntu22:~/robot2_arm_grasp$ ros2 run arm_grasp_cpp arm_trajectory_execute --ros-args --params-file arm_params.yaml
[INFO] [1761873928.650758440] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0 seconds
[INFO] [1761873928.650817331] [moveit_robot_model.robot_model]: Loading robot model 'ar3'...
[INFO] [1761873928.871226505] [move_group_interface]: Ready to take commands for planning group arm.
[INFO] [1761873929.871342341] [arm_test1]: 等待服务端上线中
[INFO] [1761873930.871580393] [arm_test1]: 等待服务端上线中
[INFO] [1761873931.872255316] [arm_test1]: 等待服务端上线中
[INFO] [1761873932.872432526] [arm_test1]: 等待服务端上线中
[INFO] [1761873933.872572785] [arm_test1]: 等待服务端上线中
[INFO] [1761873933.900059538] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states'
[WARN] [1761873935.001136501] [moveit_ros.current_state_monitor]: No state update received within 100ms of system clock. Have been waiting for 1.000000s, timeout is 1.000000s
[INFO] [1761873935.001214462] [moveit_ros.current_state_monitor]: Didn't receive robot state (joint angles) with recent timestamp within 1.000000 seconds. Requested time 300.600000, but latest received state has time 0.000000.
Check clock synchronization if your are running ROS across multiple machines!
[ERROR] [1761873935.001258905] [move_group_interface]: Failed to fetch current robot state
[ros2run]: Segmentation fault
</code></pre>
<p dir="auto">我的rviz2和gazebo和ros2control都设置{use_sim_time: True}了，/joint_states和/clock都在正常发布。日志可以看到MoveGroupInterface 已经成功初始化了</p>
]]></description><link>https://fishros.org.cn/forum/topic/4616/使用getcurrentjointvalues-出错-error-failed-to-fetch-current-robot-state</link><guid isPermaLink="true">https://fishros.org.cn/forum/topic/4616/使用getcurrentjointvalues-出错-error-failed-to-fetch-current-robot-state</guid><dc:creator><![CDATA[Tree]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>