【发布时间】:2018-05-30 16:37:09
【问题描述】:
我在 Ubuntu 14.04 下设置了 ROS indigo, Gazebo。在 ROS 下,moveit 节点正在运行。模拟机械臂 IRB120 并站在 Gazebo 中。我有一个节点,它使用moveit(move_group 节点)为 Bob 想要的 destination 规划路径(轨迹)。计划的轨迹将被发送到 Gazebo 以便稍后显示。
Bob 可以使用两种方法来描述目的地:
-
手臂每个关节的角度:使用六个数字的数组(对于手臂的六个关节),定义每个关节和胫骨的形式。这种方法效果很好。它使用
JointConstraint类:双目标姿势 [] = {0.52, 0.50, 0.73, -0.02, 0.31, 6.83}; for(int i = 0 ; i
仅定义末端执行器的位置和方向。我不能使用这种方法。我使用了
PositionConstraint类。
简而言之问题:我可以使用JointConstraint 类描述目的地,但我不知道如何在PositionConstraint 类中描述它。 如何通过指出末端执行器的位置来描述目标?
我如何以PositionConstraint 格式描述目标:(我指出末端执行器应该在哪里以及它的方向应该是什么。)
moveit_msgs::PositionConstraint pc;
pc.weight = 1.0;
geometry_msgs::Pose p;
p.position.x = 0.3; // not sure if feasible position
p.position.y = 0.3; // not sure if feasible position
p.position.z = 0.3; // not sure if feasible position
pc.link_name="tool0";
p.orientation.x = 0;
p.orientation.y = 0;
p.orientation.z = 0;
p.orientation.w = 1;
pc.constraint_region.mesh_poses.push_back(p);
goal_constraint.position_constraints.push_back(pc);
但是当请求发送时,服务器响应:
[ERROR] [1527689581.951677797, 295.242000000]: Unable to construct goal representation
注意:
在这两种情况下,我都将goal_constraint 添加到trajectory_request:
trajectory_request.goal.request.goal_constraints.push_back(goal_constraint);
// add other details to trajectory_request here...
trajectory_request 将被发送到move_group。 (通过在/move_group/goal 主题上发布trajectory_request)
【问题讨论】: