The robot doesn’t move #318
-
Here are two things I am currently able to do:
I don't know how to connect it with the actual robot, so if you have any reference materials, configuration files, or source code, I would appreciate it if you could share them. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 13 replies
-
Hi @yuutayuuta50 I suggest reviewing this guide, which was created by Yaskawa Europe. It steps you through the process of configuring everything and includes sample source code for basic motion. |
Beta Was this translation helpful? Give feedback.
-
I was able to display the actual robot's joint angles in RViz using the following: https://github.com/YaskawaEurope/ros2-starter-for-yaskawa-robots/tree/main However, the robot does not move. Is there a way to operate the robot using motoros2 alone to test whether the installation was successful? Or can we consider the installation successful if the joint states are displayed? |
Beta Was this translation helpful? Give feedback.
-
I've tried various approaches, and it seems that setting action_ns to "" causes issues when launching the controller. When I set action_ns to follow_joint_trajectory, the robot does not move, but the process completes without any errors. Is it possible to use the Plan and Execute buttons in RViz's motion planning to move the actual robot? |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response. I still cannot get the robot to move. Based on the URL below and your advice, I have set up the moveit_controllers.yaml and launched the MoveGroup node. However, instead of using RViz, I used hello_moveit.cpp, where the planning succeeds, but it stops at the message 'sending trajectory to follow_joint_trajectory' when executing "move_group_interface.asyncExecute(plan);" https://github.com/YaskawaEurope/ros2-starter-for-yaskawa-robots/tree/main If a controller is necessary, is there a way to create one without using ros2_control? I haven't been able to find any information on how to do this anywhere. Alternatively, if the current setup should be sufficient, could it be that there is an issue with my yrc10000? Incidentally, when I use ROS (not ROS2), my yrc1000 works and I can move the robot. moveit_controllers.yaml
launch.pydef generate_launch_description():
motoman_directory = "robo"
ns = ""
# URDF
motoman_robot_description_config = xacro.process_file(
os.path.join(
get_package_share_directory(motoman_directory),
"config",
"motoman_gp4.urdf.xacro",
),
# mappings={'prefix': '/yaskawa_a1/'},
)
motoman_robot_description = {
"robot_description": motoman_robot_description_config.toxml()
}
moveit_config = (
MoveItConfigsBuilder("motoman_gp4", package_name="robo")
.robot_description(file_path="config/motoman_gp4.urdf.xacro")
.robot_description_semantic(file_path="config/motoman_gp4.srdf")
.trajectory_execution(file_path="config/moveit_controllers.yaml")
.to_moveit_configs()
)
planning_scene_monitor_parameters = {
"publish_planning_scene": True,
"publish_geometry_updates": True,
"publish_state_updates": True,
"publish_transforms_updates": True,
"publish_robot_description": True,
"publish_robot_description_semantic": True,
}
#logger.info(moveit_config.to_dict())
# Start the actual move_group node/action server
# simulation
run_move_group_nodeX = Node(
package="moveit_ros_move_group",
executable="move_group",
output="screen",
namespace=ns,
parameters=[
moveit_config.to_dict(),
planning_scene_monitor_parameters,
# {"use_sim_time": True},
],
# remappings=[('/moto_controller/joint_states', '/yaskawa/joint_states')]
#remappings=[('joint_states', '/follow_joint_trajectory/joint_states')]
)
# RViz
rviz_base = os.path.join(
get_package_share_directory(
"robo"), "launch"
)
rviz_full_config = os.path.join(rviz_base, "moveit.rviz")
rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_full_config],
parameters=[
moveit_config.robot_description,
moveit_config.robot_description_semantic,
moveit_config.planning_pipelines,
moveit_config.robot_description_kinematics,
# {"use_sim_time": True},
],
)
# Publish TF
robot_state_publisher = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
name="robot_state_publisher",
output="both",
namespace=ns,
parameters=[moveit_config.robot_description],
#remappings=[('joint_states', '/joint_state_broadcaster/joint_states')]
)
# ros2_control using FakeSystem as hardware
ros2_controllers_path = os.path.join(
get_package_share_directory("robo"),
"config",
"ros2_controllers.yaml",
)
ros2_control_node = Node(
namespace=ns,
package="controller_manager",
executable="ros2_control_node",
parameters=[moveit_config.robot_description, ros2_controllers_path],
output="both",
)
joint_state_publisherX = Node(
package='joint_state_publisher',
executable='joint_state_publisher',
name='joint_state_publisher',
namespace=ns,
parameters=[
{
"robot_description": motoman_robot_description,
"rate": 43,
"source_list": ['/joint_states'],
}
],
)
robot_state_publisherX = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
name="robot_state_publisher",
output="both",
namespace=ns,
parameters=[moveit_config.robot_description]
)
moto_controller_spawner = Node(
package="controller_manager",
executable="spawner",
namespace=ns,
arguments=[
"follow_joint_trajectory",
"--controller-manager",
"/controller_manager",
],
)
return LaunchDescription(
[
# db_arg,
# static_tf,
# mongodb_server_node,
run_move_group_nodeX,
joint_state_publisherX,
robot_state_publisherX,
#robot_state_publisher,
rviz_node,
#run_move_group_node, ### _1
#ros2_control_node,
#joint_state_broadcaster_spawner,
#moto_controller_spawner,
]
# + load_controllers
) hello_moveit.cpp#include <memory>
#include "motoros2_interfaces/srv/start_traj_mode.hpp"
#include "std_srvs/srv/trigger.hpp"
#include <rclcpp/rclcpp.hpp>
#include <moveit/move_group_interface/move_group_interface.h>
#include <rclcpp/rclcpp.hpp>
#include <moveit/moveit_cpp/moveit_cpp.h>
#include <moveit/moveit_cpp/planning_component.h>
#include <chrono>
#include <thread>
int main(int argc, char *argv[])
{
//-----------------------------------------------------
rclcpp::init(argc, argv);
//-------------------controller enable-----------------------------
auto drive = rclcpp::Node::make_shared("enable_client");
auto enable_client = drive->create_client<motoros2_interfaces::srv::StartTrajMode>("/start_traj_mode");
// Create a request message to send
auto request = std::make_shared<motoros2_interfaces::srv::StartTrajMode::Request>();
// Send the request asynchronously
auto future = enable_client->async_send_request(request);
std::this_thread::sleep_for(std::chrono::seconds(5));
//-----------------------------------------------------
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");
// Create the MoveIt MoveGroup Interface
using moveit::planning_interface::MoveGroupInterface;
auto move_group_interface = MoveGroupInterface(node, "flange");
// Set a target Pose
auto const target_pose = []
{
geometry_msgs::msg::Pose msg;
msg.orientation.x = 0.0;
msg.orientation.y = 0.0;
msg.orientation.z = 0.0;
msg.orientation.w = 1.0;
msg.position.x = 0.44; // 0.44;
msg.position.y = 0.0; // 0.1;
msg.position.z = 0.60; // 0.73;
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);
}();
std::this_thread::sleep_for(std::chrono::seconds(5));
// Execute the plan
if (success)
{
RCLCPP_INFO(logger, "Planning OK!");
// move_group_interface.execute(plan);
move_group_interface.asyncExecute(plan);
std::this_thread::sleep_for(std::chrono::seconds(10));
RCLCPP_INFO(logger, "end of waiting");
}
else
{
RCLCPP_ERROR(logger, "Planning failed!");
}
rclcpp::shutdown();
return 0;
} |
Beta Was this translation helpful? Give feedback.
-
Judging by the behavior of gp8_node.py, it seems that there is no feedback coming from the action server. I suspect there may be an issue with the action server. Do you have any information regarding this? Here is the information about my YRC1000. system : YAS4.71.00A(JP)-00 |
Beta Was this translation helpful? Give feedback.
-
The robot moved on Humble. The reason it wasn't working was because the line export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp was present in my .bashrc. It seems it was added during one of the installation processes. Thank you very much to everyone who responded! |
Beta Was this translation helpful? Give feedback.
-
I leave the testing procedure after installation. (1) Install motoros2_client_interface_dependencies (2) Install ros2-starter-for-yaskawa-robots (3) Launch the robot and start the micro-ROS Agent (4) Run (5) Run (6) Modify ・Change (7) Run (8) Run |
Beta Was this translation helpful? Give feedback.
-
I have realized why I used |
Beta Was this translation helpful? Give feedback.
The robot moved on Humble. The reason it wasn't working was because the line export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp was present in my .bashrc. It seems it was added during one of the installation processes.
Thank you very much to everyone who responded!