JuoTungChen / ROS2_pick_and_place_UR5

This repository contains ROS2 packages for controlling a UR5 robot with a Robotiq gripper, facilitating precise pick and place operations using MoveIt and providing a comprehensive toolkit for ROS2-based UR5 manipulation.
47 stars 6 forks source link

terminate called after throwing an instance of 'std::runtime_error' #1

Open Aruen24 opened 5 hours ago

Aruen24 commented 5 hours ago
企业微信截图_1731900267794
JuoTungChen commented 5 hours ago

Hi, Please provide more details on what command you are running and what the issues you are encountering so I can assist, thanks!

Aruen24 commented 4 hours ago

Hi, Please provide more details on what command you are running and what the issues you are encountering so I can assist, thanks!

@JuoTungChen run the moveit_server_node.cpp file

include <moveit_ur5_msgs/srv/plan_request.hpp>

include <moveit_ur5_interface/moveit_pose_server.hpp>

int main(int argc, char** argv){ rclcpp::init(argc, argv);

std::shared_ptr<moveit_ur5::service> moveit_server = std::make_shared<moveit_ur5::service>("moveit_interface_server");
rclcpp::executors::MultiThreadedExecutor executor;
executor.add_node(moveit_server);
executor.spin();
rclcpp::shutdown();

return 0;

}

JuoTungChen commented 4 hours ago

Can you provide additional information on what system and ROS version you are running? Also, in addition to the server node, do you also run a client node or use ros2 topic to send planning request?

Another thing you can try is run the launch file:

ros2 launch moveit_ur5_interface moveit_ur5_interface_sim.launch

This will launch a UR5 in simulation and run the server node for you. Then you can use a command line like the following to send planning request and move the robot:

ros2 service call /moveit_ur5/target_pose moveit_ur5_msgs/srv/PlanRequest "{target:{position: {x: -0.3, y: -0.4, z: 0.6}, orientation: {x: -1.0, y: 0.0, z: 0.0, w: 0.0}}}"

Hope this helps!

Aruen24 commented 4 hours ago

Can you provide additional information on what system and ROS version you are running? Also, in addition to the server node, do you also run a client node or use ros2 topic to send planning request?

Another thing you can try is run the launch file:

ros2 launch moveit_ur5_interface moveit_ur5_interface_sim.launch

This will launch a UR5 in simulation and run the server node for you. Then you can use a command line like the following to send planning request and move the robot:

ros2 service call /moveit_ur5/target_pose moveit_ur5_msgs/srv/PlanRequest "{target:{position: {x: -0.3, y: -0.4, z: 0.6}, orientation: {x: -1.0, y: 0.0, z: 0.0, w: 0.0}}}"

Hope this helps!

@JuoTungChen
ubuntu22.04
ROS version is ros2
I also run a client node Some people on the Internet said that this problem may be caused by action server but nothing is ready" indicates that your code is trying to fetch data from an action server, but the server hasn't provided any data yet (i.e., it's not ready)

JuoTungChen commented 3 hours ago

Hi, Thank you for providing the information. Note that this code is only tested on ubuntu 20.04 for ROS2 Galactic, but I will try to see if I can reproduce this error.

Aruen24 commented 3 hours ago

Hi, Thank you for providing the information. Note that this code is only tested on ubuntu 20.04 for ROS2 Galactic, but I will try to see if I can reproduce this error.

@JuoTungChen ubuntu 22.04 and ros2 humble