建模实践4 —— 在gazebo中进行简单的仿真
在优化物理仿真模型基础中,已经添加了机器人的碰撞属性和惯性参数,添加了Transmissions、gazebo_ros_control 插件,接下来要做的就是为机器人的控制器编写配置文件。
1.创建控制器
第一步:在husky_kinova/husky_kinova_control/config文件夹下创建控制器的配置文件control.yaml:
joint_state_controller:
type: "joint_state_controller/JointStateController"
publish_rate: 50
husky_diff_drive_controller:
type: "diff_drive_controller/DiffDriveController"
left_wheel: ['front_left_wheel', 'rear_left_wheel']
right_wheel: ['front_right_wheel', 'rear_right_wheel']
publish_rate: 50
pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
cmd_vel_timeout: 0.25
velocity_rolling_window_size: 2
# Base frame_id
base_frame_id: base_link
# Odometry fused with IMU is published by robot_localization, so
# no need to publish a TF based on encoders alone.
enable_odom_tf: false
# Husky hardware provides wheel velocities
estimate_velocity_from_position: false
# Wheel separation and radius multipliers
wheel_separation_multiplier: 1.875 # default: 1.0
wheel_radius_multiplier : 1.0 # default: 1.0
# Velocity and acceleration limits
# Whenever a min_* is unspecified, default to -max_*
linear:
x:
has_velocity_limits : true
max_velocity : 1.0 # m/s
has_acceleration_limits: true
max_acceleration : 3.0 # m/s^2
angular:
z:
has_velocity_limits : true
max_velocity : 2.0 # rad/s
has_acceleration_limits: true
max_acceleration : 6.0 # rad/s^2
finger_1_position_controller:
joint: j2n6s300_joint_finger_1
pid:
d: 0
i: 0
p: 10
type: effort_controllers/JointPositionController
finger_2_position_controller:
joint: j2n6s300_joint_finger_2
pid:
d: 0
i: 0
p: 10
type: effort_controllers/JointPositionController
finger_3_position_controller:
joint: j2n6s300_joint_finger_3
pid:
d: 0
i: 0
p: 10
type: effort_controllers/JointPositionController
finger_tip_1_position_controller:
joint: j2n6s300_joint_finger_tip_1
pid:
d: 0
i: 0
p: 0.5
type: effort_controllers/JointPositionController
finger_tip_2_position_controller:
joint: j2n6s300_joint_finger_tip_2
pid:
d: 0
i: 0
p: 0.5
type: effort_controllers/JointPositionController
finger_tip_3_position_controller:
joint: j2n6s300_joint_finger_tip_3
pid:
d: 0
i: 0
p: 0.5
type: effort_controllers/JointPositionController
joint_1_position_controller:
joint: j2n6s300_joint_1
pid:
d: 0
i: 0
p: 5000
type: effort_controllers/JointPositionController
joint_2_position_controller:
joint: j2n6s300_joint_2
pid:
d: 0
i: 0
p: 5000
type: effort_controllers/JointPositionController
joint_3_position_controller:
joint: j2n6s300_joint_3
pid:
d: 0
i
Gazebo仿真教程

本文介绍了如何在Gazebo环境中创建控制器、构建物理环境及添加各类传感器,包括摄像头、RGB-D传感器和激光雷达等,提供了详细的配置文件示例。
最低0.47元/天 解锁文章
1万+





