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

Ros node unable to see robot_description_semantic parameter #1032

Closed
1 task done
Payday02 opened this issue Jun 20, 2024 · 3 comments
Closed
1 task done

Ros node unable to see robot_description_semantic parameter #1032

Payday02 opened this issue Jun 20, 2024 · 3 comments

Comments

@Payday02
Copy link

Affected ROS2 Driver version(s)

humble

Used ROS distribution.

Humble

Which combination of platform is the ROS driver running on.

Linux in a virtual machine

How is the UR ROS2 Driver installed.

Build the driver from source and using the UR Client Library from binary

Which robot platform is the driver connected to.

URSim in docker

Robot SW / URSim version(s)

latest

How is the ROS driver used.

Headless without using the teach pendant

Issue details

Summary

I am trying to run the example ros2 moveit planning node to interact with ros_ur_driver's standard bringup and rviz setup, but the node is unable to find the parameters it is looking for and will not work. I have also tried this code with the standard panda arm demo and it works properly.

Issue details

arm_server.cpp:


#include <rclcpp/rclcpp.hpp>
#include <moveit/move_group_interface/move_group_interface.h>

int main(int argc, char * argv[])
{
  // Initialize ROS and create the Node
  rclcpp::init(argc, argv);
  auto const node = std::make_shared<rclcpp::Node>(
    "arm_server",
    rclcpp::NodeOptions().automatically_declare_parameters_from_overrides(true)
  );

  // Create a ROS logger
  auto const logger = rclcpp::get_logger("server_arm Initializing");

  // Create the MoveIt MoveGroup Interface
using moveit::planning_interface::MoveGroupInterface;
auto move_group_interface = MoveGroupInterface(node, "ur_manipulator");

// Set a target Pose
auto const target_pose = []{
  geometry_msgs::msg::Pose msg;
  msg.orientation.w = 1.0;
  msg.position.x = 0.28;
  msg.position.y = -0.2;
  msg.position.z = 0.5;
  return msg;
}();
move_group_interface.setPoseTarget(target_pose);

// Create a plan to that target pose
auto const [success, plan] = [&move_group_interface]{
  moveit::planning_interface::MoveGroupInterface::Plan msg;
  auto const ok = static_cast<bool>(move_group_interface.plan(msg));
  return std::make_pair(ok, msg);
}();

// Execute the plan
if(success) {
  move_group_interface.execute(plan);
} else {
  RCLCPP_ERROR(logger, "Planning failed!");
}

  // Shutdown ROS
  rclcpp::shutdown();
  return 0;
}

Steps to Reproduce

  1. Install Ur Ros Driver from source
  2. In one terminal run ros2 run ur_client_library start_ursim.sh -m ur3e
  3. Access the sim over web browser
  4. In a second terminal run ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur3e robot_ip:=192.168.56.101 launch_rviz:=false
  5. Make sure it launches properly, then program the arm to use external input and start that program
  6. In a third terminal run ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur3e launch_rviz:=true
  7. In a fourth terminal run the arm_server.cpp node ros2 run arm_server arm_server

Expected Behavior

Expected the node to send a goal to moveit2 and attempt to plan and execute that goal on the simulated arm

Actual Behavior

Node throws two errors and does not start properly because it cannot find the parameters it is looking for

Relevant log output

$ ros2 run arm_server arm_server

[ERROR] [1718893245.617361543] [arm_server]: Could not find parameter robot_description_semantic and did not receive robot_description_semantic via std_msgs::msg::String subscription within 10.000000 seconds.

Error:   Could not parse the SRDF XML File. Error=XML_ERROR_EMPTY_DOCUMENT ErrorID=13 (0xd) Line number=0

         at line 732 in /home/pdavis/ws_moveit2/src/srdfdom/src/model.cpp

[ERROR] [1718893245.903549444] [moveit_rdf_loader.rdf_loader]: Unable to parse SRDF

[FATAL] [1718893245.903736816] [move_group_interface]: Unable to construct robot model. Please make sure all needed information is on the parameter server.

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

  what():  Unable to construct robot model. Please make sure all needed information is on the parameter server.

[ros2run]: Aborted

Accept Public visibility

  • I agree to make this context public
@Payday02
Copy link
Author

Another note, a python node using the moveit2 python api for the same thing exhibits the same behavior

@Payday02
Copy link
Author

For some reason the C++ node for moveit will work when handed the information through a launch file, even though the python will not. I don't believe this should be necessary overall since the demo nodes for moveit do not require this but as I have a workaround this is no longer a pressing issue for me.

@fmauch
Copy link
Collaborator

fmauch commented Jun 27, 2024

As you wrote above, it is required to pass the respective parameters to the arm_server node, as well.

Since this is more of a MoveIt usage issue I'll close this issue. Please keep in mind that the moveit_config from this repo is merely an example. For real-world applications you should create your own moveit_config package containing your actual configuration.

@fmauch fmauch closed this as completed Jun 27, 2024
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