ROS进阶学习手记 8 -- 认识tf

ROS进阶学习手记 8 – 认识tf TF - Transform 官网wiki对 tf 包的文档资料: http://wiki.ros.org/tf 了解了基本的tf的作用,来看个Demo: http://wiki.ros.org/tf/Tutorials/Introduction%20to%20tf 这个demo运行了一个双龟跟随的游戏,使用 teleop_key node进行第一个龟的导引,第二个龟跟随。 $ roslaunch turtle_tf turtle_tf_demo.launch 坐标变换的公式: create three coordinate frames: a world frame, a turtle1 frame, a turtle2 frame. tf broadcaster ____turtle coordinate frames____»>tf listener tf Tools $ rosrun tf view_frames To view the tf tree: $ evince frames.pdf Using rqt_tf_tree $ rosrun rqt_tf_tree rqt_tf_tree or: $ rqt & Using tf_echo Usage: rosrun tf tf_echo [reference_frame] [target_frame] $ rosrun tf tf_echo turtle1 turtle2 #turtle2 相对于 turtle1 的位置(站在turtle1上看turtle2) rviz and tf

READ MORE

ROS进阶学习手记 7.2 -- RViz仿真实例2:Create SmartCar

上一节玩了 exbot 在RViz里的仿真控制,这里我们用urdf文件写个自己的小车模型,ref: http://blog.csdn.net/hcx25909/article/details/8904292 (待修正) 1.  创建一个package: smartcar_description   创建一个package: smartcar_description  urdf  ,依赖:urdf    $ catkin_create_pkg smartcar_description urdf 2. SmartCar 尺寸数据    因为建立的是一个非常简单的机器人,所以我们尽量使用简单的元素:使用长方体代替车模,使用圆柱代替车轮,具体尺寸如下:    3. 创建智能车的描述文件smartcar.urdf    在smartcar_description文件夹下建立urdf文件夹,创建智能车的描述文件smartcar.urdf,描述代码如下:     4. 创建launch文件 <launch> <arg name="model" /> <arg name="gui" default="False" /> <param name="robot_description" textfile="$(find smartcar_description)/urdf/smartcar.urdf" /> <param name="use_gui" value="$(arg gui)"/> <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" ></node> <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" /> <node name="rviz" pkg="rviz" type="rviz" args="-d $(find urdf_tutorial)/urdf.rviz" /> </launch> 5. 效果演示    在Terminal中输入演示命令: $ roslaunch  smartcar_description  base.urdf.rviz.launch  gui:=true  这里我们遇到了一个错误,   我想原因是来源网页作者使用了Groovy版本的ROS(相对本系列使用的Hydro要老),所以我的计划是先完成urdf的学习再来进行此例程:http://wiki.ros.org/urdf 在完成urdf之前,关于ros_tf的学习应该是基础,所以接下来先进行ros tf(transform)的学习。 在学习tf过程中,发现运行多个节点需要用到launch文件,所以launch文件的学习应该是最前的。 launch file >> tf >> urdf

READ MORE

ROS Industrial 简介

ROS_I means ROS Industrial ROS_I 解决了哪些问题:   1. 让自动化可以互相协作,操纵器、末端执行器、感知系统/传感器,移动平台,周边设备,都可只用一种语言(ROS messages)交流。在无视OEM厂商品牌或者通信总线的情况下,也能协作。   2. 免费的封装模块库,提供了高级能力,最好的技术可以得到传播,绕开了专有厂商的锁定,再培训或价格问题。   3. 为制造自动化软件的开源开发,提供了监管和结构。在这个项目中的代码都是被复审过,并且自动评估质量指标。   4. 为学术研究提供了一个自我审查的渠道,使之可以快速应用到工业中。 Can I develop closed-source software for ROS-I and sell it for profit? A: Yes! We desire for the ROS-I community to foster all manner of new businesses selling ROS-I compatible software nodes, development tools, GUIs, support and integration services. Is ROS-Industrial suitable for real-time control? A: Like ROS, ROS-I nominally runs on Ubuntu Linux, which is not a real-time OS. ROS-I is fast enough to run closed-loop with perception systems for manufacturing automation applications, but (at least for now) ROS-I must be used as a high-level controller in conjunction with a low-level real-time controller (usually the one from the OEM), which closes servo feedback loops and provides safety behavior (e.

READ MORE

ROS进阶学习手记 7 -- RViz仿真实例1

【任务2】:     用simulator: RViz 工具,完成对小车的建模,名字drive RViz = dvrv, 用 dvrv_node 发布topic和数据格式,向它发送位置指令,使它能接受键盘输入,并完成前进,后退,转弯90°功能。     Topic, 还是拟用/turtle1/cmd_vel     Message Type: geometry_msgs/Twist     -----------     1. RViz介绍          参考:RViz Package Link: http://wiki.ros.org/rviz                    内含:RViz User Guide:    http://wiki.ros.org/rviz/UserGuide                               RViz Tutorials:        http://wiki.ros.org/rviz/Tutorials          rviz是一个显示机器人实体的工具,本身不具有模拟的功能,需要安装一个模拟器arbotix。但官网有关arbotix的资料很缺,跟另一个“10分钟上手玩ROS仿真”http://blog.exbot.net/archives/899, 对比一个不work的教程:ros_by_example_1_hydro.pdf  (6.2 Testing the Simulator),有兴趣可以研究5. Installing the ros-by-example Code以后,再玩6.2, 估计就work了。本次就不深入那个。     2. 用ExBot机器人实验室的包来仿真          打开terminal,输入命令: roslaunch exbotxi_rviz view_model.launch          将会打开rviz,并加载查看ExBot XI移动机器人平台模型的配置。          ExBot XI移动机器人平台兼容turtlebot了,这里就用turtlebot包的键盘控制node来控制机器人移动。 Ctrl + C 结束掉前面的程序,关闭terminal,然后再打开3个terminal,分别输入下面的3个命令: roslaunch exbotxi_bringup fake_exbotxi.launch roslaunch exbotxi_rviz view_mobile.launch roslaunch turtlebot_teleop keyboard_teleop.launch          跟这个“10分钟上手玩ROS仿真” 走完整个流程就好。

READ MORE

用网线直连的两台PC上的虚拟机通过网线通信的配置

Configure the ROS Networks: Quick Reference: http://blog.csdn.net/sonictl/article/details/46986565#t4 Above is for the higher user's reference. 虚拟机工具: VirtualBox 4.3.28 Host PC: Windows 7 Virtual Machine OS: Ubuntu 12.04 ===== 虚拟机与虚拟机的网络连接 ===== 物理结构: ┎────────────┒                    ┎────────────┒ ┃  虚拟机1   ┃                    ┃   虚拟机2  ┃ ┃------------┃        网线        ┃------------┃ ┃  宿主机1   ┃ <----------------> ┃   宿主机2  ┃ ┖────────────┚                    ┖────────────┚   要实现虚拟机1与虚拟机2的ping通,需要首先让宿主机1与宿主机2ping通 http://jingyan.baidu.com/article/3065b3b6c552edbecff8a4a1.html 使用Bridge方式桥接,相当于现在有了4台电脑用网线连接起来。   配置虚拟机1的ip为:         IP addr:192.168.2.111    Mask:255.255.255.0  DefaultGateway: 192.168.2.1   Bcast:default   配置宿主机1的ip为:         IP addr:192.168.2.1       Mask:255.255.255.0  DefaultGateway: 192.168.2.1   Bcast:default  配置虚拟机2的ip为:         IP addr:192.

READ MORE

ROS进阶学习手记 6 -- Configure ROS Network - 利用PC1控制PC2上的乌龟

ROS进阶学习手记 6 – Configure ROS Network - 利用PC1控制PC2上的乌龟 Configure the ROS Networks: Quick Reference: http://blog.csdn.net/sonictl/article/details/46986565#t4 Above is for the higher user’s reference. Below is the tutorial for the beginners: 在完成了上一节,我们已经可以自己写node向某个topic发送某个msg data structure的Messages。 这一节我想完成 Remote 通信的任务,真正体现ROS的分布式计算的特点。 参考: http://wiki.ros.org/ROS/NetworkSetup http://wiki.ros.org/ROS/Tutorials/MultipleMachines 网络连接: 物理连接: 使用Bridge方式桥接,相当于现在有了4台电脑用网线连接起来。(怎么建立见文后附录) 配置虚拟机1的ip为: IP addr:192.168.2.111 Mask:255.255.255.0 DefaultGateway: 192.168.2.1 Bcast:default 配置宿主机1的ip为: IP addr:192.168.2.1 Mask:255.255.255.0 DefaultGateway: 192.168.2.1 Bcast:default 配置虚拟机2的ip为: IP addr:192.168.2.222 Mask:255.255.255.0 DefaultGateway: 192.168.2.1 Bcast:default 配置宿主机2的ip为: IP addr:192.168.2.2 Mask:255.255.255.0 DefaultGateway: 192.168.2.1 Bcast:default 好,我们假设建立了ubt - ubt之间的连接(怎么建立见文后附录,或http://blog.csdn.net/sonictl/article/details/47005273) 我们在ubt_for_ROS1上ping 192.168.2.222, 在ubt_for_ROS2上ping 192.168.2.111, 都能ping通。 用netcat测试端口是否连通:http://wiki.ros.org/ROS/NetworkSetup#Further_check:_netcat 在ubt_for_ROS1上: $ netcat -l 1431 在ubt_for_ROS2上:

READ MORE

ROS进阶学习手记 5 -- 使用Eclipse开发robot_cleaner

ROS进阶学习手记 5 – 使用Eclipse开发robot_cleaner 接上一节, ======= 开始用Eclipse写一个发布给Turtlesim_node驱动和角度Msg的 my_node1 ===== 参考Youtube上两个视频: [CS460] ROS Tutorial 4.1 Turtlesim Cleaner Application - An Overview [CS460] ROS Tutorial 4.2 Moving in a Straight Line (Turtlesim Cleaner) 我们来在Eclipse里写这个node的代码。 2015年7月21日09:59:26 建立一个名为robot_cleaner的Package,生成robot_cleaner_node,向turtlesim_node发送msg. topic info: topic_name: /turtle1/cmd_vel topic_type: geometry_msgs/Twist Message info: $ rosmsg show geometry_msgs/Twist show the data struct: geometry_msgs/Vector3 linear float64 x float64 y float64 z geometry_msgs/Vector3 angular float64 x float64 y float64 z $ rostopic echo /turtle1/cmd_vel 得到: linear: x: 0.0 y: 0.0 z: 0.0 angular: x: 0.

READ MORE

ROS进阶学习手记 4 -- 使用Eclipse开发ROS

ROS进阶学习手记 4 – 使用Eclipse开发ROS http://wiki.ros.org/IDEs 遇到无法导入到eclipse的问题,用下一篇文章的思路进行解决: http://www.cnblogs.com/freedomshe/archive/2013/05/16/configure_eclipse_in_catkin.html http://blog.csdn.net/sujun3304/article/details/18572017 http://answers.ros.org/question/52013/catkin-and-eclipse/ 【步骤】 在catkin ’s workspace下建立自己的package: beginner_tutorials Transfor your catkin project into Eclipse project. i.e. create the .project files. import the Eclipse’s project into Eclipse. Try to compile, build and debug your code. 中途我遇到一点问题,就是我在exbot上下载安装的Ubuntu12.04 for ROS in Hydro(开发版), 打开Eclipse发现Project Pannel里不显示任何项目。后来重装了一次才解决。 完成了make the Eclipse Project以后,就可以follow the http://wiki.ros.org/IDEs to import » Build. 我做得还比较顺利。 下面就是运行了: Running and debugging your executables within Eclipse As for building within Eclipse, the crucial step here is to set the required environment variables correctly in the launch configuration.

READ MORE

ROS进阶学习手记 3 -- RViz工具的学习2,Markers- Sending Basic Shapes

ROS进阶学习手记 3 – RViz工具的学习2,Markers- Sending Basic Shapes Markers: Sending Basic Shapes (C++) 我是从这里开始:http://wiki.ros.org/rviz 在它之下,先玩完这一部分:http://wiki.ros.org/rviz/UserGuide 今天要玩这一部分: http://wiki.ros.org/rviz/Tutorials/Markers%3A%20Basic%20Shapes Description: Shows how to use visualization_msgs/Marker messages to send basic shapes (cube, sphere, cylinder, arrow) to rviz. 2. Intro Unlike other displays, the Marker Display lets you visualize data in rviz without rviz knowing anything about interpreting that data. Instead, primitive objects are sent to the display throughvisualization_msgs/Marker messages, which let you show things like arrows, boxes, spheres and lines. This tutorial will show you how to send the four basic shapes (boxes, spheres, cylinders, and arrows).

READ MORE

ROS进阶学习手记 2 -- RViz工具的学习1

ROS进阶学习手记 2 – RViz工具的学习1 ROS中提供了很多强大的功能,我们学习完前面的基本知识之后要继续进行深入。除了RviZ,还有一种叫 Stage simulator 也能模拟机器人motion 1、认识rviz rviz是ROS中一款强大的3D可视化工具,这个玩意在后面可是要频繁用到的,是必须要弄明白的,详细的教程可以参考wiki:http://wiki.ros.org/rviz/UserGuide 我们可以在里面创建自己的机器人,并且让机器人动起来。还可以创建地图,显示3D点云等等,总之,想在ROS中显示的东东都可以在这里显示出来。当然这些显示都是通过消息的订阅来完成的,机器人通过ROS发布数据,rviz订阅消息接收数据,然后显示,这些数据也是有一定的数据格式的,可以参考下面的链接: http://wiki.ros.org/rviz/DisplayTypes 看到上面的机器人了吧,是不是很酷,在rviz中,这样的机器人模型是通过urdf文件描述的,具体urdf文件怎么写,参考wiki: http://wiki.ros.org/urdf ================================ 2. 开始RViz的学习 我是从这里开始:http://wiki.ros.org/rviz 在它之下,先玩这一部分:http://wiki.ros.org/rviz/UserGuide 3. RViz的安装和运行 目录 Troubleshooting Install or build rviz Install from debian repository Build from source Startup Displays Adding a new display Display Properties Display Status Moving Displays Built-in Display Types Configurations 0.4 and above 0.3 and below Views Panel The different camera types Orbital Camera (default) FPS (first-person) Camera Top-down Orthographic Views Coordinate Frames The Fixed Frame The Target Frame Tools Move Camera (Keyboard shortcut: m) Select (Keyboard shortcut: s) 2D Nav Goal (Keyboard shortcut: g) 2D Pose Estimate (Keyboard shortcut: p) Time Stereo Plugins Troubleshooting

READ MORE