ROS_Beginner_tutorial

1. FileSystem in ROS

# rospack find [package_name]      //找到package的路径
# roscd [locationname[/subdir]]    //进入到package的目录下
$ echo $ROS_PACKAGE_PATH
# rosls [locationname[/subdir]]

2. Creat and build a package

$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
# catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
然后catkin_make即可创建package

查询依赖:

$ rospack depends1 beginner_tutorials 
$ rospack depends beginner_tutorials
个性化你的package: package.xml

首先是作者信息等,然后是build_depend, run_depend等

3. Understand Nodes

  • Nodes: A node is an executable file within a ROS package that uses ROS to communicate with other nodes. Nodes can publish or subscribe to a Topic. Nodes can also provide or use a Service.

  • Messages: ROS data type used when subscribing or publishing to a topic.

  • Topics: Nodes canpublish messages to a topic as well assubscribe to a topic to receive messages.

  • Master: Name service for ROS (i.e. helps nodes find each other)

  • rosout: ROS equivalent of stdout/stderr

  • roscore: Master + rosout + parameter server (parameter server will be introduced later)


$ rosrun turtlesim turtlesim_node __name:=my_turtle
$ rosnode list
$ rosnode info [topic]
$ rosnode ping turtlesim_node

4. understand Topic

rostopic echo shows the data published on a topic. rostopic echo [topic]

rostopic list returns a list of all topics currently subscribed to and published.

rostopic type returns the message type of any topic being published.    rosmsg show [msg_type]

rostopic pub publishes data on to a topic currently advertised.

rostopic pub [topic] [msg_type] [args]
$ rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

rosrun rqt_graph rqt_graph

$ rosrun rqt_plot rqt_plot


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值