42
/
56
5.
#include <rpos\robot_platforms\slamware_core_platform.h>
6.
#include <rpos\robot_platforms\objects\composite_map_reader.h>
7.
#include <rpos\core\pose.h>
9.
using namespace
std;
11.
int
main()
12.
{
13.
try
14.
{
15.
string map_path =
".\\map.stcm"
;
//the path of map
16.
string Athena2.0_ip =
"192.168.11.1"
;
//the ip of Athena2.0
17.
int
Athena2.0_port = 1445;
//the port of Athena2.0 ,default is 1445
19.
rpos::robot_platforms::SlamwareCorePlatform Athena2.0 =
20.
rpos::robot_platforms::SlamwareCorePlatform::connect(Athena2.0_ip, Athena2.0_port);
21.
//connect to the Athena2.0
22.
rpos::robot_platforms::objects::CompositeMapReader cmapreader;
23.
//map reader
24.
rpos::core::Pose Athena2.0_pose = rpos::core::Pose(rpos::core::Location(0, 0, 0));
25.
//the Athena2.0 pose in map(Athena2.0_pose should be the Athena2.0's real pose in new map)
26.
//using Athena2.0.getpose() to get the old Athena2.0 pose
27.
auto map = cmapreader.loadFile(map_path);
28.
//load map
29.
Athena2.0.setCompositeMap(*map, Athena2.0_pose);
30.
//set compositemap
31.
rpos::core::Pose home_pose = rpos::core::Pose(rpos::core::Location(0, 0, 0));
32.
//the home pose in map(home_pose should be the home's real pose in new map)
33.
//using Athena2.0.gethomepose() to get the old home pose
34.
Athena2.0.setHomePose(home_pose);
35.
//set home pose
36.
}
37.
catch
(rpos::robot_platforms::ConnectionFailException &e)
38.
{
39.
cout <<
"connect failed on "
<< e.what() << endl;
40.
}
41.
catch
(rpos::system::detail::ExceptionBase &e)
42.
{
43.
cout <<
"failed on "
<< e.what() << endl;
44.
}
45.
46.
return
0;
47.
}
Further motion deployment details, please see the SDK instruction document
8.
10.
18.
Содержание N5M32-R2
Страница 6: ...5 56 1 3 Exterior...
Страница 13: ...12 56...
Страница 33: ...32 56 5 6 Internet Protocol Version 4 TCP IPv4...