【资料图】
博客地址:https://www.cnblogs.com/zylyehuo/
gazebo小车模型创建详见另一篇博客
博客地址:gazebo小车模型(附带仿真环境) - zylyehuo - 博客园参考链接
Autolabor-ROS机器人入门课程《ROS理论与实践》
ROS源码安装teleop_twist_keyboard
成果图
step1: 打开vscode进入之前创建的 mycar_ws 工作空间
step2:按如图结构创建文件夹及文件
step3: 代码部分
src/mycar/urdf/gazebo/move.xacro
transmission_interface/SimpleTransmission hardware_interface/VelocityJointInterface hardware_interface/VelocityJointInterface 1 Debug true / 1 true true 100.0 true left_wheel2base_link right_wheel2base_link ${base_radius * 2} ${wheel_radius * 2} 1 30 1.8 cmd_vel odom odom base_footprint src/mycar/urdf/xacro/car.urdf.xacro
step4: 运行 gazebo
(1)在终端执行 roscore 指令
roscore(2)在 vscode 中 编译启动 launch文件
source ./devel/setup.bashroslaunch mycar environment.launch(3)gazebo 打开后,再打开一个新终端
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _speed:=0.3 _turn:=0.5问题汇总
1、[rospack] Error: package "teleop_twist_keyboard" not found
解决方法
参考地址:ROS源码安装teleop_twist_keyboard
2、运行 gazebo 报错
解决方法
(1)检查 src/mycar/urdf/xacro/car.urdf.xacro 中路径是否正确
(2)检查 src/mycar/urdf/gazebo/move.xacro 中 joint_name 等结点名称是否与之前定义的一致


全国首份《家庭教育令》来了!督促家长“依法带娃”