Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling move_line service getting stuck #241

Open
Akumar201 opened this issue Sep 28, 2024 · 1 comment
Open

calling move_line service getting stuck #241

Akumar201 opened this issue Sep 28, 2024 · 1 comment

Comments

@Akumar201
Copy link

Akumar201 commented Sep 28, 2024

Hello , I have created a function to send the arm to desired position, the issue is when I am trying to move it it's moving to a point but after that it get stuck and not take the second command. After the print like it get stuck
std::cout << "after move_srv_ " << std::endl;

I am not sure what is wrong as It was working on earlier version of github that I used few month before but with the latest version , it's giving this issue.


bool RoboticArmController::moveLine(std::vector<float> position, float velocity, float acceleration, float mvtime, float mvradii)
{
    // Log the parameters to ensure they're correct
    ROS_INFO("Attempting to moveLine to position: [%f, %f, %f, %f, %f, %f], velocity: %f, acceleration: %f, mvtime: %f, mvradii: %f",
             position[0], position[1], position[2], position[3], position[4], position[5],
             velocity, acceleration, mvtime, mvradii);

    // Wait for the service to become available
    if (!move_line_client_.waitForExistence(ros::Duration(10.0)))
    {
        ROS_ERROR("Service '/xarm/move_line' does not exist or is not available.");
        return false;
    }

    std::cout << "after waitForExistence " << std::endl;

    // Call the service
    move_srv_.request.pose = position;
    move_srv_.request.mvvelo = velocity;
    move_srv_.request.mvacc = acceleration;
    move_srv_.request.mvtime = mvtime;
    move_srv_.request.mvradii = mvradii;

    std::cout << "after move_srv_ " << std::endl;

    if (move_line_client_.call(move_srv_))
    {
        std::cout << "move_line_client_ in if  " << std::endl;
        ROS_INFO("Service '/xarm/move_line' called successfully.");
        return true;
    }
    else
    {
        std::cout << "move_line_client_ in else " << std::endl;
        ROS_ERROR("Failed to call service '/xarm/move_line'.");
        return false;
    }
}

points looks something like

   "x": 0.105,
    "y": -0.705,
    "z": 0.150,
    "qw": 0.999778,
    "qx": 0.011202,
    "qy": 0.000213,
    "qz": 0.017821
        
        [ERROR] [1727555169.026892018]: Failed to call service '/xarm/move_line'.
[ERROR] [1727555169.027024140]: Failed to execute moveLine.
[main_node-1] process has died [pid 48165, exit code 1, cmd bash -c sleep 4.0; $0 $@ /home/orangepi/targetarm/ralar_ws/devel/lib/tularm/main __name:=main_node __log:=/home/orangepi/.ros/log/7ba971ce-7dd6-11ef-85f0-0000a449ddbb/main_node-1.log].
log file: /home/orangepi/.ros/log/7ba971ce-7dd6-11ef-85f0-0000a449ddbb/main_node-1*.log

@penglongxiang
Copy link
Contributor

@Akumar201 Since we do not have your original code. I have tested with this code with similar structure, and it worked fine. Could you confirm you can execute this program with no problem? It can be run by:

 $ rosrun xarm_api move_test

The prior launch command is: roslaunch xarm_bringup xarm<your_robot_dof>_server.launch robot_ip:=<your_robot_ip>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants