-
Notifications
You must be signed in to change notification settings - Fork 68
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
Cannot use MoveItConfigsBuilder #81
Comments
Any error reported? moveit_configs = MoveItConfigsBuilder(
controllers_name='fake_controllers',
robot_type=LaunchConfiguration('robot_type'),
dof=LaunchConfiguration('dof'),
prefix=LaunchConfiguration('prefix'),
hw_ns=LaunchConfiguration('hw_ns'),
add_gripper=LaunchConfiguration('add_gripper'),
add_bio_gripper=LaunchConfiguration('add_bio_gripper'),
ros2_control_plugin='uf_robot_hardware/UFRobotFakeSystemHardware'
).to_moveit_configs() |
This is the error message reported. It gives this error with or without the ros2_control_plugin definition. It is confusing to me because this seems to be an error with the way the package is setup since I'm starting with a fresh clone.
|
Can you provide a complete launch script so I can try it? Or try the launch script we provide to see if this error is reported. |
@vimior
#include <memory>
#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>(
"hello_moveit",
rclcpp::NodeOptions().automatically_declare_parameters_from_overrides(true)
);
// Create a ROS logger
auto const logger = rclcpp::get_logger("hello_moveit");
// Next step goes here
// Create the MoveIt MoveGroup Interface
using moveit::planning_interface::MoveGroupInterface;
auto move_group_interface = MoveGroupInterface(node, "xarm6");
// 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;
} In terminal one both of these commands have been tried (tutorial equivalent):
And in terminal two (run tutorial):
Which has led me to the belief that the xarm_ros2 package isn't correctly launching all of the necessary items for moveit2 planning (robot_description_semantic is missing). To clarify, using the provided launches is the approach which I would like to take, making full use of the UFactory provided moveit config. If there is a solution to this or I am making use of the UFactory moveit config wrong, please let me know as that would be the quickest/easiest solution! In efforts to get around this I have tried to create my own launch using the MoveitConfigsBuilder (from uf_ros_lib) with the necessary descriptions being published which is where this (#81) issue surfaced. I don't think that this custom launch file should be necessary, but if a custom launch file is needed please provide me with an example which would work. I appreciate the help and I hope that there is something obvious which I am missing. |
@Leopold-Klotz , currently the robot_description_semantic is kept as a internal parameter for the node move_group and was not published as global topic. Please make some modification to the file _robot_moveit_common.launch.py inside xarm_moveit_config package, by adding one additional parameter to move_group node: {'publish_robot_description_semantic': True} After the modification, the move_group_node part should look like this: # Start the actual move_group node/action server
move_group_node = Node(
package='moveit_ros_move_group',
executable='move_group',
output='screen',
parameters=[
robot_description_parameters,
ompl_planning_pipeline_config,
trajectory_execution,
plan_execution,
moveit_controllers,
planning_scene_monitor_parameters,
# sensor_manager_parameters,
{'use_sim_time': use_sim_time},
{'publish_robot_description_semantic': True},
],
) In this way, robot_description_semantic would be published as a topic. Please try again running your |
Thank you, I can confirm that doing this fixes the interaction with the move group interface and removed my need for MoveItConfigsBuilder. IMO, I would suggest releasing the entire package with this modification so that the xarm_moveit_config can be used as (from what I understand) is the universal way for interacting with MoveIt2. If I can help in this update please let me know. |
I'm encountering difficulties while trying to set up and use the xarm6 robot with MoveIt in ROS 2 Humble. My main issues are:
Background:
I have a node that typically interacts with MoveIt using the MoveGroup interface. This code has worked successfully with other robotic arms in the past.
Expected Behavior:
My node's code should be able to:
Current Issues:
Typical Interaction Flow:
Questions:
Any guidance on resolving these issues or suggestions for alternative approaches would be greatly appreciated. I'm happy to provide more details or specific code snippets if needed.
Code used to attempt the use of moveitconfigsbuilder:
I've looked at issue #64, but I haven't been able to get proper use of the moveitconfigsbuilder function.
The text was updated successfully, but these errors were encountered: