请求与响应配置文件
dofbot_info功能包包含了需要编译的消息文件。“dofbot_info/srv/Kinemarics.srv”文件中,横线上方表示客户端发送请求的消息格式,下方表示服务器回复响应的消息格式。
客户端发送的请求包括以下内容。
- 机械臂基坐标系下的目标坐标(tar_x, tar_y, tar_z)
- 目标姿态角(roll, pitch, yaw)
- 机械臂目前的六个关节信息(cur_joint1, cur_joint2, cur_joint3, cur_joint4, cur_joint5, cur_joint6)
- 用户请求的模式(kin_name)。
除用户请求的模式为字符串类型外,其他消息都应为浮点型。用户请求的模式分为正运动学解(fk)以及逆运动学解(ik)。
- 当模式为正运动学解时,只需填入机械臂目前的六个关节信息。
- 当模式为逆运动学解时,则无需填入机械臂目前的六个关节信息。
服务端响应的消息全为浮点型。
- 当模式为正运动学解时,服务器会响应相对于机械臂基坐标系的到达坐标(x, y, z)和到达姿态角(roll, pitch, yaw)。
- 当模式为逆运动学解时,服务器会响应机械臂的六个关节目标(joint1, joint2, joint3, joint4, joint5, joint6)。
float64 tar_x float64 tar_y float64 tar_z float64 roll float64 pitch float64 yaw float64 cur_joint1 float64 cur_joint2 float64 cur_joint3 float64 cur_joint4 float64 cur_joint5 float64 cur_joint6 string kin_name --- float64 joint1 float64 joint2 float64 joint3 float64 joint4 float64 joint5 float64 joint6 float64 x float64 y float64 z float64 roll float64 pitch float64 yaw
父主题: 代码实现