Skip to content

Commit 27203c2

Browse files
author
Javier Moreno
committed
XML fix
1 parent b483e7e commit 27203c2

4 files changed

Lines changed: 51 additions & 8 deletions

File tree

‎uROS_Agent/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ endif()
247247
#Install
248248
install(
249249
FILES "${_DEFAULT_FASTRTPS_PROFILES_PATH}"
250-
DESTINATION "../microxrcedds_agent/bin"
250+
DESTINATION lib/${PROJECT_NAME}
251251
)
252252

253253

‎uROS_Agent/resource/StaticValues.xml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<participant profile_name="default_xrce_participant">
1+
<participant profile_name="participant_profile">
22
<rtps>
3-
<name>default_xrce_participant</name>
3+
<name>participant_profile</name>
44
</rtps>
55
</participant>
66
<data_writer profile_name="shapetype_data_writer">
@@ -21,4 +21,4 @@
2121
<kind>WITH_KEY</kind>
2222
<name>Square</name>
2323
<dataType>ShapeType</dataType>
24-
</topic>
24+
</topic>

‎uROS_Agent/resource/rclcpp.xml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<topic profile_name="parameter_events_t">
2+
<name>rt/parameter_events</name>
3+
<dataType>rcl_interfaces::msg::dds_::ParameterEvent_</dataType>
4+
</topic>
5+
<topic profile_name="clock_t">
6+
<name>rt/clock</name>
7+
<dataType>rosgraph_msgs::msg::dds_::Clock_</dataType>
8+
</topic>
9+
<data_writer profile_name="parameter_events_p">
10+
<topic>
11+
<kind>NO_KEY</kind>
12+
<name>rt/parameter_events</name>
13+
<dataType>rcl_interfaces::msg::dds_::ParameterEvent_</dataType>
14+
</topic>
15+
</data_writer>
16+
<data_reader profile_name="clock_s">
17+
<topic>
18+
<kind>NO_KEY</kind>
19+
<name>rt/clock</name>
20+
<dataType>rosgraph_msgs::msg::dds_::Clock_</dataType>
21+
</topic>
22+
</data_reader>
23+
<data_reader profile_name="parameter_events_s">
24+
<topic>
25+
<kind>NO_KEY</kind>
26+
<name>rt/parameter_events</name>
27+
<dataType>rcl_interfaces::msg::dds_::ParameterEvent_</dataType>
28+
</topic>
29+
</data_reader>

‎uROS_Agent/src/main.cpp‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@
1616
#ifdef _WIN32
1717
#include <uxr/agent/transport/udp/UDPServerWindows.hpp>
1818
#include <uxr/agent/transport/tcp/TCPServerWindows.hpp>
19-
#else
19+
20+
#elif __unix__
21+
#include <unistd.h>
22+
#include <libgen.h>
23+
2024
#include <uxr/agent/transport/serial/SerialServerLinux.hpp>
2125
#include <uxr/agent/transport/udp/UDPServerLinux.hpp>
2226
#include <uxr/agent/transport/tcp/TCPServerLinux.hpp>
2327
#include <termios.h>
2428
#include <fcntl.h>
25-
#endif //_WIN32
29+
#endif
30+
2631
#include <iostream>
2732
#include <string>
2833
#include <limits>
@@ -84,9 +89,18 @@ class uros_agent : public rclcpp::Node
8489

8590
int main(int argc, char** argv)
8691
{
92+
93+
#ifdef __unix__
94+
char exe_path[200];
95+
ssize_t count = readlink("/proc/self/exe", exe_path, sizeof(exe_path));
96+
if (count != -1) {
97+
chdir(dirname(exe_path));
98+
}
99+
#endif
100+
87101
bool initialized = false;
88102

89-
#ifndef _WIN32
103+
#ifdef __unix__
90104
if(argc == 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0))
91105
{
92106
showHelp();
@@ -218,7 +232,7 @@ int main(int argc, char** argv)
218232
{
219233
initializationError();
220234
}
221-
#else
235+
#elif _WIN32
222236
(void) argc;
223237
(void) argv;
224238

0 commit comments

Comments
 (0)