Skip to content

Commit 03b845c

Browse files
authored
Merge branch 'main' into point-cloud-transport-plugins
2 parents 6f43ff4 + b5af486 commit 03b845c

File tree

6 files changed

+296
-10
lines changed

6 files changed

+296
-10
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
diff --git a/src/decoder.cpp b/src/decoder.cpp
2+
index 0a12d25..10834e3 100644
3+
--- a/src/decoder.cpp
4+
+++ b/src/decoder.cpp
5+
@@ -38,7 +38,11 @@ Decoder::~Decoder() { reset(); }
6+
void Decoder::reset()
7+
{
8+
if (codecContext_) {
9+
+#if LIBAVFORMAT_VERSION_MAJOR < 59
10+
avcodec_close(codecContext_);
11+
+#else
12+
+ avcodec_free_context(&codecContext_);
13+
+#endif
14+
av_free(codecContext_);
15+
codecContext_ = NULL;
16+
}
17+
diff --git a/src/encoder.cpp b/src/encoder.cpp
18+
index a4b6de6..2e1d4a2 100644
19+
--- a/src/encoder.cpp
20+
+++ b/src/encoder.cpp
21+
@@ -54,7 +54,11 @@ static void free_frame(AVFrame ** frame)
22+
void Encoder::closeCodec()
23+
{
24+
if (codecContext_) {
25+
+#if LIBAVFORMAT_VERSION_MAJOR < 59
26+
avcodec_close(codecContext_);
27+
+#else
28+
+ avcodec_free_context(&codecContext_);
29+
+#endif
30+
codecContext_ = nullptr;
31+
}
32+
free_frame(&frame_);
33+
diff --git a/src/utils.cpp b/src/utils.cpp
34+
index da089e4..01e8eea 100644
35+
--- a/src/utils.cpp
36+
+++ b/src/utils.cpp
37+
@@ -104,8 +104,15 @@ enum AVPixelFormat get_preferred_pixel_format(
38+
std::vector<enum AVPixelFormat> get_encoder_formats(const AVCodec * c)
39+
{
40+
std::vector<enum AVPixelFormat> formats;
41+
- if (c && c->pix_fmts) {
42+
- for (const auto * p = c->pix_fmts; *p != AV_PIX_FMT_NONE; ++p) {
43+
+#if LIBAVUTIL_VERSION_MAJOR > 59 || (LIBAVUTIL_VERSION_MAJOR == 59 && LIBAVUTIL_VERSION_MINOR >= 39)
44+
+ const enum AVPixelFormat *pix_fmts = NULL;
45+
+ avcodec_get_supported_config(NULL, c, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void **) &pix_fmts, NULL);
46+
+ if (c && pix_fmts) {
47+
+#else
48+
+ const enum AVPixelFormat *pix_fmts = c->pix_fmts;
49+
+ if (c && pix_fmts) {
50+
+#endif
51+
+ for (const auto * p = pix_fmts; *p != AV_PIX_FMT_NONE; ++p) {
52+
formats.push_back(*p);
53+
}
54+
}
Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
diff --git a/include/ur_client_library/comm/bin_parser.h b/include/ur_client_library/comm/bin_parser.h
2+
index e13aba6..6931af3 100644
3+
--- a/include/ur_client_library/comm/bin_parser.h
4+
+++ b/include/ur_client_library/comm/bin_parser.h
5+
@@ -21,7 +21,31 @@
6+
#pragma once
7+
8+
#include <assert.h>
9+
+#ifdef __APPLE__
10+
+
11+
+#include <machine/endian.h>
12+
+#include <libkern/OSByteOrder.h>
13+
+
14+
+#define htobe16(x) OSSwapHostToBigInt16(x)
15+
+#define htole16(x) OSSwapHostToLittleInt16(x)
16+
+#define be16toh(x) OSSwapBigToHostInt16(x)
17+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
18+
+
19+
+#define htobe32(x) OSSwapHostToBigInt32(x)
20+
+#define htole32(x) OSSwapHostToLittleInt32(x)
21+
+#define be32toh(x) OSSwapBigToHostInt32(x)
22+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
23+
+
24+
+#define htobe64(x) OSSwapHostToBigInt64(x)
25+
+#define htole64(x) OSSwapHostToLittleInt64(x)
26+
+#define be64toh(x) OSSwapBigToHostInt64(x)
27+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
28+
+
29+
+#else
30+
+
31+
#include <endian.h>
32+
+
33+
+#endif /* __APPLE__ */
34+
#include <inttypes.h>
35+
#include <array>
36+
#include <bitset>
37+
diff --git a/include/ur_client_library/comm/package_serializer.h b/include/ur_client_library/comm/package_serializer.h
38+
index 7745da9..78859d9 100644
39+
--- a/include/ur_client_library/comm/package_serializer.h
40+
+++ b/include/ur_client_library/comm/package_serializer.h
41+
@@ -29,7 +29,31 @@
42+
#ifndef UR_CLIENT_LIBRARY_PACKAGE_SERIALIZER_H_INCLUDED
43+
#define UR_CLIENT_LIBRARY_PACKAGE_SERIALIZER_H_INCLUDED
44+
45+
+#ifdef __APPLE__
46+
+
47+
+#include <machine/endian.h>
48+
+#include <libkern/OSByteOrder.h>
49+
+
50+
+#define htobe16(x) OSSwapHostToBigInt16(x)
51+
+#define htole16(x) OSSwapHostToLittleInt16(x)
52+
+#define be16toh(x) OSSwapBigToHostInt16(x)
53+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
54+
+
55+
+#define htobe32(x) OSSwapHostToBigInt32(x)
56+
+#define htole32(x) OSSwapHostToLittleInt32(x)
57+
+#define be32toh(x) OSSwapBigToHostInt32(x)
58+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
59+
+
60+
+#define htobe64(x) OSSwapHostToBigInt64(x)
61+
+#define htole64(x) OSSwapHostToLittleInt64(x)
62+
+#define be64toh(x) OSSwapBigToHostInt64(x)
63+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
64+
+
65+
+#else
66+
+
67+
#include <endian.h>
68+
+
69+
+#endif /* __APPLE__ */
70+
#include <cstring>
71+
72+
namespace urcl
73+
diff --git a/include/ur_client_library/control/reverse_interface.h b/include/ur_client_library/control/reverse_interface.h
74+
index 9919dbd..077403e 100644
75+
--- a/include/ur_client_library/control/reverse_interface.h
76+
+++ b/include/ur_client_library/control/reverse_interface.h
77+
@@ -35,7 +35,31 @@
78+
#include "ur_client_library/log.h"
79+
#include "ur_client_library/ur/robot_receive_timeout.h"
80+
#include <cstring>
81+
+#ifdef __APPLE__
82+
+
83+
+#include <machine/endian.h>
84+
+#include <libkern/OSByteOrder.h>
85+
+
86+
+#define htobe16(x) OSSwapHostToBigInt16(x)
87+
+#define htole16(x) OSSwapHostToLittleInt16(x)
88+
+#define be16toh(x) OSSwapBigToHostInt16(x)
89+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
90+
+
91+
+#define htobe32(x) OSSwapHostToBigInt32(x)
92+
+#define htole32(x) OSSwapHostToLittleInt32(x)
93+
+#define be32toh(x) OSSwapBigToHostInt32(x)
94+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
95+
+
96+
+#define htobe64(x) OSSwapHostToBigInt64(x)
97+
+#define htole64(x) OSSwapHostToLittleInt64(x)
98+
+#define be64toh(x) OSSwapBigToHostInt64(x)
99+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
100+
+
101+
+#else
102+
+
103+
#include <endian.h>
104+
+
105+
+#endif /* __APPLE__ */
106+
#include <condition_variable>
107+
108+
namespace urcl
109+
diff --git a/include/ur_client_library/primary/package_header.h b/include/ur_client_library/primary/package_header.h
110+
index cd64bda..b4738dd 100644
111+
--- a/include/ur_client_library/primary/package_header.h
112+
+++ b/include/ur_client_library/primary/package_header.h
113+
@@ -32,7 +32,31 @@
114+
115+
#include <inttypes.h>
116+
#include <cstddef>
117+
+#ifdef __APPLE__
118+
+
119+
+#include <machine/endian.h>
120+
+#include <libkern/OSByteOrder.h>
121+
+
122+
+#define htobe16(x) OSSwapHostToBigInt16(x)
123+
+#define htole16(x) OSSwapHostToLittleInt16(x)
124+
+#define be16toh(x) OSSwapBigToHostInt16(x)
125+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
126+
+
127+
+#define htobe32(x) OSSwapHostToBigInt32(x)
128+
+#define htole32(x) OSSwapHostToLittleInt32(x)
129+
+#define be32toh(x) OSSwapBigToHostInt32(x)
130+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
131+
+
132+
+#define htobe64(x) OSSwapHostToBigInt64(x)
133+
+#define htole64(x) OSSwapHostToLittleInt64(x)
134+
+#define be64toh(x) OSSwapBigToHostInt64(x)
135+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
136+
+
137+
+#else
138+
+
139+
#include <endian.h>
140+
+
141+
+#endif /* __APPLE__ */
142+
#include "ur_client_library/types.h"
143+
144+
namespace urcl
145+
diff --git a/include/ur_client_library/rtde/package_header.h b/include/ur_client_library/rtde/package_header.h
146+
index f910a08..4013e26 100644
147+
--- a/include/ur_client_library/rtde/package_header.h
148+
+++ b/include/ur_client_library/rtde/package_header.h
149+
@@ -31,7 +31,31 @@
150+
#define UR_CLIENT_LIBRARY_RTDE__HEADER_H_INCLUDED
151+
152+
#include <cstddef>
153+
+#ifdef __APPLE__
154+
+
155+
+#include <machine/endian.h>
156+
+#include <libkern/OSByteOrder.h>
157+
+
158+
+#define htobe16(x) OSSwapHostToBigInt16(x)
159+
+#define htole16(x) OSSwapHostToLittleInt16(x)
160+
+#define be16toh(x) OSSwapBigToHostInt16(x)
161+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
162+
+
163+
+#define htobe32(x) OSSwapHostToBigInt32(x)
164+
+#define htole32(x) OSSwapHostToLittleInt32(x)
165+
+#define be32toh(x) OSSwapBigToHostInt32(x)
166+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
167+
+
168+
+#define htobe64(x) OSSwapHostToBigInt64(x)
169+
+#define htole64(x) OSSwapHostToLittleInt64(x)
170+
+#define be64toh(x) OSSwapBigToHostInt64(x)
171+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
172+
+
173+
+#else
174+
+
175+
#include <endian.h>
176+
+
177+
+#endif /* __APPLE__ */
178+
#include "ur_client_library/types.h"
179+
#include "ur_client_library/comm/package_serializer.h"
180+
181+
diff --git a/src/comm/tcp_socket.cpp b/src/comm/tcp_socket.cpp
182+
index 8803664..f75f381 100644
183+
--- a/src/comm/tcp_socket.cpp
184+
+++ b/src/comm/tcp_socket.cpp
185+
@@ -21,7 +21,31 @@
186+
*/
187+
188+
#include <arpa/inet.h>
189+
+#ifdef __APPLE__
190+
+
191+
+#include <machine/endian.h>
192+
+#include <libkern/OSByteOrder.h>
193+
+
194+
+#define htobe16(x) OSSwapHostToBigInt16(x)
195+
+#define htole16(x) OSSwapHostToLittleInt16(x)
196+
+#define be16toh(x) OSSwapBigToHostInt16(x)
197+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
198+
+
199+
+#define htobe32(x) OSSwapHostToBigInt32(x)
200+
+#define htole32(x) OSSwapHostToLittleInt32(x)
201+
+#define be32toh(x) OSSwapBigToHostInt32(x)
202+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
203+
+
204+
+#define htobe64(x) OSSwapHostToBigInt64(x)
205+
+#define htole64(x) OSSwapHostToLittleInt64(x)
206+
+#define be64toh(x) OSSwapBigToHostInt64(x)
207+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
208+
+
209+
+#else
210+
+
211+
#include <endian.h>
212+
+
213+
+#endif /* __APPLE__ */
214+
#include <netinet/tcp.h>
215+
#include <unistd.h>
216+
#include <chrono>
217+
@@ -48,7 +72,9 @@ void TCPSocket::setupOptions()
218+
{
219+
int flag = 1;
220+
setsockopt(socket_fd_, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int));
221+
+#ifndef __APPLE__
222+
setsockopt(socket_fd_, IPPROTO_TCP, TCP_QUICKACK, &flag, sizeof(int));
223+
+#endif
224+
225+
if (recv_timeout_ != nullptr)
226+
{

vinca_linux_64.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ packages_select_by_deps:
189189

190190
- open3d_conversions
191191

192+
- ffmpeg_image_transport
193+
194+
- foxglove_compressed_image_transport
195+
192196
- point_cloud_transport_plugins
193197

194198
# ----- end of package support -----

vinca_linux_aarch64.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ packages_select_by_deps:
118118

119119
- open3d_conversions
120120

121+
- ffmpeg_image_transport
122+
123+
- foxglove_compressed_image_transport
124+
121125
- point_cloud_transport_plugins
122126

123127
# Used to work, now needs fixes

vinca_osx.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ packages_remove_from_deps:
3838
- rttest
3939
# Not available for macOS and Windows!
4040
- gripper_controllers
41-
# Some packages in ur stack do not support macOS
42-
- ur_client_library
43-
- ur_robot_driver
44-
- ur_calibration
45-
- ur
4641

4742
skip_existing:
4843
# - https://conda.anaconda.org/robostack-humble/
@@ -140,5 +135,9 @@ packages_select_by_deps:
140135

141136
- open3d_conversions
142137

138+
- ffmpeg_image_transport
139+
140+
- foxglove_compressed_image_transport
141+
143142
patch_dir: patch
144143
rosdistro_snapshot: rosdistro_snapshot.yaml

vinca_osx_arm64.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ packages_remove_from_deps:
3838
- rttest
3939
# Not available for macOS and Windows!
4040
- gripper_controllers
41-
# Some packages in ur stack do not support macOS
42-
- ur_client_library
43-
- ur_robot_driver
44-
- ur_calibration
45-
- ur
4641

4742
skip_existing:
4843
- https://conda.anaconda.org/robostack-staging/
@@ -130,5 +125,9 @@ packages_select_by_deps:
130125

131126
- open3d_conversions
132127

128+
- ffmpeg_image_transport
129+
130+
- foxglove_compressed_image_transport
131+
133132
patch_dir: patch
134133
rosdistro_snapshot: rosdistro_snapshot.yaml

0 commit comments

Comments
 (0)