瞬驰(Dash)D1开发手册--Raspberry Pi之ROS空间的创建
2016-05-07 10:38
483 查看
上一节,我们已经在Raspberry Pi上安装了ROS系统。这一节,我们来学习下如何构建ROS工作空间。
下载ros_arduino_bridge包,用于和下位机通讯,控制底盘的移动。
创建dashgo_bringup包
编译软件包
创建dashgo的启动文件 ~/dashgo_ws/src/dashgo_bringup/launch/minimal.launch,内容如下:
ros_arduino_python监听的速度由”cmd_vel”修改为“smooth_cmd_vel”
时间同步
设置ROS环境变量,在~/.bashrc和 ~/.profile分别添加
另外需要安装下vim
创建工作空间和ROS包
创建工作空间目录mkdir ~/dashgo_ws/src
下载ros_arduino_bridge包,用于和下位机通讯,控制底盘的移动。
git clone https://github.com/hbrobotics/ros_arduino_bridge.git cd ros_arduino_bridge git checkout indigo-devel
创建dashgo_bringup包
cd ~/dashgo_ws/src catkin_create_pkg dashgo_bringup std_msgs rospy roscpp cd ~/dashgo_ws/src/dashgo_bringup mkdir launch script config
编译软件包
cd ~/catkin_ws catkin_make
修改配置
添加ros_arduino_python配置文件 ~/dashgo_ws/src/dashgo_bringup/config/my_arduino_params.yaml ,内容如下:port: /dev/ttyACM0 baud: 115200 timeout: 0.1 rate: 50 sensorstate_rate: 10 use_base_controller: True base_controller_rate: 10 # For a robot that uses base_footprint, change base_frame to base_footprint base_frame: base_link # === Robot drivetrain parameters wheel_diameter: 0.12 wheel_track: 0.35 encoder_resolution: 900 gear_reduction: 1.0 motors_reversed: False # === PID parameters Kp: 100 Kd: 0 Ki: 0 Ko: 1000 accel_limit: 0.3 # === Sensor definitions. Examples only - edit for your robot. sensors: { }
创建dashgo的启动文件 ~/dashgo_ws/src/dashgo_bringup/launch/minimal.launch,内容如下:
<launch> <node name="arduino" pkg="ros_arduino_python" type="arduino_node.py" output="screen> <rosparam file="$(find dashgo_bringup)/config/my_arduino_params.yaml" command="load" /> </node> <arg name="node_name" value="velocity_smoother"/> <arg name="nodelet_manager_name" value="nodelet_manager"/> <arg name="config_file" value="$(find dashgo_bringup)/config/yocs_velocity_smoother.yaml"/> <arg name="raw_cmd_vel_topic" value="cmd_vel"/> <arg name="smooth_cmd_vel_topic" value="smooth_cmd_vel"/> <arg name="robot_cmd_vel_topic" value="robot_cmd_vel"/> <arg name="odom_topic" value="odom"/> <!-- nodelet manager --> <node pkg="nodelet" type="nodelet" name="$(arg nodelet_manager_name)" args="manager"/> <!-- velocity smoother --> <include file="$(find yocs_velocity_smoother)/launch/velocity_smoother.launch"> <arg name="node_name" value="$(arg node_name)"/> <arg name="nodelet_manager_name" value="$(arg nodelet_manager_name)"/> <arg name="config_file" value="$(arg config_file)"/> <arg name="raw_cmd_vel_topic" value="$(arg raw_cmd_vel_topic)"/> <arg name="smooth_cmd_vel_topic" value="$(arg smooth_cmd_vel_topic)"/> <arg name="robot_cmd_vel_topic" value="$(arg robot_cmd_vel_topic)"/> <arg name="odom_topic" value="$(arg odom_topic)"/> </include> </launch>
ros_arduino_python监听的速度由”cmd_vel”修改为“smooth_cmd_vel”
环境变量和权限
添加串口访问权限sudo usermod -a -G dialout pi
时间同步
sudo ntpdate ntp.ubuntu.com
设置ROS环境变量,在~/.bashrc和 ~/.profile分别添加
alias vi='vim' alias ll='ls -l source /opt/ros/indigo/setup.bash source /home/pi/dashgo_ws/devel/setup.bash
另外需要安装下vim
sudo apt-get install vim
相关文章推荐
- 在ASP.NET 2.0中操作数据之十八:在ASP.NET页面中处理BLL/DAL层的异常
- 在ASP.NET 2.0中操作数据之十七:研究插入、更新和删除的关联事件
- 【Asp.Net MVC 以小见大】一步一步改写简单的登录注册(一)
- asp内乱码,注意不是ajax
- 二 ASP.NET MVC 第一个程序 hello world
- 一 ASP.NET MVC 实战 创建属于你的Blog
- Win2008SERVER 64位 asp+access无法运行解决办法
- 在ASP.NET 2.0中操作数据之十七:研究插入、更新和删除的关联事件
- 在ASP.NET 2.0中操作数据之十八:在ASP.NET页面中处理BLL/DAL层的异常
- 在ASP.NET 2.0中操作数据之十九:给编辑和新增界面增加验证控件
- 在ASP.NET 2.0中操作数据之二十:定制数据修改界面
- 在ASP.NET 2.0中操作数据之二十一:实现开放式并发
- 在ASP.NET 2.0中操作数据之二十二:为删除数据添加客户端确认
- 在ASP.NET 2.0中操作数据之二十三:基于用户对修改数据进行限制
- 在ASP.NET 2.0中操作数据之二十四:分页和排序报表数据
- 在ASP.NET 2.0中操作数据之二十五:大数据量时提高分页的效率
- 在ASP.NET 2.0中操作数据之二十六:排序自定义分页数据
- ASP.NET MVC之国际化(十一)
- 树莓派学习系列2---树莓派的配置详悉
- Java 8从永久代到metaspace