赞
踩
urdf模型搭建参考:https://www.cnblogs.com/IT-cute/p/12990162.html
gazebo插件控制:https://www.cnblogs.com/IT-cute/p/12990307.html
键盘控制节点:https://www.guyuehome.com/253
sudo apt-get install ros-kinetic-urdf-tutorial
mkdir myrobot/src -p
cd myrobot/src
catkin_init_workspace
cd ..
catkin_make
cd ~/myrobot/src/
catkin_create_pkg smartcar std_msgs rospy roscpp urdf
cd smartcar
mkdir urdf&launch
cd urdf
gedit myrobot.urdf
<robot name="test_robot">
<link name="base_link">
<visual>
<geometry>
<box size="0.2 .3 .1"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.05"/>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
</link>
<link name="wheel_1">
<visual>
<geometry>
<cylinder length="0.05" radius="0.05"/>
</geometry>
<origin rpy="0 1.5 0" xyz="0.1 0.1 0"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
<link name="wheel_2">
<visual>
<geometry>
<cylinder length="0.05" radius="0.05"/>
</geometry>
<origin rpy="0 1.5 0" xyz="-0.1 0.1 0"/>
<material name="black"/>
</visual>
</link>
<link name="wheel_3">
<visual>
<geometry>
<cylinder length="0.05" radius="0.05"/>
</geometry>
<origin rpy="0 1.5 0" xyz="0.1 -0.1 0"/>
<material name="black"/>
</visual>
</link>
<link name="wheel_4">
<visual>
<geometry>
<cylinder length="0.05" radius="0.05"/>
</geometry>
<origin rpy="0 1.5 0" xyz="-0.1 -0.1 0"/>
<material name="black"/>
</visual>
</link>
<joint name="joint_base_wheel1" type="fixed">
<parent link="base_link"/>
<child link="wheel_1"/>
</joint>
<joint name="joint_base_wheel2" type="fixed">
<parent link="base_link"/>
<child link="wheel_2"/>
</joint>
<joint name="joint_base_wheel3" type="fixed">
<parent link="base_link"/>
<child link="wheel_3"/>
</joint>
<joint name="joint_base_wheel4" type="fixed">
<parent link="base_link"/>
<child link="wheel_4"/>
</joint>
</robot>
check_urdf 01_skeleton.urdf
car01.launch
文件,里面输入以下代码<!-- -->
<launch>
<param name="robot_description"
textfile="$(find little_car)/urdf/car01.urdf"/> // 这一行需要更改为自己urdf文件所在位置
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
<node name="rviz" pkg="rviz" type="rviz" respawn="false" output="screen"/>
</launch>
roslaunch smartcar car01.launch
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。