当前位置: 首页 > news >正文

ROS2实用工具

1. 将ROS2的Bag文件转换为CSV、JSON等

具体代码地址:https://github.com/fishros/ros2bag_convert

2.动手学Moveit2|使用配置助手创建自己机械臂的功能包

运行如下配置助手:

ros2 run moveit_setup_assistant moveit_setup_assistant

如果运行报如下错误:

terminate called after throwing an instance of 'ament_index_cpp::PackageNotFoundError'
  what():  package 'elite_description' not found, searching: [/home/zy0035/piper_ros/install/piper_with_gripper_moveit, /home/zy0035/piper_ros/install/piper_no_gripper_moveit, /home/zy0035/piper_ros/install/piper_mujoco, /home/zy0035/piper_ros/install/piper_msgs, /home/zy0035/piper_ros/install/piper_humble, /home/zy0035/piper_ros/install/piper_gazebo, /home/zy0035/piper_ros/install/piper_description, /home/zy0035/piper_ros/install/piper, /home/zy0035/ros2_ws/install/vision, /home/zy0035/ros2_ws/install/ur_bringup, /home/zy0035/ros2_ws/install/ur5e_octomap_moveit, /home/zy0035/ros2_ws/install/ur5e_gripper_control, /home/zy0035/ros2_ws/install/ur5e_gripper_moveit_config, /home/zy0035/ros2_ws/install/ur5e_gripper_description, /home/zy0035/ros2_ws/install/robotiq_moveit_config, /home/zy0035/ros2_ws/install/robotiq_description, /home/zy0035/ros2_ws/install/realsense2_description, /home/zy0035/ros2_ws/install/realsense2_camera_msgs, /home/zy0035/ros2_ws/install/octo_bringup, /home/zy0035/ros2_ws/install/gazebo_grasp_plugin_ros, /home/zy0035/ros2_ws/install/gazebo_version_helpers, /opt/ros/humble]
Stack trace (most recent call last):
#31   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a086572e46, in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool)
#30   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x70a0858b9e39, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#29   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a086574363, in QApplication::notify(QObject*, QEvent*)
#28   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a08656c712, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#27   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a0865af4ed, in QWidget::event(QEvent*)
#26   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a0866641e6, in QAbstractButton::mouseReleaseEvent(QMouseEvent*)
#25   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a086663fc3, in 
#24   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a08666239d, in 
#23   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a086662115, in QAbstractButton::clicked(bool)
#22   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x70a0858f17c7, in 
#21   Source "./src/helper_widgets.cpp", line 171, in btnFileDialog [0x70a086faf5ef]
#20   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a0866c2a91, in QWidgetLineControl::internalSetText(QString const&, int, bool)
#19   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a0866c27ce, in QWidgetLineControl::finishChange(int, bool, bool)
#18   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a0866bf0f8, in QWidgetLineControl::textChanged(QString const&)
#17   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x70a0858f17c7, in 
#16   Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3", at 0x70a0866b7845, in QLineEdit::textChanged(QString const&)
#15   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x70a0858f17c7, in 
#14   Source "./.obj-x86_64-linux-gnu/include/moveit_setup_framework/qt/moc_helper_widgets.cpp", line 222, in pathChanged [0x70a086fd86c5]
#13   Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3", at 0x70a0858f17c7, in 
#12   Source "./src/start_screen_widget.cpp", line 308, in onUrdfPathChanged [0x70a071141f19]
#11   Source "./src/start_screen.cpp", line 52, in loadURDFFile [0x70a0711400a0]
#10   Source "./src/urdf_config.cpp", line 80, in loadFromPath [0x70a086fba4f4]
#9  | Source "./src/urdf_config.cpp", line 104, in getSharePath
      Source "./include/moveit_setup_framework/utilities.hpp", line 52, in setPackageName [0x70a086fba14f]
#8    Object "/opt/ros/humble/lib/libament_index_cpp.so", at 0x70a086bf0e42, in ament_index_cpp::get_package_share_directory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#7    Object "/opt/ros/humble/lib/libament_index_cpp.so", at 0x70a086beeb19, in 
#6    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x70a0870ae4d7, in __cxa_throw
#5    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x70a0870ae276, in std::terminate()
#4    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x70a0870ae20b, in 
#3    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x70a0870a2b9d, in 
#2    Source "./stdlib/abort.c", line 79, in abort [0x70a0852287f2]
#1    Source "../sysdeps/posix/raise.c", line 26, in raise [0x70a085242475]
#0  | Source "./nptl/pthread_kill.c", line 89, in __pthread_kill_internal
    | Source "./nptl/pthread_kill.c", line 78, in __pthread_kill_implementation
      Source "./nptl/pthread_kill.c", line 44, in __pthread_kill [0x70a0852969fc]
Aborted (Signal sent by tkill() 2007497 1000)
[ros2run]: Aborted

解决方案:

有stl文件在urdf里边,或者你应该在你的含有urdf文件的功能包的src目录下打开moveit setup assistant,然后再去找你的urdf文件

Moveit2生成的参数有BUG修复

具体配置参考:https://zhuanlan.zhihu.com/p/567246503

这里,给出我使用松灵的piper臂生成的文件下载地址:

https://download.csdn.net/download/caokaifa/91669593

不知道为啥生成的joint_limits.yaml调用ros2 launch piper_control_arm demo.launch.py会报错,只要把文件中的5改为5.0就OK了,正确的如下图参数。

# joint_limits.yaml allows the dynamics properties specified in the URDF to be overwritten or augmented as needed# For beginners, we downscale velocity and acceleration limits.
# You can always specify higher scaling factors (<= 1.0) in your motion requests.  # Increase the values below to 1.0 to always move at maximum speed.
default_velocity_scaling_factor: 0.1
default_acceleration_scaling_factor: 0.1# Specific joint properties can be changed with the keys [max_position, min_position, max_velocity, max_acceleration]
# Joint limits can be turned off with [has_velocity_limits, has_acceleration_limits]
joint_limits:joint1:has_velocity_limits: truemax_velocity: 5.0has_acceleration_limits: falsemax_acceleration: 0joint2:has_velocity_limits: truemax_velocity: 5.0has_acceleration_limits: falsemax_acceleration: 0joint3:has_velocity_limits: truemax_velocity: 5.0has_acceleration_limits: falsemax_acceleration: 0joint4:has_velocity_limits: truemax_velocity: 5.0has_acceleration_limits: falsemax_acceleration: 0joint5:has_velocity_limits: truemax_velocity: 5.0has_acceleration_limits: falsemax_acceleration: 0joint6:has_velocity_limits: truemax_velocity: 5.0has_acceleration_limits: falsemax_acceleration: 0

生成的文件调用没有错误,但是控制不了臂,原谅是moveit_controllers.yaml中有问题:

把这个文件修改一下:原代码如下:

# MoveIt uses this configuration for controller managementmoveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManagermoveit_simple_controller_manager:controller_names:- piper_arm_controllerpiper_arm_controller:type: FollowJointTrajectoryjoints:- joint1- joint2- joint3- joint4- joint5- joint6

修改后如下:

# MoveIt uses this configuration for controller managementmoveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManagermoveit_simple_controller_manager:controller_names:- piper_arm_controllerpiper_arm_controller:type: FollowJointTrajectoryaction_ns: follow_joint_trajectorydefault: truejoints:- joint1- joint2- joint3- joint4- joint5- joint6

这样就可以控制臂规划了!!!!

相关moveit应用例子代码参考:

https://github.com/LitchiCheng/ros2_package

Hybrid Planning — MoveIt Documentation: Rolling documentation

https://github.com/agilexrobotics/piper_ros/tree/humble

http://www.lryc.cn/news/620208.html

相关文章:

  • 小电视视频内容获取GUI工具
  • Ansible 实操笔记:Playbook 与变量管理
  • 传输层协议 TCP(1)
  • C语言队列的实现
  • 浪浪山小妖怪电影
  • HarmonyOS 开发实战:搞定应用名字与图标更换,全流程可运行示例
  • 《卷积神经网络(CNN):解锁视觉与多模态任务的深度学习核心》
  • 从 VLA 到 VLM:低延迟RTSP|RTMP视频链路在多模态AI中的核心角色与工程实现
  • AI驱动的前端革命:10项颠覆性技术如何在LibreChat中融为一体
  • Java19 Integer 位操作精解:compress与expand《Hacker‘s Delight》(第二版,7.4节)
  • Docker部署RAGFlow:开启Kibana查询ES数据指南
  • 学习嵌入式的第十九天——Linux——文件编程
  • 如何生成.patch?
  • 开发Excel Add-in的心得笔记
  • Redis ubuntu下载Redis的C++客户端
  • 3分钟 Spring AI 实现对话功能
  • 二次筛法Quadratic Sieve因子分解法----C语言实现
  • 【MCP开发】Nodejs+Typescript+pnpm+Studio搭建Mcp服务
  • 每日五个pyecharts可视化图表-line:从入门到精通 (5)
  • 物联网之小白调试网关设备
  • 《算法导论》第 23 章 - 最小生成树
  • PyTorch基础(Numpy与Tensor)
  • 可搜索的 HTML 版本 Emoji 图标大全,可以直接打开网页使用,每个图标可以点击复制,方便使用
  • Mac安装ant
  • WPS文字和Word文档如何选择多个不连续的行、段
  • Date/Calendar/DateFormat/LocalDate
  • Linux中备份的练习
  • element-ui 时间线(timeLine)内容分成左右两侧
  • 数据分析小白训练营:基于python编程语言的Numpy库介绍(第三方库)(下篇)
  • 车载软件架构 --- MCU刷写擦除相关疑问?