PickNikRobotics / UR10e_welding_demo

22 stars 5 forks source link

Update welding demo to latest moveit version #47

Open sjahr opened 10 months ago

sjahr commented 10 months ago

@dyackzan The servo solver is not doing exactly what it should do at the moment. It starts with a very jerky motion and loses the reference trajectory eventually. I think it might be a parameter issue. Next time I have time to continue working on this my plan was to try:

dyackzan commented 10 months ago

I'm not sure if you got around this another way, but in order to build the demo I had to include moveit and moveit_msgs from source (the binaries had some incompatibilities). Took me a while to get things building and running on rolling, but I had some time for investigation...I plotted the error coming out of the joint trajectory controller with PlotJuggler during execution of the hybrid planning goal and recorded a video which I'll attach below. It looks like the error stays pretty low for all the joints (doesn't exceed 0.00006 radians) which definitely points to servo as the issue. We're following commands well here, but we're just not receiving the right commands.

controller_error_low.webm

dyackzan commented 10 months ago

Plotting the target twists using humble while running the demo yields: target_twist_cmds_humble2

And the target twists using rolling yields: target_twist_cmds_rolling

dyackzan commented 10 months ago

Plotting the target_pose that is created by the line:

Eigen::Isometry3d target_pose = target_state.getFrameTransform("tcp_welding_gun_link");

on humble: target_position_humble

on rolling: target_position_rolling

Notes:

dyackzan commented 10 months ago

Current position plots from the line:

Eigen::Isometry3d current_pose = current_state->getFrameTransform("tcp_welding_gun_link");

humble version: current_position_humble

rolling version: current_position_rolling

dyackzan commented 10 months ago

On the rolling version of the demo, I've plotted the current positions, target positions, and computed diff positions for the linear x, y, and z components of the pose. As you can see in the following charts, the computed diff does not appear to be accurate

Linear X Component: linear_x_diff_rolling

Linear Y Component: linear_y_diff_rolling

Linear Z Component: linear_z_diff_rolling

dyackzan commented 10 months ago

Found the issue with some help from @MarqRazz ! Looks like we were setting the frame in the TwistCommand to base_link when it was actually computed in the tcp_welding_gun_link frame. Switching those (in the last commit) gets things running as desired again.