ubuntu 18.04ros安装ros_control_boilerplate
时间: 2024-06-11 19:07:14 浏览: 280
1. 安装ROS
在Ubuntu 18.04上安装ROS,可以按照ROS官方文档的指导进行操作,具体步骤如下:
1)设置软件源
```bash
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
```
2)添加ROS公钥
```bash
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
```
3)安装ROS
```bash
sudo apt update
sudo apt install ros-melodic-desktop-full
```
4)初始化rosdep
```bash
sudo rosdep init
rosdep update
```
5)设置环境变量
```bash
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
```
2. 安装ros_control_boilerplate
安装ros_control_boilerplate可以使用ROS的包管理工具catkin,具体步骤如下:
1)创建catkin工作空间
```bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
```
2)下载ros_control_boilerplate源码
```bash
cd ~/catkin_ws/src
git clone https://github.com/PickNikRobotics/ros_control_boilerplate.git
```
3)安装依赖
```bash
sudo apt install ros-melodic-controller-manager ros-melodic-gazebo-ros-control
rosdep install --from-paths . --ignore-src --rosdistro melodic
```
4)编译
```bash
cd ~/catkin_ws/
catkin_make
```
5)设置环境变量
```bash
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
```
3. 使用ros_control_boilerplate
安装完成后,可以通过以下命令启动ros_control_boilerplate:
```bash
roslaunch ros_control_boilerplate gazebo.launch
```
该命令会启动Gazebo仿真环境,并加载ros_control_boilerplate的控制器,可以通过RViz进行控制。
阅读全文