【ROS_Driver驱动真实UR机械臂】

【ROS_Driver驱动真实UR机械臂】

  • 1. 前言
  • 2. 安装fmauch_universal_robot和驱动
  • 3. 仿真
    • 3.1 启动gazebo
    • 3.2 启动move it规划
    • 3.3 启动rviz
  • 4. 运行机械臂
    • 4.1 启动rviz
    • 4.2 启动示教器程序
    • 4.3 启动moveit
    • 4.4 启动rviz
  • 5. 一些说明补充
    • 5.1 ur_calibration 提取标定信息
    • 5.2 自带程序
    • 5.3 信息图
    • 5.4 修改bring up文件
  • 6. 参考

1. 前言

使用的版本是 Ubuntu18.04 + ROS melodic + UR3(CB3.12)
因为后续需要使用手控器,手控器的驱动需要在Ubuntu18.04下才可以使用。

这两篇文章是UR控制器升级和关于示教器的配置可以参考:
【UR3系统升级到CB3.12附带URcap1.05】
【UR机械臂ros通讯前的示教器网络配置】

【ROS_Driver驱动真实UR机械臂】_第1张图片

这里需要 特别说明 的是:

  1. ur_driverur_modern_drive都已经停止更新,对于使用新版本 CB3 和 e-Series 控制器的机械臂都应当使用ur_robot_driver作为驱动.
  2. 更重要的是,ur_robot_driverur_modern_drive不一样,不要下载universal_robot,而应该下载fmauch_universal_robot
  3. 另外需要注意的是fmauch_universal_robot需要下载的是calibration_devel分支

2. 安装fmauch_universal_robot和驱动

这一步source /opt/ros/melodic/setup.bash需要执行,或者写在bashrc
不然最后catkin_make执行的时候会报错提示不知道ros版本

mkdir -p ur_ws/src && cd ur_ws

# 下载fmauch_universal_robot(注意分支)
git clone -b calibration_devel https://github.com/fmauch/universal_robot.git src/fmauch_universal_robot

# 下载Universal_Robots_ROS_Driver驱动
git clone https://github.com/UniversalRobots/Universal_Robots_ROS_Driver.git src/Universal_Robots_ROS_Driver

# 更新 -qq代表除非报错,否则不输出
sudo apt update -qq

sudo apt-get upgrade

# 更新依赖(这一步需要有梯子,不然可能会超时,超时执行下一步即可,只要一开始安装ros时执行成功过即可)
rosdep update

# 安装依赖 -y表示出现 y/N选项 直接执行y
rosdep install --from-paths src --ignore-src -y

# 编译
catkin_make

# 激活当前工作空间,并写入
echo "source ~/ur_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

注意:

一定要安装fmauch_universal_robot而不是universal_robot,因为fmauch_universal_robot才和ur_ROS_Driver是匹配的,不然之后驱动真实机械臂时,会说ur_description文件夹里没有相应文件,也不可以fmauch_universal_robotuniversal_robot两个都安装,因为这两个有很多文件夹名字是相同的,catkin_make时会报错。(最好不要都安装,但如果两个都安装了,catkin_make报错,可以把提示重复的文件夹删除 ) ,一定要source /opt/ros/melodic/setup.bash,否则rosdep install --from-paths src --ignore-src -y时会报错,提示不知道ros版本。

3. 仿真

3.1 启动gazebo

注意是ur3_bringup.launch,而不是ur3.launch

roslaunch ur_gazebo ur3_bringup.launch

【ROS_Driver驱动真实UR机械臂】_第2张图片

3.2 启动move it规划

roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch sim:=true

【ROS_Driver驱动真实UR机械臂】_第3张图片

3.3 启动rviz

注意后面要给出rviz_config的地址

roslaunch ur3_moveit_config moveit_rviz.launch rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz

【ROS_Driver驱动真实UR机械臂】_第4张图片

注意:

  1. 这一部分需要特别注意的是,因为fmauch_universal_robot里面文件名字和universal_robot有所差别, 运行gazebo启动的是ur3_bringup.launch而不是ur3.launch.
  2. 这一部分另一个需要特别注意的是,执行最后一步,启动rviz时,不能直接ros launch ur3_moveit_config moveit_rviz.launch,而需要给出rviz的地址rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz,不然rviz的界面显示不出ur机械臂的模型图
  3. 和之前universal_robot的仿真过程不一样,就是在rviz界面左下角的MotionPlanningPlanning里将Planning Group选为manipulator这样就出现末端执行器,可以移动,然后就可以规划了(原选项是end effector,而且没有末端执行器可以移动)

【ROS_Driver驱动真实UR机械臂】_第5张图片

  1. 在rviz界面左上角的DispalyPlaned Path里将Loop Animation取消勾选
  2. 这样规划过程就不会一直循环啦,至此就和之前用universal_robot的仿真过程完全一样啦

【ROS_Driver驱动真实UR机械臂】_第6张图片
【ROS_Driver驱动真实UR机械臂】_第7张图片
【ROS_Driver驱动真实UR机械臂】_第8张图片大家可以根据情况选择对应路径规划算法
【ROS_Driver驱动真实UR机械臂】_第9张图片

需要注意的是gazebo和moveit里关于/scaled_pos_joint_traj_controller/follow_joint_trajectory控制器的名字不统一。
所以要在/home/guyue/ur_ws/src/fmauch_universal_robot/ur3_moveit_config/launch下的ur3_moveit_planning_execution.launchl文件里进行修改。
很多人的教程里都提出要修改这部分东西,但是因为驱动和fmauch一直在更新,所以和之前修改的方式有所不同。未来的修改方式可能又有所改变。
具体可以参考UR机械臂学习(5-3):驱动ur机械臂实物——问题及解决 的问题5 。
看一下分析过程,也就明白为什么要这样修改了。

# ur3_moveit_planning_execution.launchl 第6行修改为
<remap if="$(arg sim)" from="/scaled_pos_joint_traj_controller/follow_joint_trajectory" to="/pos_joint_traj_controller/follow_joint_trajectory"/>

新版本不需要更改
【ROS_Driver驱动真实UR机械臂】_第10张图片

4. 运行机械臂

4.1 启动rviz

启动bring up,建立与机械臂的连接

roslaunch ur_robot_driver ur3_bringup.launch limited:=true robot_ip:=192.168.56.10

打印log

 * /ur_hardware_interface/script_sender_port: 50002
 * /ur_hardware_interface/servoj_gain: 2000
 * /ur_hardware_interface/servoj_lookahead_time: 0.03
 * /ur_hardware_interface/tf_prefix: 
 * /ur_hardware_interface/tool_baud_rate: 115200
 * /ur_hardware_interface/tool_parity: 0
 * /ur_hardware_interface/tool_rx_idle_chars: 1.5
 * /ur_hardware_interface/tool_stop_bits: 1
 * /ur_hardware_interface/tool_tx_idle_chars: 3.5
 * /ur_hardware_interface/tool_voltage: 0
 * /ur_hardware_interface/trajectory_port: 50003
 * /ur_hardware_interface/use_tool_communication: False
 * /vel_joint_traj_controller/action_monitor_rate: 20
 * /vel_joint_traj_controller/constraints/elbow_joint/goal: 0.1
 * /vel_joint_traj_controller/constraints/elbow_joint/trajectory: 0.1
 * /vel_joint_traj_controller/constraints/goal_time: 0.6
 * /vel_joint_traj_controller/constraints/shoulder_lift_joint/goal: 0.1
 * /vel_joint_traj_controller/constraints/shoulder_lift_joint/trajectory: 0.1
 * /vel_joint_traj_controller/constraints/shoulder_pan_joint/goal: 0.1
 * /vel_joint_traj_controller/constraints/shoulder_pan_joint/trajectory: 0.1
 * /vel_joint_traj_controller/constraints/stopped_velocity_tolerance: 0.05
 * /vel_joint_traj_controller/constraints/wrist_1_joint/goal: 0.1
 * /vel_joint_traj_controller/constraints/wrist_1_joint/trajectory: 0.1
 * /vel_joint_traj_controller/constraints/wrist_2_joint/goal: 0.1
 * /vel_joint_traj_controller/constraints/wrist_2_joint/trajectory: 0.1
 * /vel_joint_traj_controller/constraints/wrist_3_joint/goal: 0.1
 * /vel_joint_traj_controller/constraints/wrist_3_joint/trajectory: 0.1
 * /vel_joint_traj_controller/gains/elbow_joint/d: 0.1
 * /vel_joint_traj_controller/gains/elbow_joint/i: 0.05
 * /vel_joint_traj_controller/gains/elbow_joint/i_clamp: 1
 * /vel_joint_traj_controller/gains/elbow_joint/p: 5.0
 * /vel_joint_traj_controller/gains/shoulder_lift_joint/d: 0.1
 * /vel_joint_traj_controller/gains/shoulder_lift_joint/i: 0.05
 * /vel_joint_traj_controller/gains/shoulder_lift_joint/i_clamp: 1
 * /vel_joint_traj_controller/gains/shoulder_lift_joint/p: 5.0
 * /vel_joint_traj_controller/gains/shoulder_pan_joint/d: 0.1
 * /vel_joint_traj_controller/gains/shoulder_pan_joint/i: 0.05
 * /vel_joint_traj_controller/gains/shoulder_pan_joint/i_clamp: 1
 * /vel_joint_traj_controller/gains/shoulder_pan_joint/p: 5.0
 * /vel_joint_traj_controller/gains/wrist_1_joint/d: 0.1
 * /vel_joint_traj_controller/gains/wrist_1_joint/i: 0.05
 * /vel_joint_traj_controller/gains/wrist_1_joint/i_clamp: 1
 * /vel_joint_traj_controller/gains/wrist_1_joint/p: 5.0
 * /vel_joint_traj_controller/gains/wrist_2_joint/d: 0.1
 * /vel_joint_traj_controller/gains/wrist_2_joint/i: 0.05
 * /vel_joint_traj_controller/gains/wrist_2_joint/i_clamp: 1
 * /vel_joint_traj_controller/gains/wrist_2_joint/p: 5.0
 * /vel_joint_traj_controller/gains/wrist_3_joint/d: 0.1
 * /vel_joint_traj_controller/gains/wrist_3_joint/i: 0.05
 * /vel_joint_traj_controller/gains/wrist_3_joint/i_clamp: 1
 * /vel_joint_traj_controller/gains/wrist_3_joint/p: 5.0
 * /vel_joint_traj_controller/joints: ['shoulder_pan_jo...
 * /vel_joint_traj_controller/state_publish_rate: 125
 * /vel_joint_traj_controller/stop_trajectory_duration: 0.5
 * /vel_joint_traj_controller/type: velocity_controll...
 * /vel_joint_traj_controller/velocity_ff/elbow_joint: 1.0
 * /vel_joint_traj_controller/velocity_ff/shoulder_lift_joint: 1.0
 * /vel_joint_traj_controller/velocity_ff/shoulder_pan_joint: 1.0
 * /vel_joint_traj_controller/velocity_ff/wrist_1_joint: 1.0
 * /vel_joint_traj_controller/velocity_ff/wrist_2_joint: 1.0
 * /vel_joint_traj_controller/velocity_ff/wrist_3_joint: 1.0

NODES
  /
    controller_stopper (ur_robot_driver/controller_stopper_node)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    ros_control_controller_spawner (controller_manager/spawner)
    ros_control_stopped_spawner (controller_manager/spawner)
    ur_hardware_interface (ur_robot_driver/ur_robot_driver_node)
  /ur_hardware_interface/
    ur_robot_state_helper (ur_robot_driver/robot_state_helper)

auto-starting new master
process[master]: started with pid [23140]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d54ee7a2-0921-11ee-999f-00e26967d098
process[rosout-1]: started with pid [23155]
started core service [/rosout]
process[robot_state_publisher-2]: started with pid [23162]
process[ur_hardware_interface-3]: started with pid [23163]
process[ros_control_controller_spawner-4]: started with pid [23164]
process[ros_control_stopped_spawner-5]: started with pid [23166]
process[controller_stopper-6]: started with pid [23171]
process[ur_hardware_interface/ur_robot_state_helper-7]: started with pid [23173]
[ INFO] [1686575141.963687453]: Waiting for controller manager service to come up on /controller_manager/switch_controller
[ INFO] [1686575141.964909914]: Initializing dashboard client
[ INFO] [1686575141.965640306]: waitForService: Service [/controller_manager/switch_controller] has not been advertised, waiting...
[ INFO] [1686575141.968392130]: Connected: Universal Robots Dashboard Server

[ INFO] [1686575141.970948972]: waitForService: Service [/ur_hardware_interface/dashboard/play] has not been advertised, waiting...
[ INFO] [1686575141.975152812]: Initializing urdriver
[ WARN] [1686575141.975539677]: No realtime capabilities found. Consider using a realtime system for better performance
[ INFO] [1686575141.976863159]: Negotiated RTDE protocol version to 2.
[ INFO] [1686575141.977001958]: Setting up RTDE communication with frequency 125.000000
[ INFO] [1686575141.992916596]: waitForService: Service [/ur_hardware_interface/dashboard/play] is now available.
[INFO] [1686575142.181043]: Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] [1686575142.183463]: Controller Spawner: Waiting for service controller_manager/load_controller
[ INFO] [1686575142.989578343]: Checking if calibration data matches connected robot.
[ WARN] [1686575142.990031441]: No realtime capabilities found. Consider using a realtime system for better performance
[ERROR] [1686575144.065570636]: The calibration parameters of the connected robot don't match the ones from the given kinematics config file. Please be aware that this can lead to critical inaccuracies of tcp positions. Use the ur_calibration tool to extract the correct calibration from the robot and pass that into the description. See [https://github.com/UniversalRobots/Universal_Robots_ROS_Driver#extract-calibration-information] for details.
[ WARN] [1686575144.067863282]: No realtime capabilities found. Consider using a realtime system for better performance
[ INFO] [1686575144.068035418]: Loaded ur_robot_driver hardware_interface
[ INFO] [1686575144.088699963]: waitForService: Service [/controller_manager/switch_controller] is now available.
[ INFO] [1686575144.088721284]: Service available.
[ INFO] [1686575144.088740168]: Waiting for controller list service to come up on /controller_manager/list_controllers
[ INFO] [1686575144.089132332]: Service available.
[INFO] [1686575144.292299]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1686575144.293467]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1686575144.294627]: Loading controller: joint_state_controller
[INFO] [1686575144.294642]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1686575144.296556]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1686575144.298310]: Loading controller: pos_joint_traj_controller
[INFO] [1686575144.303570]: Loading controller: scaled_pos_joint_traj_controller
[INFO] [1686575144.319611]: Loading controller: joint_group_vel_controller
[ INFO] [1686575144.329849431]: Robot mode is now RUNNING
[ INFO] [1686575144.329914040]: Robot's safety mode is now NORMAL
[INFO] [1686575144.335599]: Loading controller: speed_scaling_state_controller
[INFO] [1686575144.343429]: Controller Spawner: Loaded controllers: pos_joint_traj_controller, joint_group_vel_controller
[INFO] [1686575144.351608]: Loading controller: force_torque_sensor_controller
[INFO] [1686575144.359492]: Controller Spawner: Loaded controllers: joint_state_controller, scaled_pos_joint_traj_controller, speed_scaling_state_controller, force_torque_sensor_controller
[INFO] [1686575144.367550]: Started controllers: joint_state_controller, scaled_pos_joint_traj_controller, speed_scaling_state_controller, force_torque_sensor_controller

4.2 启动示教器程序

先打开控制器运行URcap

具体可参照 【UR机械臂ros通讯前的示教器网络配置】

4.3 启动moveit

仿真后面需要后面加 sim:=true

roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch limited:=true

打印log

[ INFO] [1686575100.809832357]: Planning attempt 1 of at most 1
[ INFO] [1686575100.810012133]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1686575100.810221153]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.810249093]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.810278337]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.810300980]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.820706140]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575100.820758685]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1686575100.820934593]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575100.821123020]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1686575100.821173071]: ParallelPlan::solve(): Solution found by one or more threads in 0.011044 seconds
[ INFO] [1686575100.821314804]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.821329419]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.821344769]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.821366679]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.821675089]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575100.821700698]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575100.821869703]: RRTConnect: Created 5 states (3 start + 2 goal)
[ INFO] [1686575100.821937092]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575100.821991556]: ParallelPlan::solve(): Solution found by one or more threads in 0.000726 seconds
[ INFO] [1686575100.822068435]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.822086606]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575100.822471411]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1686575100.822597168]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1686575100.822631347]: ParallelPlan::solve(): Solution found by one or more threads in 0.000596 seconds
[ INFO] [1686575100.823754006]: SimpleSetup: Path simplification took 0.001104 seconds and changed from 3 to 2 states
[ WARN] [1686575100.826107546]: Controller scaled_pos_joint_traj_controller failed with error INVALID_GOAL: 
[ WARN] [1686575100.826143657]: Controller handle scaled_pos_joint_traj_controller reports status FAILED
[ INFO] [1686575100.826160581]: Completed trajectory execution with status FAILED ...
[ INFO] [1686575104.281938016]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1686575104.281976233]: Planning attempt 1 of at most 1
[ INFO] [1686575104.282146821]: Planner configuration 'manipulator' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1686575104.282325677]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.282349215]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.282368859]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.282399151]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.292703669]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.292848065]: RRTConnect: Created 5 states (3 start + 2 goal)
[ INFO] [1686575104.292959658]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.292979950]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.293016497]: ParallelPlan::solve(): Solution found by one or more threads in 0.010759 seconds
[ INFO] [1686575104.293125674]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.293145814]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.293169536]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.293186016]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.293455439]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.293573635]: RRTConnect: Created 5 states (2 start + 3 goal)
[ INFO] [1686575104.293623722]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.293726676]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.293784085]: ParallelPlan::solve(): Solution found by one or more threads in 0.000686 seconds
[ INFO] [1686575104.293855259]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.293880786]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1686575104.294207754]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.294279980]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1686575104.294315328]: ParallelPlan::solve(): Solution found by one or more threads in 0.000490 seconds
[ INFO] [1686575104.295534955]: SimpleSetup: Path simplification took 0.001198 seconds and changed from 3 to 2 states

4.4 启动rviz

roslaunch ur3_moveit_config moveit_rviz.launch rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz

打印log

conda deactivate
robot@ms:~$ roslaunch ur3_moveit_config moveit_rviz.launch rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz
... logging to /home/robot/.ros/log/76a810e4-0920-11ee-999f-00e26967d098/roslaunch-ms-12313.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ms:45377/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.13

NODES
  /
    rviz_ms_12313_7457887479089493497 (rviz/rviz)

ROS_MASTER_URI=http://localhost:11311

process[rviz_ms_12313_7457887479089493497-1]: started with pid [12336]
[ INFO] [1686574633.666341854]: rviz version 1.13.29
[ INFO] [1686574633.666362978]: compiled against Qt version 5.9.5
[ INFO] [1686574633.666369105]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1686574633.671160967]: Forcing OpenGl version 0.
[ INFO] [1686574634.058498715]: Stereo is NOT SUPPORTED
[ INFO] [1686574634.058540307]: OpenGL device: NVIDIA GeForce RTX 3060/PCIe/SSE2
[ INFO] [1686574634.058550396]: OpenGl version: 4.6 (GLSL 4.6).
[ INFO] [1686574637.293998461]: Loading robot model 'ur3_robot'...
[ WARN] [1686574637.323511460]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/robot_description_kinematics/manipulator/kinematics_solver_attempts' from your configuration.
[ INFO] [1686574637.419084517]: Starting planning scene monitor
[ INFO] [1686574637.419783952]: Listening to '/move_group/monitored_planning_scene'
[ INFO] [1686574637.551684058]: Constructing new MoveGroup connection for group 'manipulator' in namespace ''
[ INFO] [1686574638.659683132]: Ready to take commands for planning group manipulator.
[ INFO] [1686574638.659718218]: Looking around: no
[ INFO] [1686574638.659730168]: Replanning: no
[ INFO] [1686574812.467003812]: Stopping planning scene monitor
[ WARN] [1686574812.562478960]: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
[ INFO] [1686574812.563497374]: Loading robot model 'ur3_robot'...
[ INFO] [1686574812.695066194]: Starting planning scene monitor
[ INFO] [1686574812.695917097]: Listening to '/move_group/monitored_planning_scene'
[ INFO] [1686574812.821024948]: Constructing new MoveGroup connection for group 'manipulator' in namespace ''
[ INFO] [1686574812.831100285]: Ready to take commands for planning group manipulator.
[ INFO] [1686574812.831114500]: Looking around: no
[ INFO] [1686574812.831120532]: Replanning: no
[ INFO] [1686575100.859334122]: ABORTED: Solution found but controller failed during execution
[ INFO] [1686575104.315191411]: ABORTED: Solution found but controller failed during execution
[ INFO] [1686575107.802862658]: Stopping planning scene monitor
[ WARN] [1686575107.885856144]: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
[ INFO] [1686575107.887121780]: Loading robot model 'ur3_robot'...
[ INFO] [1686575108.019623055]: Starting planning scene monitor
[ INFO] [1686575108.020300909]: Listening to '/move_group/monitored_planning_scene'
[ INFO] [1686575108.144568830]: Constructing new MoveGroup connection for group 'manipulator' in namespace ''
[ INFO] [1686575108.154249164]: Ready to take commands for planning group manipulator.
[ INFO] [1686575108.154262679]: Looking around: no
[ INFO] [1686575108.154268610]: Replanning: no
[ INFO] [1686575116.115054020]: ABORTED: Solution found but controller failed during execution
^C[rviz_ms_12313_7457887479089493497-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

这里需要 注意 的就是先启动bring up,再启动示教器。
启动示教器后如果正常通信,会出现:

   [ INFO] [1624885305.373017515]: Robot requested program
    [ INFO] [1624885305.373077772]: Sent program to robot
    [ INFO] [1624885305.839015623]: Robot connected to reverse interface. Ready to receive control commands.

3.2 启动rqt,单关节控制

# 01 启动bringup,建立与机械臂的连接
roslaunch ur_robot_driver ur3_bringup.launch limited:=true robot_ip:=192.168.56.10


# 02 启动示教器程序

# 03 启动rqt
rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller
# 或者 运行 rqt
# 然后选择 Plugins -> Robot Tools -> Controller Manager

5. 一些说明补充

5.1 ur_calibration 提取标定信息

为了提高正向和逆向运动学精度,每个UR机器人在出厂前都进行了标定。

ur_calibrationUniversal_Robots_ROS_Driver
中的一个功能包,能够提取机器人出厂标定的运动学参数,并更改 ur_description 包的配置文件以获取正确的URDF模型。

尽管使用此驱动程序控制机器人不是必须执行此步骤,但强烈建议您这样做,因为否则末端执行器的位置可能会出现厘米级偏差。

启动ur机器人,确保网络正常链接。然后启动节点 calibration_correction 。该节点直接从机器人提取标定信息,将其保存到.yaml文件中:

roslaunch ur_calibration calibration_correction.launch \
  robot_ip:=192.168.56.10 target_filename:="${HOME}/ur_ws/src/fmauch_universal_robot/ur_description/config/ur3_calibration.yaml"

# 之后每次启动bring up都启动这句
roslaunch ur_robot_driver ur3_bringup.launch robot_ip:=192.168.56.10 \
 kinematics_config:="${HOME}/ur_ws/src/fmauch_universal_robot/ur_description/config/ur3_calibration.yaml"

5.2 自带程序

运行其自带测试程序test_move.py可以移动机械臂,出现如下错误
【ROS_Driver驱动真实UR机械臂】_第11张图片

则需要python环境:【Ubuntu18配置Anaconda深度学习环境】

rosrun ur_robot_driver test_move.py

5.3 信息图

使用rqt_graph、rqt_plot功能显示信息图

rosrun rqt_graph rqt_graph

【ROS_Driver驱动真实UR机械臂】_第12张图片

5.4 修改bring up文件

启动bring up

roslanuch ur_robot_driver ur3_bringup.launch limited:=true robot_ip:=192.168.56.10

避免每次启动都要填写ip地址,可以修改ur3_bringup.launch中的默认参数

<arg name="robot_ip" default="192.168.1.0">
  • 此外,可以修改本文件中的一些参数,以实现机器人的不同动作效果,如机器人动作速度。
  • 首先要将use_lowbandwidth_trajectory_follower设置为true
  • 再将time_interval设置为0.004或者更低即可
  • 设置的过低可能会导致控制的轨迹追踪产生问题

6. 参考

操作步骤如下

# 新建工作空间
mkdir -p ur_ws/src && cd ur_ws/src

# 下载fmauch_universal_robot(注意是calibration_devel分支)
git clone -b calibration_devel https://github.com/fmauch/universal_robot.git  fmauch_universal_robot

# 下载Universal_Robots_ROS_Driver驱动
git clone https://github.com/UniversalRobots/Universal_Robots_ROS_Driver.git Universal_Robots_ROS_Driver

# 更新 -qq代表除非报错,否则不输出
sudo apt update -qq

sudo apt-get upgrade

# 更新依赖(这一步需要有梯子,不然可能会超时,超时执行下一步即可,只要一开始安装ros时执行成功过即可)
rosdep update

#返回ur_ws文件夹路径
cd ..
# 安装依赖 -y表示出现 y/N选项 直接执行y
rosdep install --from-paths src --ignore-src -y

# 编译
catkin_make

# 激活当前工作空间,并写入
echo "source ~/ur_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

合工大机器人实验室:https://blog.csdn.net/qq_34935373/article/details/109238762
Ubuntu与实体UR3_e机械臂通讯以及出现的问题:https://blog.csdn.net/qq_39448233/article/details/109038004
UR机械臂学习(5-2):使用Universal_Robots_ROS_Driver驱动真实机械臂

你可能感兴趣的:(#,UR机械臂,自动驾驶,人工智能,机器学习)