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

unable to control the robot with the motoman_driver #428

Closed
adhitir opened this issue Sep 28, 2021 · 16 comments
Closed

unable to control the robot with the motoman_driver #428

adhitir opened this issue Sep 28, 2021 · 16 comments

Comments

@adhitir
Copy link

adhitir commented Sep 28, 2021

Robot: HC10DT
ROS Version: Ubuntu 18:04 with Melodic through Windows WSL

I've been following the tutorials here (http://wiki.ros.org/motoman_driver/Tutorials/Usage) to get a HC10DT robot working with MoveIt! So far, I have had little success.

The tutorial says to use

rosparam load <path to URDF> robot_description

which cannot be used directly as a xacro file is provided. I added these lines in the robot_interface launch file

<param name="robot_description"  command="xacro --inorder '$(find motoman_hc10_support)/urdf/hc10dt.xacro'" />

and I've used the joint names specified in the motoman_hc10_support/config/joint_names_hc10dt.yaml file.

Firstly, I get this warning when I run the launch file:

SUMMARY                                                                                           
========                                                                                                                                                                                            PARAMETERS                                                                                        
* /controller_joint_names: ['joint_1_s', 'jo...                                                   
* /robot_description: <?xml version="1....                                                        
* /robot_ip_address: 192.168.131.40                                                               
* /rosdistro: melodic                                                                             
* /rosversion: 1.14.11                                                                                                                                                                             
NODES                                                                                              
 /                                                                                                   
joint_state (motoman_driver/robot_state)                                                         
joint_trajectory_action (industrial_robot_client/joint_trajectory_action)                         
motion_streaming_interface (motoman_driver/motion_streaming_interface)                                                                                                                          
ROS_MASTER_URI=http://192.168.131.55:11311                                                                                                                                                          
process[joint_state-1]: started with pid [15254]                                                  
process[motion_streaming_interface-2]: started with pid [15255]                                   
process[joint_trajectory_action-3]: started with pid [15256]                                     
[ERROR] [1632863304.989646800]: Failed to find topic_list parameter                               
[ERROR] [1632863305.025623000]: Failed to find topic_list parameter                               
[ WARN] [1632863305.071487400]: Tried to connect when socket already in connected state                                                                                                                             

The move_to_joint.py is missing in the current driver by the way. I had an older version of the motoman driver, so I extracted the file from there and used it. I gave the code the current joint state of the robot and I got this error:

rosrun motoman_driver move_to_joint.py "[-0.038855452090501785, 0.03427538275718689, 0.0054276310838758945, 0.028037024661898613, -0.010736207477748394, -0.1180443912744522]"                                      
[ERROR] [1632863782.615182]: Start and End position joint_names mismatch                                                
[ERROR] [1632863782.618992]: Unable to move to commanded position. Aborting.                                            Traceback (most recent call last):                                                                                        
File "/home/adhitir/ros_ws/src/nsf-hc10dt/ros-stacks/motoman/motoman_driver/src/move_to_joint.py", line 133, in <module>                                                                                                                          main(sys.argv[1:])                                                                                                    
File "/home/adhitir/ros_ws/src/nsf-hc10dt/ros-stacks/motoman/motoman_driver/src/move_to_joint.py", line 127, in main      move_to_joint(end_pos, duration)                                                                                      
File "/home/adhitir/ros_ws/src/nsf-hc10dt/ros-stacks/motoman/motoman_driver/src/move_to_joint.py", line 69, in move_to_joint                                                                                                                      traj = build_traj(get_cur_pos(), end_pos, duration)                                                                   
File "/home/adhitir/ros_ws/src/nsf-hc10dt/ros-stacks/motoman/motoman_driver/src/move_to_joint.py", line 25, in build_traj                                                                                                                         raise                                                                                                               
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

When I try and run the moveit package it get the following errors:


ROS_MASTER_URI=http://192.168.131.55:11311                                                                                                                                                                                                      
process[robot_state_publisher-1]: started with pid [20194]                                                              
process[move_group-2]: started with pid [20195]                                                                         
process[rviz_AUE_ROBOTLAB_D2_20170_2384831785494813562-3]: started with pid [20196]                                     
[ WARN] [1632864692.601394400]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.                             
[ INFO] [1632864692.696544200]: Loading robot model 'motoman_hc10dt'...                                                 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-adhitir'                                           
[ INFO] [1632864692.767449200]: rviz version 1.13.18                                                                    
[ INFO] [1632864692.767738600]: compiled against Qt version 5.9.5                                                       
[ INFO] [1632864692.768135900]: compiled against OGRE version 1.9.0 (Ghadamon)                                          
[ INFO] [1632864692.780488000]: Forcing OpenGl version 0.                                                               
[ WARN] [1632864693.062927200]: Kinematics solver doesn't support #attempts anymore, but only a timeout.                
Please remove the parameter '/robot_description_kinematics/hc10dt_arm/kinematics_solver_attempts' from your configuration.                                                                                                                      
[ WARN] [1632864693.079083900]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.                             
[ INFO] [1632864693.174208500]: Publishing maintained planning scene on 'monitored_planning_scene'                      
[ INFO] [1632864693.182730900]: MoveGroup debug mode is OFF                                                             Starting planning scene monitors...                                                                                     
[ INFO] [1632864693.183362200]: Starting planning scene monitor                                                         
[ INFO] [1632864693.191683500]: Listening to '/planning_scene'                                                          
[ INFO] [1632864693.191881900]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.                                                                                                                
[ INFO] [1632864693.201088700]: Listening to '/collision_object'                                                        
[ INFO] [1632864693.209567900]: Listening to '/planning_scene_world' for planning scene world geometry                  
[ERROR] [1632864693.213042800]: No sensor plugin specified for octomap updater 0; ignoring.                             
[ INFO] [1632864693.238289900]: Listening to '/attached_collision_object' for attached collision objects                
Planning scene monitors started.                                                                                        
[ INFO] [1632864693.268882500]: Initializing OMPL interface using ROS parameters                                        
[ INFO] [1632864693.340433900]: Stereo is NOT SUPPORTED                                                                 
[ INFO] [1632864693.340765300]: OpenGL device: llvmpipe (LLVM 10.0.0, 256 bits)                                         
[ INFO] [1632864693.341261900]: OpenGl version: 3.1 (GLSL 1.4).                                                         
[ INFO] [1632864693.345804900]: Using planning interface 'OMPL'                                                         
[ INFO] [1632864693.353466600]: Param 'default_workspace_bounds' was not set. Using default value: 10                   
[ INFO] [1632864693.355425000]: Param 'start_state_max_bounds_error' was set to 0.1                                     
[ INFO] [1632864693.357286100]: Param 'start_state_max_dt' was not set. Using default value: 0.5                        
[ INFO] [1632864693.359205700]: Param 'start_state_max_dt' was not set. Using default value: 0.5                        
[ INFO] [1632864693.361141400]: Param 'jiggle_fraction' was set to 0.05                                                 
[ INFO] [1632864693.363158400]: Param 'max_sampling_attempts' was not set. Using default value: 100                     
[ INFO] [1632864693.363376200]: Using planning request adapter 'Add Time Parameterization'                              
[ INFO] [1632864693.363779400]: Using planning request adapter 'Fix Workspace Bounds'                                   
[ INFO] [1632864693.364168400]: Using planning request adapter 'Fix Start State Bounds'                                 
[ INFO] [1632864693.364548800]: Using planning request adapter 'Fix Start State In Collision'                           
[ INFO] [1632864693.364865600]: Using planning request adapter 'Fix Start State Path Constraints'                       
[FATAL] [1632864693.377094100]: Exception while loading controller manager 'moveit_simple_controller_manager/MoveItSimpleControllerManager': According to the loaded plugin descriptions the class moveit_simple_controller_manager/MoveItSimpleControllerManager with base class type moveit_controller_manager::MoveItControllerManager does not exist. Declared types are  moveit_fake_controller_manager/MoveItFakeControllerManager                                                        
[ INFO] [1632864693.426410600]: Trajectory execution is managing controllers                                            
Loading 'move_group/ApplyPlanningSceneService'...                                                                       
Loading 'move_group/ClearOctomapService'...                                                                             
Loading 'move_group/MoveGroupCartesianPathService'...                                                                   
Loading 'move_group/MoveGroupExecuteTrajectoryAction'...                                                                
Loading 'move_group/MoveGroupGetPlanningSceneService'...                                                                
Loading 'move_group/MoveGroupKinematicsService'...                                                                      
Loading 'move_group/MoveGroupMoveAction'...                                                                             
Loading 'move_group/MoveGroupPickPlaceAction'...                                                                        
Loading 'move_group/MoveGroupPlanService'...                                                                            
Loading 'move_group/MoveGroupQueryPlannersService'...                                                                   
Loading 'move_group/MoveGroupStateValidationService'...                                                                 
[INFO] [1632864693.644622400]:                                                                                                                                                                                                                 ********************************************************                                                                * MoveGroup using:                                                                                                      
*     - ApplyPlanningSceneService                                                                                       
*     - ClearOctomapService                                                                                             
*     - CartesianPathService                                                                                            
*     - ExecuteTrajectoryAction                                                                                         
*     - GetPlanningSceneService                                                                                         
*     - KinematicsService                                                                                               
*     - MoveAction                                                                                                      
*     - PickPlaceAction                                                                                                 
*     - MotionPlanService                                                                                               
*     - QueryPlannersService                                                                                            
*     - StateValidationService                                                                                          
********************************************************                                                                                                                                                                                        
[ INFO] [1632864693.650790000]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner                      
[ INFO] [1632864693.651090100]: MoveGroup context initialization complete                                                                                                                                                                       You can start planning now!                                                                                                                                                                                                                     
[ INFO] [1632864696.827709000]: Loading robot model 'motoman_hc10dt'...                                                 
[ WARN] [1632864696.912533500]: Kinematics solver doesn't support #attempts anymore, but only a timeout.                
Please remove the parameter '/rviz_AUE_ROBOTLAB_D2_20170_2384831785494813562/hc10dt_arm/kinematics_solver_attempts' from your configuration.                                                                                                    
[ WARN] [1632864696.936327600]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.                             
[ INFO] [1632864697.084380900]: Starting planning scene monitor                                                         
[ INFO] [1632864697.093499000]: Listening to '/move_group/monitored_planning_scene'                                     
[ WARN] [1632864697.265616600]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.                             
[ INFO] [1632864697.275937000]: Constructing new MoveGroup connection for group 'hc10dt_arm' in namespace ''            
[ INFO] [1632864698.954145000]: Ready to take commands for planning group hc10dt_arm.                                   
[ INFO] [1632864698.954548100]: Looking around: no                                                                      
[ INFO] [1632864698.955041800]: Replanning: no                                                                          
[ INFO] [1632864703.388016000]: Planning request received for MoveGroup action. Forwarding to planning pipeline.        
[ INFO] [1632864703.390278100]: Planner configuration 'hc10dt_arm[RRT]' will use planner 'geometric::RRT'. Additional configuration parameters will be set when the planner is constructed.                                                     
[ INFO] [1632864703.392684600]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.392994100]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.394894900]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.395348200]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure              
[ INFO] [1632864703.404454900]: hc10dt_arm[RRT]: Created 15 states                                                      
[ INFO] [1632864703.407783200]: hc10dt_arm[RRT]: Created 21 states                                                      
[ INFO] [1632864703.417410900]: hc10dt_arm[RRT]: Created 33 states                                                      
[ INFO] [1632864703.419542900]: hc10dt_arm[RRT]: Created 40 states                                                      
[ INFO] [1632864703.419864200]: ParallelPlan::solve(): Solution found by one or more threads in 0.027931 seconds        
[ INFO] [1632864703.420445900]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.420706000]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.421807500]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.422322600]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.423274000]: hc10dt_arm[RRT]: Created 4 states                                                       
[ INFO] [1632864703.425016900]: hc10dt_arm[RRT]: Created 6 states                                                       
[ INFO] [1632864703.428298000]: hc10dt_arm[RRT]: Created 12 states                                                      
[ INFO] [1632864703.438708100]: hc10dt_arm[RRT]: Created 31 states                                                      
[ INFO] [1632864703.439076400]: ParallelPlan::solve(): Solution found by one or more threads in 0.018744 seconds        
[ INFO] [1632864703.441433900]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure              
[ INFO] [1632864703.441686000]: hc10dt_arm[RRT]: Starting planning with 1 states already in datastructure               
[ INFO] [1632864703.453651900]: hc10dt_arm[RRT]: Created 24 states                                                      
[ INFO] [1632864703.465197200]: hc10dt_arm[RRT]: Created 29 states                                                      
[ INFO] [1632864703.465548100]: ParallelPlan::solve(): Solution found by one or more threads in 0.024253 seconds        
[ INFO] [1632864703.467158400]: SimpleSetup: Path simplification took 0.000028 seconds and changed from 2 to 2 states   
[ INFO] [1632864705.882404000]: Execution request received                                                              
[ERROR] [1632864705.882680600]: Unable to identify any set of controllers that can actuate the specified joints: [ joint_1_s joint_2_l joint_3_u joint_4_r joint_5_b joint_6_t ]                                                                
[ERROR] [1632864705.884026500]: Known controllers and their joints:                                                                                                                                                                             
[ INFO] [1632864705.886098400]: ABORTED: Solution found but controller failed during execution                                                                                                                            

What steps am I missing? Why am I not able to control the robot with MoveIt?

@adhitir adhitir changed the title unable to set the robot_description parameter unable to control the robot with the motoman_driver Sep 28, 2021
@gavanderhoorn
Copy link
Member

Have you seen #415?

@adhitir
Copy link
Author

adhitir commented Oct 6, 2021

Yes, I have now. Not sure how it is relevant. Could it be a little more specific.

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Oct 6, 2021

It is relevant as that PR contributes the robot support package for the HC10DT-B10. This includes the .launch files needed to start the driver.

The problem you report seems to be caused by the fact you're not loading the required parameters, which would likely be fixed if you'd use the files contributed by that PR.

I'd also recommend against copy-pasting and mixing-and-matching files from other packages.

The move_to_joint.py is missing in the current driver by the way

this was specifically removed in #333. It seems the references in the tutorial you mention were not removed.

I would not recommend you use that script any longer.


Edit: from your description I assumed you were trying to use a variant of the HC10DT which was not yet supported. #415 would show how to properly add support for such a variant.

If that's not what you're trying to do, please clarify.

@gavanderhoorn
Copy link
Member

Oh, and please note:

ROS Version: Ubuntu 18:04 with Melodic through Windows WSL

this is not an officially supported combination.

Could you clarify whether it's WSL or WSL2?

(this won't matter for the problem you encounter, but it is important information)

@gavanderhoorn
Copy link
Member

If your main (first?) goal is to get the driver started, I would recommend to reuse the existing motoman_hc10_support package and start:

roslaunch motoman_hc10_support robot_interface_streaming_hc10dt.launch robot_ip:=192.168.131.40 controller:=yrc1000

That should start everything up as needed for the base driver.

You should not need to create any files yourself for this.

Note that I would not expect this to work with the original version of WSL, and there could be networking issues with WSL2.

@gavanderhoorn
Copy link
Member

Tracking updating that tutorial in #431.

@adhitir
Copy link
Author

adhitir commented Oct 6, 2021

I was using WSL2 and that could have been the issue here.
The base driver is working without errors. I had errors regarding the robot_description parameter and the joint names not being set properly, but I resolved those by adding the appropriate lines in the launch file.

How can I confirm if it's working? Is there another way to control the robot without MoveIt? I am able to call the enable and disable service and I can hear the definitive click of the robot brakes releasing.

@adhitir
Copy link
Author

adhitir commented Oct 6, 2021

It is relevant as that PR contributes the robot support package for the HC10DT-B10. This includes the .launch files needed to start the driver.

The problem you report seems to be caused by the fact you're not loading the required parameters, which would likely be fixed if you'd use the files contributed by that PR.

I'd also recommend against copy-pasting and mixing-and-matching files from other packages.

The move_to_joint.py is missing in the current driver by the way

this was specifically removed in #333. It seems the references in the tutorial you mention were not removed.

I would not recommend you use that script any longer.

Edit: from your description I assumed you were trying to use a variant of the HC10DT which was not yet supported. #415 would show how to properly add support for such a variant.

If that's not what you're trying to do, please clarify.

I'm trying to use the MoveIt! interface to control a HC10DT robot. I'm not married to the idea of using MoveIt! so if there are other ways I can write python code to control the robot motion, I am willing to try it. I need the robot to move in complex trajectories to support a 3D printing research task.

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Oct 7, 2021

The base driver is working without errors. I had errors regarding the robot_description parameter and the joint names not being set properly, but I resolved those by adding the appropriate lines in the launch file.

that's what the .launch files in the support package solve for you: they make sure the driver is configured for the specific robot you start the robot_interface_streaming_hc10dt.launch for.

Note that it's a .launch file in the motoman_hc10_support package. Not in motoman_driver.

re: robot_description: the driver does not load that as it will be specific to a user's setup / workcell. We cannot assume a specific file will always be used, as that would potentially override whatever you are trying to load yourself.

I resolved those by adding the appropriate lines in the launch file.

What have you changed exactly? Unless you have an absolute need (ie: it cannot be solved any other way), I would advice you to not edit files in this repository. The base driver should not need it.

I would actually advise you to revert whatever you have changed in motoman_driver (or any of the packages in ros-industrial/motoman) and create a separate package which models your 'workcell' (as simple or complex as it may be). That package would then contain a .launch file which includes the robot_interface_streaming_hc10dt.launch file, passes it the required arguments, loads your specific URDF and does whatever else you need.

It would probably be similar to motoman_hc10_support/launch/robot_state_visualize_hc10dt.launch (but don't edit that file).

How can I confirm if it's working? Is there another way to control the robot without MoveIt?

Of course. There is no requirement for MoveIt whatsoever.

The only thing you need to do is write a FollowJointTrajectory action client, generate a smooth trajectory and submit it as a goal.

See #229 for an example.

Note that this will mean you are now responsible for making sure trajectories are valid, continuous and collision free. The driver does not perform collision checks. It's purely a remote motion interface, and the robot will attempt to execute what you send it.

I am able to call the enable and disable service and I can hear the definitive click of the robot brakes releasing.

Then there's a good chance things are working.

I need the robot to move in complex trajectories to support a 3D printing research task.

you're probably aware already, but if "3D printing" is the variant with micro-metre precision requirements then a typical industrial robot will most likely not be able to satisfy those.


Edit: btw: why do you copy repositories in their entirety into your repository? That's rather uncommon, and seems to defeat the purpose a little.

@gavanderhoorn
Copy link
Member

I would also recommend you take a look at Working with ROS-Industrial Robot Support Packages, which tries to clarify how robot support packages are structured and what the role is of the files you may find in them.

@adhitir
Copy link
Author

adhitir commented Oct 13, 2021

you're probably aware already, but if "3D printing" is the variant with micro-metre precision requirements then a typical industrial robot will most likely not be able to satisfy those.

This is for concrete 3D printing, so we don't require micrometer precision. We want to be able to input complex patterns and have the robot follow it.

why do you copy repositories in their entirety into your repository? That's rather uncommon, and seems to defeat the purpose a little.

I didn't understand this. How else can I build a repository without cloning it onto my PC and building it?

@gavanderhoorn
Copy link
Member

why do you copy repositories in their entirety into your repository? That's rather uncommon, and seems to defeat the purpose a little.

I didn't understand this. How else can I build a repository without cloning it onto my PC and building it?

I noticed adhitir/nsf-hc10dt in your account.

The ros-stacks sub directory there contains complete copies of the ros-industrial/industrial_core, ros-industrial/motoman and velodyne_simulator repositories.

That would not seem to be needed.

@adhitir
Copy link
Author

adhitir commented Oct 13, 2021

Ah, yes, that is correct. I need to clean that up. My advisor needed me to upload ALL the files in my workspace at the time.

@adhitir
Copy link
Author

adhitir commented Oct 13, 2021

I used the motoman_hc10_support package and I was able to move the robot with the FollowJointTrajectory action client.
Everything works fine. Thank you for all your help. I'm planning to perform the inverse kinematics using the KDL package to set Cartesian waypoints for the trajectories I want to generate. This is technically a separate question, but I was wondering if you had any suggestions or alternative better methods I could use.

I'll be closing this ticket now.

@adhitir adhitir closed this as completed Oct 13, 2021
@gavanderhoorn
Copy link
Member

I'm planning to perform the inverse kinematics using the KDL package to set Cartesian waypoints for the trajectories I want to generate.

I would probably use trac_ik, as it tends to produce higher quality results and is very similar to KDL.

Or, use opw_kinematics. That's, similar to IKFast, very fast (analytic solver) and very well suited for 6dof industrial robots with ortho-normal wrists. You'd have to find the values for the required parameters though (see the paper and the linked repository).

Note that you could also take a look at something like ros-industrial/tesseract. It's not easy, but it's a pretty OK motion planning framework which is more geared towards tool-path based motion planning (ie: optimise trajectories of manipulators while taking tool orientation into account). It sounds like that would be something you're going to be doing.

Or: see whether compas_fab works for you. That could be even easier.

@adhitir
Copy link
Author

adhitir commented Oct 13, 2021

Thank you for all these recommendations!

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

No branches or pull requests

2 participants