Kinovarobotics / ros_kortex

ROS packages for KINOVA® KORTEX™ robotic arms
Other
153 stars 155 forks source link

I first go from A to C, with tool(default){0,0,0.2,0,0,0}, then set tool {0,0.3,0.2,0,0,0} then go from C to D, with with tool(set){0,0.3,0.2,0,0,0},error!!!!!!!!!!!! #277

Closed wentianheshi closed 1 year ago

wentianheshi commented 1 year ago

error: 企业微信截图_1675250638446 code: /*

felixmaisonneuve commented 1 year ago

Hi @wentianheshi,

I won't debug a 700 line file you wrote. Maybe you could guide me to the specific section you are having trouble with.

Based on your terminal output, your waypoint list is invalid. You can use the ValidateWaypointList function and print the errors in your waypoint list.

Best, Felix

wentianheshi commented 1 year ago

sorry Felix Previously, your reply to me was based on the SDK, now it is based on ROS questions. I want say : case1: I set three waypoint A,B,C,and let robot move A to B to C is successed case2:
first i control robot move A to B then I set tool transform(0,0.01,0,0,0,0) finally I control robot B to C failed image As can be seen from the logs, the robot received an abort command, So I suspect the function of tool_transform have some error. the code of tool_transform

include <kortex_driver/SetToolConfiguration.h>

bool example_set_tool_transform(ros::NodeHandle n, const std::string &robot_name) { ros::ServiceClient service_client_set_cartesian_tool_transform = n.serviceClient( "/" + robot_name + "/control_config/set_tool_configuration"); kortex_driver::SetToolConfiguration service_set_cartesian_tool_transform;

service_set_cartesian_tool_transform.request.input.tool_transform.x = 0; service_set_cartesian_tool_transform.request.input.tool_transform.y = 0.01; service_set_cartesian_tool_transform.request.input.tool_transform.z = 0; service_set_cartesian_tool_transform.request.input.tool_transform.theta_x = 0; service_set_cartesian_tool_transform.request.input.tool_transform.theta_y = 0; service_set_cartesian_tool_transform.request.input.tool_transform.theta_z = 0;

if (!service_client_set_cartesian_tool_transform.call( service_set_cartesian_tool_transform)) { std::string error_string = "Failed to call SetToolConfiguration"; ROS_ERROR("%s", error_string.c_str()); return false; } ROS_INFO("set tool success");

// Wait a bit std::this_thread::sleep_for(std::chrono::milliseconds(250));

return true; }

In order to test tool_transform function ,I put this function into the following three cpp files image catkin_make only example_waypoint_action_client.cpp can run success but kinova driver log have some error image other two cpp file run abort
image

Please give me some professional advice thanks wentianheshi

felixmaisonneuve commented 1 year ago

Hi @wentianheshi,

So I have tried moving the arm between 3 poses like you did and setting your tool configuration between the second and third action. Everything worked great for me. No ACTION_ABORT.

Looking at your log, I find it strange that you received an ACTION_ABORT for action 1001. You received an ACTION_END for action 1001 (Pose 1) just before. You then send Pose 12 to the arm, so I would expect a different action identifier. Are you sure about this piece of code?

Also, have you tried using other poses?

Best, Felix

wentianheshi commented 1 year ago

Hi @Felix First,Thank you for your reply. I guss the process of setting tool configuration must wait the point moved success,so the process of moving point A to point B must used action client in ros.
The method described in the image is not suitable image can you send me a copy of your testing program, I can compare the differences between the two, maybe this may help me the most.

felixmaisonneuve commented 1 year ago

Yes, I just tested it and changing the tool configuration during an action will lead to an action abort. You have to wait until the action is finished, then change the tool configuration, then start your new action.

You cannot do both at the same time