当前位置:网站首页>如何在gazebo进行 joint的转动控制
如何在gazebo进行 joint的转动控制
2022-08-09 10:36:00 【华为云】
下面总结 如何在gazebo进行 joint的转动控制
xacro文件
设置两个link
<link name="rotate_link"> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry > <box size="${size_rotate_link_x} ${size_rotate_link_y} ${size_rotate_link_z}" /> </geometry> <material name="LightGray" /> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry > <box size="${size_rotate_link_x} ${size_rotate_link_y} ${size_rotate_link_z}" /> </geometry> </collision> <inertial> <mass value="${massGain*1}"/> <inertia ixx="${massGain*1}" ixy="0.0" ixz="0.0" iyy="${massGain*1}" iyz="0.0" izz="${massGain*1}"/> </inertial> </link> <gazebo reference="rotate_link"> <material>Gazebo/Grey</material> <turnGravityOff>true</turnGravityOff> </gazebo>
<link name="rotate_platform_base_link"> <visual> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry > <box size="${size_rotate_platform_base_link_x} ${size_rotate_platform_base_link_y} ${size_rotate_platform_base_link_z}" /> </geometry> <material name="LightGray" /> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0" /> <geometry > <box size="${size_rotate_platform_base_link_x} ${size_rotate_platform_base_link_y} ${size_rotate_platform_base_link_z}" /> </geometry> </collision> <inertial> <mass value="${massGain*1}"/> <inertia ixx="${massGain*1}" ixy="0.0" ixz="0.0" iyy="${massGain*1}" iyz="0.0" izz="${massGain*1}"/> </inertial> </link> <gazebo reference="rotate_platform_base_link"> <material>Gazebo/Black</material> <turnGravityOff>true</turnGravityOff> </gazebo> </xacro:macro>
两个基本的link
设置完后,设置 joint
设置joint
<joint name="rotate_joint" type="continuous"> <parent link="rotate_platform_base_link"/> <child link="rotate_link"/> <origin xyz="0.075 0 0.225" rpy="0 0 0" /> <axis xyz="1 0 0" /> <limit effort="10" velocity="1000" /> </joint>
- continuous 进行速度控制 一直转
- revolute 进行位置控制 有上下限
设置transmission
<transmission name="rotate_joint_transmission"> <type>transmission_interface/SimpleTransmission</type> <joint name="rotate_joint"> <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface> </joint> <actuator name="motor1"> <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
设置 gazebo
<gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotNamespace>/rotate_platform</robotNamespace> <controlPeriod>0.01</controlPeriod> <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType> </plugin> </gazebo>
xacro设置完毕
配置yaml文件
rotate_platform: joint_state_controller: type: joint_state_controller/JointStateController publish_rate: 50 rotate_velocity_controller: type: effort_controllers/JointVelocityController joint: rotate_joint pid: {p: 1, i: 0.0, d: 0.0, i_clamp: 0.0}
joint的名字要和上面对应
配置launch文件
<rosparam file="$(find slam_sensor_sim_gazebo)/config/rotate_control.yaml" command="load"/> <node name="controller_manager" pkg="controller_manager" type="spawner" respawn="false" output="screen" ns="/rotate_platform" args="joint_state_controller rotate_velocity_controller --shutdown-timeout 3"/>
边栏推荐
猜你喜欢
机器学习-逻辑回归(logistics regression)
学长告诉我,大厂MySQL都是通过SSH连接的
壁纸
How tall is the B+ tree of the MySQL index?
Electron application development best practices
开源SPL,WebService/Restful广泛应用于程序间通讯,如微服务、数据交换、公共或私有的数据服务等。
2021-01-11-雪碧图做表情管理器
Cpolar内网穿透的面板功能介绍
Transformer+Embedding+Self-Attention原理详解
【报错记录】解决华擎J3455-ITX不插显示器无法开机的问题
随机推荐
按键精灵之输出文本
[贴装专题] 贴装流程中涉及到的位置关系计算
Dialogue with the DPO of a multinational consumer brand: How to start with data security compliance?See you on 8.11 Live!
UNIX Environment Programming Chapter 15 15.6 XSI IPC
多行省略和选择器
上传张最近做的E2用的xmms的界面的截图
Unix Environment Programming Chapter 15 15.9 Shared Storage
2021-01-11-雪碧图做表情管理器
程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果
OpengGL绘制立方体的三种方法
源代码阅读器项目
[Halcon&定位] 解决Roi区域外的模板匹配成功
BERT预训练模型(Bidirectional Encoder Representations from Transformers)-原理详解
stimulus.js 初体验
[Original] Usage of @PrePersist and @PreUpdate in JPA
笔记本电脑使用常见问题,持续更新
对话跨国消费品牌DPO:数据安全合规从何做起?8.11直播见!
情感分析SowNLP词库
The GNU Privacy Guard
How to quickly get through the mirror release process?