Skip to content

Commit

Permalink
Release v2.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Mar 20, 2024
2 parents 57d0862 + e212d42 commit 7362281
Show file tree
Hide file tree
Showing 15 changed files with 605 additions and 525 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ option(UAGENT_SECURITY_PROFILE "Build security profile." OFF)
option(UAGENT_BUILD_EXECUTABLE "Build Micro XRCE-DDS Agent provided executable." ON)
option(UAGENT_BUILD_USAGE_EXAMPLES "Build Micro XRCE-DDS Agent built-in usage examples" OFF)

set(UAGENT_P2P_CLIENT_VERSION 2.4.2 CACHE STRING "Sets Micro XRCE-DDS client version for P2P")
set(UAGENT_P2P_CLIENT_TAG v2.4.2 CACHE STRING "Sets Micro XRCE-DDS client tag for P2P")
set(UAGENT_P2P_CLIENT_VERSION 2.4.3 CACHE STRING "Sets Micro XRCE-DDS client version for P2P")
set(UAGENT_P2P_CLIENT_TAG v2.4.3 CACHE STRING "Sets Micro XRCE-DDS client tag for P2P")

option(UAGENT_BUILD_CI_TESTS "Build CI test cases.")
if(UAGENT_BUILD_CI_TESTS)
Expand Down Expand Up @@ -78,10 +78,10 @@ option(UAGENT_TWEAK_XRCE_WRITE_LIMIT "This feature uses a tweak to allow XRCE WR
set(_deps "")

if(UAGENT_USE_SYSTEM_FASTCDR)
set(_fastcdr_version 1)
set(_fastcdr_version 2)
else()
set(_fastcdr_version 1.1.1)
set(_fastcdr_tag v1.1.1)
set(_fastcdr_version 2.2.0)
set(_fastcdr_tag 2.2.x)
endif()
list(APPEND _deps "fastcdr\;${_fastcdr_version}")

Expand All @@ -95,8 +95,8 @@ if(UAGENT_FAST_PROFILE)
if(UAGENT_USE_SYSTEM_FASTDDS)
set(_fastdds_version 2)
else()
set(_fastdds_version 2.12)
set(_fastdds_tag 2.12.x)
set(_fastdds_version 2.14)
set(_fastdds_tag 2.14.x)
set(_foonathan_memory_tag v0.7-3) # This tag should be updated every time it gets updated in foonathan_memory_vendor eProsima's package
endif()
list(APPEND _deps "fastrtps\;${_fastdds_version}")
Expand All @@ -117,7 +117,7 @@ endif()
###############################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
if(NOT UAGENT_SUPERBUILD)
project(microxrcedds_agent VERSION "2.4.2" LANGUAGES C CXX)
project(microxrcedds_agent VERSION "2.4.3" LANGUAGES C CXX)
else()
project(uagent_superbuild NONE)
include(${PROJECT_SOURCE_DIR}/cmake/SuperBuild.cmake)
Expand Down
2 changes: 1 addition & 1 deletion include/uxr/agent/client/session/stream/OutputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ inline bool ReliableOutputStream::push_submessage(
/* Serialize submessage. */
std::unique_ptr<uint8_t[]> buf(new uint8_t[submessage_size]);
fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(buf.get()), submessage_size);
fastcdr::Cdr serializer(fastbuffer);
fastcdr::Cdr serializer(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);
submessage_header.serialize(serializer);
submessage.serialize(serializer);

Expand Down
22 changes: 11 additions & 11 deletions include/uxr/agent/message/InputMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class InputMessage
header_(),
subheader_(),
fastbuffer_(reinterpret_cast<char*>(buf_), len_),
deserializer_(fastbuffer_)
deserializer_(fastbuffer_, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1)
{
memcpy(buf_, buf, len);

Expand Down Expand Up @@ -96,24 +96,24 @@ class InputMessage
inline bool InputMessage::prepare_next_submessage()
{
bool rv = false;
deserializer_.jump((4 - ((deserializer_.getCurrentPosition() - deserializer_.getBufferPointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > deserializer_.getSerializedDataLength())
deserializer_.jump((4 - ((deserializer_.get_current_position() - deserializer_.get_buffer_pointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > deserializer_.get_serialized_data_length())
{
rv = deserialize(subheader_);

// Check submessage endianness
fastcdr::Cdr::Endianness endianness = static_cast<fastcdr::Cdr::Endianness>(subheader_.flags() & 0x01);
if (endianness != deserializer_.endianness())
{
deserializer_.changeEndianness(endianness);
deserializer_.change_endianness(endianness);
}
}
return rv;
}

inline size_t InputMessage::count_submessages()
{
fastcdr::Cdr local_deserializer(fastbuffer_);
fastcdr::Cdr local_deserializer(fastbuffer_, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);
dds::xrce::MessageHeader local_header;
dds::xrce::SubmessageHeader local_subheader;

Expand All @@ -124,8 +124,8 @@ inline size_t InputMessage::count_submessages()

do
{
local_deserializer.jump((4 - ((local_deserializer.getCurrentPosition() - local_deserializer.getBufferPointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > local_deserializer.getSerializedDataLength())
local_deserializer.jump((4 - ((local_deserializer.get_current_position() - local_deserializer.get_buffer_pointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > local_deserializer.get_serialized_data_length())
{
try
{
Expand All @@ -146,14 +146,14 @@ inline size_t InputMessage::count_submessages()

inline dds::xrce::SubmessageId InputMessage::get_submessage_id()
{
fastcdr::Cdr local_deserializer(fastbuffer_);
fastcdr::Cdr local_deserializer(fastbuffer_, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);
dds::xrce::MessageHeader local_header;
dds::xrce::SubmessageHeader local_subheader;

local_header.deserialize(local_deserializer);

local_deserializer.jump((4 - ((local_deserializer.getCurrentPosition() - local_deserializer.getBufferPointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > local_deserializer.getSerializedDataLength())
local_deserializer.jump((4 - ((local_deserializer.get_current_position() - local_deserializer.get_buffer_pointer()) & 3)) & 3);
if (fastbuffer_.getBufferSize() > local_deserializer.get_serialized_data_length())
{
local_subheader.deserialize(local_deserializer);
}
Expand Down Expand Up @@ -191,7 +191,7 @@ inline bool InputMessage::get_raw_payload(uint8_t* buf, size_t len)
rv = true;
try
{
deserializer_.deserializeArray(buf, subheader_.submessage_length(), fastcdr::Cdr::BIG_ENDIANNESS);
deserializer_.deserialize_array(buf, subheader_.submessage_length(), fastcdr::Cdr::BIG_ENDIANNESS);
}
catch(eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/)
{
Expand Down
12 changes: 6 additions & 6 deletions include/uxr/agent/message/OutputMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OutputMessage
: buf_(new uint8_t[len]{0}),
len_(len),
fastbuffer_(reinterpret_cast<char*>(buf_), len_),
serializer_(fastbuffer_)
serializer_(fastbuffer_, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1)
{
serialize(header);
}
Expand All @@ -51,7 +51,7 @@ class OutputMessage

uint8_t* get_buf() const { return buf_; }

size_t get_len() const { return serializer_.getSerializedDataLength(); }
size_t get_len() const { return serializer_.get_serialized_data_length(); }

template<class T>
bool append_submessage(
Expand Down Expand Up @@ -113,7 +113,7 @@ inline bool OutputMessage::append_raw_payload(
{
try
{
serializer_.serializeArray(buf, len, fastcdr::Cdr::BIG_ENDIANNESS);
serializer_.serialize_array(buf, len, fastcdr::Cdr::BIG_ENDIANNESS);
}
catch(eprosima::fastcdr::exception::NotEnoughMemoryException & /*exception*/)
{
Expand All @@ -134,13 +134,13 @@ inline bool OutputMessage::append_fragment(
size_t len)
{
bool rv = false;
serializer_.jump((4 - ((serializer_.getCurrentPosition() - serializer_.getBufferPointer()) & 3)) & 3);
serializer_.jump((4 - ((serializer_.get_current_position() - serializer_.get_buffer_pointer()) & 3)) & 3);
if (serialize(subheader))
{
try
{
rv = true;
serializer_.serializeArray(buf, len);
serializer_.serialize_array(buf, len);
}
catch(eprosima::fastcdr::exception::NotEnoughMemoryException & /*exception*/)
{
Expand All @@ -161,7 +161,7 @@ inline bool OutputMessage::append_subheader(
subheader.flags(flags);
subheader.submessage_length(uint16_t(submessage_len));

serializer_.jump((4 - ((serializer_.getCurrentPosition() - serializer_.getBufferPointer()) & 3)) & 3);
serializer_.jump((4 - ((serializer_.get_current_position() - serializer_.get_buffer_pointer()) & 3)) & 3);
return serialize(subheader);
}

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/datareader/DataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::unique_ptr<DataReader> DataReader::create(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
datareader_xrce.deserialize(cdr);

created_entity = proxy_client->get_middleware().create_datareader_by_bin(raw_object_id, subscriber_id, datareader_xrce);
Expand Down Expand Up @@ -113,7 +113,7 @@ bool DataReader::matched(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(new_object_rep.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
datareader_xrce.deserialize(cdr);

rv = proxy_client_->get_middleware().matched_datareader_from_bin(get_raw_id(), datareader_xrce);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/datawriter/DataWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::unique_ptr<DataWriter> DataWriter::create(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
datawriter_xrce.deserialize(cdr);

created_entity = proxy_client->get_middleware().create_datawriter_by_bin(raw_object_id, publisher_id, datawriter_xrce);
Expand Down Expand Up @@ -107,7 +107,7 @@ bool DataWriter::matched(const dds::xrce::ObjectVariant& new_object_rep) const

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(new_object_rep.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
datawriter_xrce.deserialize(cdr);

rv = proxy_client_->get_middleware().matched_datawriter_from_bin(get_raw_id(), datawriter_xrce);
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/middleware/fast/FastEntities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,16 @@ bool FastReplier::write(
const std::vector<uint8_t>& data)
{
fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(data.data())), data.size()};
fastcdr::Cdr deserializer(fastbuffer);
fastcdr::Cdr deserializer(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);

dds::SampleIdentity sample_identity;
sample_identity.deserialize(deserializer);

fastrtps::rtps::WriteParams wparams;
transport_sample_identity(sample_identity, wparams.related_sample_identity());

std::vector<uint8_t> output_data(data.size() - deserializer.getSerializedDataLength());
deserializer.deserializeArray(output_data.data(), output_data.size());
std::vector<uint8_t> output_data(data.size() - deserializer.get_serialized_data_length());
deserializer.deserialize_array(output_data.data(), output_data.size());

return datawriter_->write(output_data, wparams);
}
Expand All @@ -538,12 +538,12 @@ bool FastReplier::read(
data.resize(sample_identity.getCdrSerializedSize() + temp_data.size());

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(data.data()), data.size()};
fastcdr::Cdr serializer(fastbuffer);
fastcdr::Cdr serializer(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);

try
{
sample_identity.serialize(serializer);
serializer.serializeArray(temp_data.data(), temp_data.size());
serializer.serialize_array(temp_data.data(), temp_data.size());
}
catch(const std::exception&)
{
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/middleware/fastdds/FastDDSEntities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1430,16 +1430,16 @@ bool FastDDSReplier::write(
const std::vector<uint8_t>& data)
{
fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(data.data())), data.size()};
fastcdr::Cdr deserializer(fastbuffer);
fastcdr::Cdr deserializer(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);

dds::SampleIdentity sample_identity;
sample_identity.deserialize(deserializer);

fastrtps::rtps::WriteParams wparams;
transport_sample_identity(sample_identity, wparams.related_sample_identity());

std::vector<uint8_t> output_data(data.size() - deserializer.getSerializedDataLength());
deserializer.deserializeArray(output_data.data(), output_data.size());
std::vector<uint8_t> output_data(data.size() - deserializer.get_serialized_data_length());
deserializer.deserialize_array(output_data.data(), output_data.size());

return datawriter_ptr_->write(&const_cast<std::vector<uint8_t>&>(output_data), wparams);
}
Expand Down Expand Up @@ -1486,12 +1486,12 @@ bool FastDDSReplier::read(
data.resize(sample_identity.getCdrSerializedSize() + temp_data.size());

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(data.data()), data.size()};
fastcdr::Cdr serializer(fastbuffer);
fastcdr::Cdr serializer(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);

try
{
sample_identity.serialize(serializer);
serializer.serializeArray(temp_data.data(), temp_data.size());
serializer.serialize_array(temp_data.data(), temp_data.size());
}
catch(const std::exception&)
{
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/participant/Participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ std::unique_ptr<Participant> Participant::create(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
participant_xrce.deserialize(cdr);

created_entity = proxy_client->get_middleware().create_participant_by_bin(raw_object_id, participant_xrce);
Expand Down Expand Up @@ -108,7 +108,7 @@ bool Participant::matched(const dds::xrce::ObjectVariant& new_object_rep) const

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(new_object_rep.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
participant_xrce.deserialize(cdr);

rv = proxy_client_->get_middleware().matched_participant_from_bin(get_raw_id(), domain_id, participant_xrce);
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/publisher/Publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ std::unique_ptr<Publisher> Publisher::create(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
publisher_xrce.deserialize(cdr);

created_entity = proxy_client->get_middleware().create_publisher_by_bin(raw_object_id, participant_id, publisher_xrce);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/replier/Replier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::unique_ptr<Replier> Replier::create(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
replier_xrce.deserialize(cdr);

created_entity = proxy_client->get_middleware().create_replier_by_bin(raw_object_id, participant_id, replier_xrce);
Expand Down Expand Up @@ -110,7 +110,7 @@ bool Replier::matched(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(new_object_rep.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
replier_xrce.deserialize(cdr);

rv = proxy_client_->get_middleware().matched_replier_from_bin(get_raw_id(), replier_xrce);
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/requester/Requester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::unique_ptr<Requester> Requester::create(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
request_xrce.deserialize(cdr);

created_entity = proxy_client->get_middleware().create_requester_by_bin(raw_object_id, participant_id, request_xrce);
Expand Down Expand Up @@ -112,7 +112,7 @@ bool Requester::matched(

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(new_object_rep.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness, eprosima::fastcdr::CdrVersion::XCDRv1);
request_xrce.deserialize(cdr);

rv = proxy_client_->get_middleware().matched_requester_from_bin(get_raw_id(), request_xrce);
Expand Down Expand Up @@ -205,10 +205,10 @@ bool Requester::read_fn(

data.resize(request.getMaxCdrSerializedSize() + temp_data.size());
fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(data.data()), data.size()};
fastcdr::Cdr serializer(fastbuffer);
fastcdr::Cdr serializer(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::CdrVersion::XCDRv1);

request.serialize(serializer);
serializer.serializeArray(temp_data.data(), temp_data.size());
serializer.serialize_array(temp_data.data(), temp_data.size());

UXR_AGENT_LOG_MESSAGE(
UXR_DECORATE_YELLOW("[==>> DDS <<==]"),
Expand Down
Loading

0 comments on commit 7362281

Please sign in to comment.