turtlebot 学习(2)

1、在gazebo中显示机器人::roslaunch turtlebot_gazebo turtlebot_world.launch
默认加载了一个playground 的world文件.

2、键盘控制::roslaunch turtlebot_teleop keyboard_teleop.launch --screen

3、 在rviz中显示::roslaunch turtlebot_rviz_launchers view_robot.launch --screen

4、显示图像::rosrun image_view image_view image:=/camera/rgb/image_raw

5、node与topic 连接图 rqt_graph::rosrun rqt_graph rqt_graph

6、可以发现速度命令的topic映射到了主题cmd_vel_mux/input/teleop, 查看主题类型::rostopic type cmd_vel_mux/input/teleop geometry_msgs/Twist

7、通过rostopic pub 命令::rostopic pub /cmd_vel_mux/input/teleop geometry_msgs/Twist “linear:
x: 0.1
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.1”

8、保存地图到本地文件夹::rosrun map_server map_saver -f ~/file_folder/test_map

9、加载Gazebo仿真环境::roslaunch turtlebot_gazebo turtlebot_world.launch

10、加载地图::roslaunch turtlebot_gazebo amcl_demo.launch map_file:=~/file_folder/test_map.yaml

11、rrt算法::roslaunch rrt_exploration_tutorials single_simulated_house.launch

12、RRT::roslaunch rrt_exploration single.launch

13、rostopic echo 向终端打印topic的信息::rostopic echo /turtle1/cmd_vel)

14、rostopic pub 向话题发布消息(message)rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist – ‘[2.0, 0.0, 0.0]’ ‘[0.0, 0.0, 1.8]’【“-”短划线代表参数是可选参数, “-- ”代表参数是非可选参数】

15、rostopic type 打印话题的消息类型::rostopic type /turtle1/cmd_vel
16、rostopic pub /cmd_vel geometry_msgs/Twist ‘{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 6.28}}’
原地打转

17、rostopic pub /cmd_vel geometry_msgs/Twist ‘{linear: {x: -1, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}’
往后退
18、加环境变量 echo "source ~/catkin_ws/devel/setup.bash " >> ~/.bashrc
source ~/.bashrc

19、补全依赖 rosdep install --from-paths src -i -y

20、创建工作空间
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws/
catkin_make

21、在learning_topic文件下的src中创建subscribe.cpp文件
subscriber
1.初始化ros节点
2.订阅需要的话题
3.循环等待话题消息,接收到消息后进入回调函数。
4.在回调函数中完成消息处理

22、编辑Cmakelists.txt
add_executable(pose_subscriber src/pose_subscribe.cpp)
target_link_libraries(pose_subscriber ${catkin_LIBRARIES})

23、清华源 pip install cmake -i https://pypi.tuna.tsinghua.edu.cn/simple

24、找某个pkg的地址
rospack find package name
25、列出本地所有pkg
rospack list
26、转到某个pkg路径下
roscd package name
27、列举某个pkg 下的文件信息
rosls package name
28、编辑pkg中的文件
roscd package name file name
29、创建一个pkg
catkin_create_pkg [deps)
30、安装某个pkg所需的依赖
rosdep install (pkg namel

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值