亞寵展、全球?qū)櫸锂a(chǎn)業(yè)風(fēng)向標(biāo)——亞洲寵物展覽會(huì)深度解析
1145
2025-04-01
目前已經(jīng)正式支持ROS1和ROS2:https://microsoft.github.io/Win-RoS-Landing-Page/#
適用于Windows的ROS
人們一直對(duì)機(jī)器人著迷。今天,先進(jìn)的機(jī)器人正在改變我們的生活,無(wú)論是在工作還是在家里。倉(cāng)庫(kù)機(jī)器人已經(jīng)為在線(xiàn)購(gòu)物者提供了次日送貨服務(wù),許多寵物主人依靠機(jī)器人真空吸塵器來(lái)保持地板清潔。制造業(yè),運(yùn)輸業(yè),醫(yī)療保健業(yè)和房地產(chǎn)業(yè)等多種行業(yè)都從機(jī)器人中受益。隨著機(jī)器人的發(fā)展,開(kāi)發(fā)工具也越來(lái)越先進(jìn)。許多開(kāi)發(fā)人員利用機(jī)器人操作系統(tǒng)(ROS),這是一套幫助您構(gòu)建復(fù)雜機(jī)器人的庫(kù)和工具。ROS被用于世界各地的許多尖端機(jī)器人項(xiàng)目中。
微軟很高興宣布推出適用于Windows的ROS1實(shí)驗(yàn)版。這將使Windows 10 IoT Enterprise的可管理性和安全性進(jìn)入創(chuàng)新的ROS生態(tài)系統(tǒng)。
幾十年來(lái),Windows一直是機(jī)器人和工業(yè)系統(tǒng)的可靠部分。借助ROS for Windows,開(kāi)發(fā)人員將能夠使用熟悉的Visual Studio工具集以及豐富的AI和云功能。我們期待通過(guò)向家庭,教育,商業(yè)和工業(yè)機(jī)器人展示硬件加速Windows機(jī)器學(xué)習(xí),計(jì)算機(jī)視覺(jué),Azure認(rèn)知服務(wù),Azure物聯(lián)網(wǎng)云服務(wù)和其他Microsoft技術(shù)等高級(jí)功能,為機(jī)器人技術(shù)帶來(lái)智能優(yōu)勢(shì)。制造商希望讓機(jī)器人更加了解周?chē)h(huán)境,更容易編程,更安全。世界各地的政府,制造商和學(xué)術(shù)界正在投資下一代制造業(yè),有時(shí)也被稱(chēng)為“工業(yè)4.0”。
微軟正與Open Robotics和ROS Industrial Consortium合作,將機(jī)器人操作系統(tǒng)引入Windows。微軟已加入ROS工業(yè)聯(lián)盟,其使命是將ROS的先進(jìn)功能擴(kuò)展到制造,并提高工業(yè)機(jī)器人的生產(chǎn)力和投資回報(bào)。在西班牙馬德里的ROSCon 2018上,微軟展示了一臺(tái)Robotis Turtlebot 3機(jī)器人,它運(yùn)行著名為Melodic Morenia的ROS版本,它識(shí)別并引導(dǎo)著最接近機(jī)器人的人。該機(jī)器人使用新的ROS節(jié)點(diǎn)在Intel Coffee Lake NUC上運(yùn)行Windows 10 IoT Enterprise,該節(jié)點(diǎn)利用硬件加速的Windows機(jī)器學(xué)習(xí)。微軟還展示了在Azure中運(yùn)行的ROS仿真環(huán)境。它展示了一群在虛擬世界中運(yùn)行的機(jī)器人,這些機(jī)器人連接到編排系統(tǒng)并通過(guò)Azure IoT Hub進(jìn)行控制。Microsoft將為ROS1和ROS2提供Windows構(gòu)建版本,并為Windows提供文檔,開(kāi)發(fā)和部署解決方案。
Windows上的ROS是實(shí)驗(yàn)性的。我們的目標(biāo)是2018年底的核心移植工作。
在Windows上使用ROS
在Windows上安裝ROS
你是ROS新手嗎?
了解Windows上的ROS與Linux上的ROS之間的差異
移植狀態(tài)
幫助和疑難解答
Turtlebot3入門(mén)(更新:Gazebo + Cartographer示例已添加)
Moveit入門(mén)!和UR3
在Windows上與ROS持續(xù)集成
關(guān)于Windows上的Azure DevOps buildfarm for ROS
從Source中為Windows建立ROS
在Azure中使用ROS
Azure IoT Hub的ROS
Windows安裝ROS參考:https://blog.csdn.net/ZhangRelay/article/details/82928141
ROS支持,是微軟物聯(lián)網(wǎng)的一部分。這里有兩個(gè)非常重要網(wǎng)站:
1. 文檔:https://ms-iot.github.io/ROSOnWindows/
2. 源碼:https://github.com/ms-iot/ROSOnWindows
----翻譯----
Windows與ROS簡(jiǎn)介
人類(lèi)一直對(duì)機(jī)器人充滿(mǎn)興趣。今天,無(wú)論是在工作還是在家中,先進(jìn)的機(jī)器人技術(shù)正在逐漸改變我們的生活。倉(cāng)儲(chǔ)物流機(jī)器人已經(jīng)能夠具備為在線(xiàn)購(gòu)物者提供第二天交付的能力,許多寵物主人依靠機(jī)器人真空吸塵器來(lái)保持地板清潔。制造業(yè)、運(yùn)輸業(yè)、醫(yī)療保健業(yè)和房地產(chǎn)業(yè)等多種行業(yè)都從機(jī)器人技術(shù)中受益。隨著機(jī)器人的發(fā)展,開(kāi)發(fā)工具也越來(lái)越先進(jìn)。許多開(kāi)發(fā)人員利用機(jī)器人操作系統(tǒng)(ROS),這是一套幫助開(kāi)發(fā)人員構(gòu)建復(fù)雜機(jī)器人軟件的庫(kù)和工具。ROS被用于世界各地的許多尖端機(jī)器人項(xiàng)目中。
微軟很高興宣布推出適用于Windows的ROS1實(shí)驗(yàn)版(注,ROS2也全面支持Windows系統(tǒng))。這將Windows 10 IoT Enterprise的可管理性和安全性帶入創(chuàng)新的ROS生態(tài)系統(tǒng)。
幾十年來(lái),Windows一直是機(jī)器人和工業(yè)系統(tǒng)可靠的軟件模塊。借助ROS for Windows,開(kāi)發(fā)人員將能夠使用熟悉的Visual Studio工具集以及豐富的AI(人工智能)和云功能。我們期待通過(guò)向家庭、教育、商業(yè)和工業(yè)機(jī)器人展示硬件加速Windows機(jī)器學(xué)習(xí)、計(jì)算機(jī)視覺(jué)、Azure認(rèn)知服務(wù)、Azure物聯(lián)網(wǎng)云服務(wù)和其他Microsoft技術(shù)等高級(jí)功能,為機(jī)器人技術(shù)帶來(lái)智能優(yōu)勢(shì)。制造商希望讓機(jī)器人更加了解周?chē)h(huán)境,更容易編程,更安全。世界各地的政府,制造商和學(xué)術(shù)界正在投資下一代制造業(yè),有時(shí)也被稱(chēng)為“工業(yè)4.0”。
微軟正與Open Robotics和ROS Industrial Consortium合作,將機(jī)器人操作系統(tǒng)(ROS)引入Windows。微軟已加入ROS工業(yè)聯(lián)盟,其使命是將ROS的先進(jìn)功能擴(kuò)展到制造,并提高工業(yè)機(jī)器人的生產(chǎn)力和投資回報(bào)。在西班牙馬德里的ROSCon 2018上,微軟展示了一臺(tái)Robotis Turtlebot 3機(jī)器人,它運(yùn)行著名為Melodic Morenia的ROS版本,識(shí)別并引導(dǎo)著最接近機(jī)器人的人。該機(jī)器人運(yùn)行新版的Windows 10 IoT Enterprise在Intel Coffee Lake NUC上使用ROS節(jié)點(diǎn),該節(jié)點(diǎn)利用硬件加速Windows機(jī)器學(xué)習(xí)。微軟還展示了在Azure中運(yùn)行的ROS模擬環(huán)境。它展示了一群在虛擬世界中運(yùn)行的機(jī)器人,這些機(jī)器人連接到編排系統(tǒng)并通過(guò)Azure IoT Hub進(jìn)行控制。Microsoft將為ROS1和ROS2提供Windows構(gòu)建版本,并為Windows提供文檔,開(kāi)發(fā)和部署解決方案。
Windows上的ROS是實(shí)驗(yàn)性的。我們的目標(biāo)是2018年底的核心移植工作。
在Windows上使用ROS
在Windows上安裝ROS
你是ROS新手嗎?入門(mén)看這里
了解Windows上的ROS與Linux上的ROS之間的差異
移植狀態(tài)
幫助和疑難解答
Turtlebot3入門(mén)
Moveit!和UR3入門(mén)
關(guān)于Windows上的Azure DevOps buildfarm for ROS
在Windows編譯ROS源碼
在Azure中使用ROS
Azure IoT Hub中的ROS
----
具體請(qǐng)參考官網(wǎng):
1 ?http://wiki.ros.org/win_ros
2 ?https://github.com/ros-windows/win_ros
3 ?http://wiki.ros.org/rosserial_windows
4 ?http://wiki.ros.org/rosserial_windows/Tutorials
Hello World from Windows
Description:?How to publish information to a ROS master from windows using rosserial_windows.
Keywords:?rosserial, windows, rosserial_windows
Tutorial Level:?INTERMEDIATE
目錄
Introduction
Generating the ros_lib
Installing rosserial_windows
Generate ros_lib
Add ros_lib to Visual Studio Project
Create a new Win32 Console Application
Copy ros_lib into the project
Add ros_lib to project
Add code to main for Hello World
Start ROS and rosserial_server
Run the app
Robot Doughnuts
Introduction
Windows machines can do all kinds of thing that are difficult to do in other environments: interface an MYO, displays for end users, and working with Windows-only software. Working with a ROS master from Windows can be difficult. The rosserial_windows package makes it much easier to send and receive ROS messages from Windows. This package generates all of the coded needed to drop into a Visual Studios Solution. The workflow is generally:
From the ROS based system, generate the ros_lib code
Drop the ros_lib code into a Visual Studios Solution
Write code to use ros_lib to connect to the ROS master and send/receive messages
Run rosserial_server socket on ROS master
Compile and run Windows app
This tutorial will guide you through those steps to be up and running with your own project.
Generating the ros_lib
Installing rosserial_windows
Install rosserial_windows and the rosserial server:
sudo apt-get install ros-hydro-rosserial-windows
sudo apt-get install ros-hydro-rosserial-server
Generate ros_lib
This step will generate the code that will be needed in the Visual Studio project to talk to the ROS master. You will need to supply the name of the folder into which to copy the finished files.
rosrun rosserial_windows make_libraries.py my_library
This will place the ros_lib folder in the folder my_library.
Add ros_lib to Visual Studio Project
NB: This tutorial assumes Visual Studio 2013 Express Desktop.
Create a new Win32 Console Application
Open Visual Studio
File -> New Project
Find the Win32 Console Application under Installed -> Templates -> Visual C++ -> Win32
Give your project a name. We'll use rosserial_hello_world
You will probably want to turn off precompile headers. The project should work with them enabled, but precompiled headers have caused problems in the past.
Copy ros_lib into the project
Copy the ros_lib folder into the rosserial_hello_world project folder. The folder structure should look like:
rosserial_hello_world/
ipch/
ros_lib/
ros.h
WindowsSocket.cpp
... all of the rosserial generated code, including folders for all of the message packages
rosserial_hello_world/
ReadMe.txt
rosserial_hello_world.cpp
rosserial_hello_world.vcxproj
rosserial_hello_world.vcxproj.filters
stdafx.cpp
stdafx.h
targetver.h
rosserial_hello_world.opensdf
rosserial_hello_world.sdf
rosserial_hello_world.sln
rosserial_hello_world.v12.suo
Add ros_lib to project
Add all of the files in the ros_lib folder that aren't in subfolders to your project. As of writing this, those are:
ros.h
duration.cpp
time.cpp
WindowsSocket.h
WindowsSocket.cpp
Then add the ros_lib folder to your includes path by:
Right-click on the rosserial_hello_world project in the Solution Explorer and go to Properties
Under C/C++, add "../ros_lib" to the Additional Include Directories property
Add code to main for Hello World
Since we're commanding a robot, why not send a command instead of just a string? Here we'll send the cmd_vel message to command a robot to go forward and spin around. You'll need to change the IP address to match the address of your ROS master.
切換行號(hào)顯示
1 // rosserial_hello_world.cpp : Example of sending command velocities from Windows using rosserial
2 //
3 #include "stdafx.h"
4 #include
5 #include
6 #include "ros.h"
7 #include
8 #include
9
10 using std::string;
11
12 int _tmain (int argc, _TCHAR * argv[])
13 {
14 ros::NodeHandle nh;
15 char *ros_master = "1.2.3.4";
16
17 printf ("Connecting to server at %s\n", ros_master);
18 nh.initNode (ros_master);
19
20 printf ("Advertising cmd_vel message\n");
21 geometry_msgs::Twist twist_msg;
22 ros::Publisher cmd_vel_pub ("cmd_vel", &twist_msg);
23 nh.advertise (cmd_vel_pub);
24
25 printf ("Go robot go!\n");
26 while (1)
27 {
28 twist_msg.linear.x = 5.1;
29 twist_msg.linear.y = 0;
30 twist_msg.linear.z = 0;
31 twist_msg.angular.x = 0;
32 twist_msg.angular.y = 0;
33 twist_msg.angular.z = -1.8;
34 cmd_vel_pub.publish (&twist_msg);
35
36 nh.spinOnce ();
37 Sleep (100);
38 }
39
40 printf ("All done!\n");
41 return 0;
42 }
A few notes on this code:
A "node handle" is the equivalent to a ROS node. You'll send everything through that handle
Use "init_node" to connect to your ROS master. The format is "hostname:port". The default port is 11411 if none is specified
The include files are organized by "package/msg.h" so that they match what you would expect from ROS
To publish a message, you first need to make a publisher and then advertise that you're publishing a message
finally, you can fill in the message data structure and use the publisher to send it
Spin once is used for both receiving messages and for any admin on the port, including keeping your connection alive
Beware of a precompile headers. They tend to break building the project.
Start ROS and rosserial_server
In order for rosserial_windows to communicate with the ROS master, a server socket is needed to connect. This tutorial uses a TCP socket, but in theory it is also possible to use a serial port. On the ROS master, start the ROS core:
roscore
In a separate terminal, start the rosserial server
rosrun rosserial_server socket_node
In a third terminal, use rostopic to see what your app sends
rostopic echo /cmd_vel
Run the app
Go back to your windows machine and run the app. You should see command velocities start appearing in the rostopic terminal on your ROS master.
Robot Doughnuts
If you set up a robot simulation in Gazebo, you can then see your robot move based on your commands from Windows. For example, if you follow the ROS 101?Drive a Husky?tutorial, you can use this to make the Husky do doughnuts. Here's how to set up that simulation.
In one terminal, launch the husky simulator in an empty world:
roslaunch husky_gazebo husky_empty_world.launch
In another terminal, start the rosserial_server with the command velocity topic remapped to where the Husky expects it.
rosrun rosserial_server socket_node cmd_vel:=/husky/cmd_vel
Now run your app again, and watch the Husky spin around!
----
Receiving Messages in rosserial_windows
Description:?An example of receiving messages in rosserial_windows
Keywords:?rosserial, windows, rosserial_windows
Tutorial Level:?INTERMEDIATE
目錄
Introduction
Using a Callback Function
Receiving Messages
Example
Running it all together
Class-based Approach
Introduction
By now you've learned how to say?Hello World?with rosserial_windows. But what about if you want to receive a message? This tutorial will guide you through receiving messages in rosserial_windows
Using a Callback Function
Receiving a message is a little more complicated than sending, but only slightly. You'll need to tell the node handle what to do when you receive a message. Specifically, we'll use a callback function that gets called when a message is received.
Let's say that you want to receive the estimated pose of the robot. Whenever that happens, you'll want to print out the pose. Here's a function that might do that.
切換行號(hào)顯示
1 void estimated_pose_callback (const geometry_msgs::PoseWithCovarianceStamped & pose)
2 {
3 printf ("Received pose %f, %f, %f\n", pose.pose.pose.position.x,
4 pose.pose.pose.position.y, pose.pose.pose.position.z);
5 }
That is an example of a callback function. It handles a new pose, in this case by printing to the screen. The next question is how do you get this called when receiving a new message? Assuming that you've already connected to the ROS master and have a?NodeHandle?called nh, here's how you would do that:
切換行號(hào)顯示
1 ros::Subscriber < geometry_msgs::PoseWithCovarianceStamped >
2 poseSub ("estimated_pose", &estimated_pose_callback);
3 nh.subscribe (poseSub);
Receiving Messages
Now you have a callback and you've subscribed, but if you don't actually give rosserial a chance to process messages you won't receive anything. Fortunately, we've been doing that all along. That's what this bit of code does:
切換行號(hào)顯示
1 while (1)
2 {
3 nh.spinOnce ();
4 Sleep (100);
5 }
All this does is give rosserial a chance to process messages and then sleep for a bit. The sleep is optional, though I don't recommend just calling spinOnce(). If you have other elements that you need to call that block for short periods, put them in this loop. Otherwise, beware that going too long between calling spinOnce() will produce disconnects.
Example
Here's the full example of how to receive messages.
切換行號(hào)顯示
1 #include "stdafx.h"
2 #include
3 #include
4 #include "ros.h"
5 #include
6 #include
7
8 using std::string;
9
10 void estimated_pose_callback (const geometry_msgs::PoseWithCovarianceStamped & pose)
11 {
12 printf ("Received pose %f, %f, %f\n", pose.pose.pose.position.x,
13 pose.pose.pose.position.y, pose.pose.pose.position.z);
14 }
15
16 int _tmain (int argc, _TCHAR * argv[])
17 {
18 ros::NodeHandle nh;
19 char *ros_master = "1.2.3.4";
20
21 printf ("Connecting to server at %s\n", ros_master);
22 nh.initNode (ros_master);
23
24 ros::Subscriber < geometry_msgs::PoseWithCovarianceStamped >
25 poseSub ("estimated_pose", &estimated_pose_callback);
26 nh.subscribe (poseSub);
27
28 printf ("Waiting to receive messages\n");
29 while (1)
30 {
31 nh.spinOnce ();
32 Sleep (100);
33 }
34
35 printf ("All done!\n");
36 return 0;
37 }
Running it all together
Again, assuming the Husky/Gazebo simulation from?ROS 101 Drive a Husky, here's how to receive the pose from odometry:
In one terminal, launch the husky simulator in an empty world:
roslaunch husky_gazebo husky_empty_world.launch
In another terminal, start the rosserial_server with the estimated_pose topic remapped to the odometry result from robot EKF:
rosrun rosserial_server socket_node estimated_pose:=/robot_pose_ekf/odom
Now run the app, and you should be receiving pose messages. If not, check that the mapping is correct, using rostopic if necessary.
Class-based Approach
It's possible to subclass the Subscriber class for a more object-oriented approach. In that case, instead of registering with the call back above simply instantiate the new class and pass that in to the subscribe call.
Git Windows 機(jī)器人
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶(hù)投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。
版權(quán)聲明:本文內(nèi)容由網(wǎng)絡(luò)用戶(hù)投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔(dān)相應(yīng)法律責(zé)任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實(shí)的內(nèi)容,請(qǐng)聯(lián)系我們jiasou666@gmail.com 處理,核實(shí)后本網(wǎng)站將在24小時(shí)內(nèi)刪除侵權(quán)內(nèi)容。