Skip to content

Commit

Permalink
Release v2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored Nov 22, 2023
2 parents 40954c2 + 0c5fb0a commit 57d0862
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 30 deletions.
14 changes: 7 additions & 7 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.1 CACHE STRING "Sets Micro XRCE-DDS client version for P2P")
set(UAGENT_P2P_CLIENT_TAG v2.4.1 CACHE STRING "Sets Micro XRCE-DDS client tag for P2P")
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")

option(UAGENT_BUILD_CI_TESTS "Build CI test cases.")
if(UAGENT_BUILD_CI_TESTS)
Expand Down Expand Up @@ -80,8 +80,8 @@ set(_deps "")
if(UAGENT_USE_SYSTEM_FASTCDR)
set(_fastcdr_version 1)
else()
set(_fastcdr_version 1.1.0)
set(_fastcdr_tag v1.1.0)
set(_fastcdr_version 1.1.1)
set(_fastcdr_tag v1.1.1)
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.11)
set(_fastdds_tag 2.11.x)
set(_fastdds_version 2.12)
set(_fastdds_tag 2.12.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.1" LANGUAGES C CXX)
project(microxrcedds_agent VERSION "2.4.2" LANGUAGES C CXX)
else()
project(uagent_superbuild NONE)
include(${PROJECT_SOURCE_DIR}/cmake/SuperBuild.cmake)
Expand Down
7 changes: 7 additions & 0 deletions include/uxr/agent/message/InputMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ inline bool InputMessage::prepare_next_submessage()
if (fastbuffer_.getBufferSize() > deserializer_.getSerializedDataLength())
{
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);
}
}
return rv;
}
Expand Down
81 changes: 78 additions & 3 deletions include/uxr/agent/types/XRCETypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ const XrceVersion XRCE_VERSION = {XRCE_VERSION_MAJOR, XRCE_VERSION_MINOR};
const uint8_t XRCE_VENDOR_INVALID1 = 0x00;
const uint8_t XRCE_VENDOR_INVALID2 = 0x00;

//! @brief This enumeration represents the two posible values of the SubMessage endianness flag.
typedef enum Endianness
{
//! @brief Big endianness.
BIG_ENDIANNESS = 0x0,
//! @brief Little endianness.
LITTLE_ENDIANNESS = 0x1
} Endianness;

/*!
* @brief This class represents the structure Time_t defined by the user in the IDL file.
* @ingroup TYPESMOD
Expand Down Expand Up @@ -2364,6 +2373,24 @@ class OBJK_RepresentationBinAndXML_Base
return m_representation;
}

/*!
* @brief This function updates the value in representation endianness
* @param endianness New value of representation endianness
*/
inline void endianness(Endianness endianness)
{
m_endianness = endianness;
}

/*!
* @brief This function returns a copy to the representation endianness
* @return Representation endianness
*/
inline Endianness endianness() const
{
return m_endianness;
}

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
Expand Down Expand Up @@ -2395,6 +2422,7 @@ class OBJK_RepresentationBinAndXML_Base

private:
OBJK_RepresentationBinAndXMLFormats m_representation;
Endianness m_endianness;
};

/*!
Expand Down Expand Up @@ -2474,7 +2502,25 @@ class OBJK_Representation3_Base
{
return m_representation;
}


/*!
* @brief This function updates the value in representation endianness
* @param endianness New value of representation endianness
*/
inline void endianness(Endianness endianness)
{
m_endianness = endianness;
}

/*!
* @brief This function returns a copy to the representation endianness
* @return Representation endianness
*/
inline Endianness endianness() const
{
return m_endianness;
}

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
Expand Down Expand Up @@ -2505,6 +2551,7 @@ class OBJK_Representation3_Base

private:
OBJK_Representation3Formats m_representation;
Endianness m_endianness;
};

/*!
Expand Down Expand Up @@ -5902,7 +5949,34 @@ class ObjectVariant
* @exception dds::xrce::XRCETypesException This exception is thrown if the requested union member is not the current selection.
*/
REPLIER_Representation& replier();


/*!
* @brief This function updates the value in representation endianness
* @param endianness New value of representation endianness
*/
inline void endianness(Endianness endianness)
{
m_endianness = endianness;

m_participant.endianness(m_endianness);
m_topic.endianness(m_endianness);
m_publisher.endianness(m_endianness);
m_subscriber.endianness(m_endianness);
m_data_writer.endianness(m_endianness);
m_data_reader.endianness(m_endianness);
m_requester.endianness(m_endianness);
m_replier.endianness(m_endianness);
}

/*!
* @brief This function returns a copy to the representation endianness
* @return Representation endianness
*/
inline Endianness endianness() const
{
return m_endianness;
}

/*!
* @brief This function returns the maximum serialized size of an object
* depending on the buffer alignment.
Expand Down Expand Up @@ -5933,7 +6007,8 @@ class ObjectVariant

private:
ObjectKind m__d;

Endianness m_endianness;

AGENT_Representation m_agent;
CLIENT_Representation m_client;
OBJK_APPLICATION_Representation m_application;
Expand Down
4 changes: 2 additions & 2 deletions include/uxr/agent/utils/ArgumentParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,10 +1068,10 @@ class ArgumentParser

/* Setting baudrate. */
speed_t baudrate = getBaudRate(baudrate_str);
#if _HAVE_STRUCT_TERMIOS_C_ISPEED
#if _HAVE_STRUCT_TERMIOS_C_ISPEED || __APPLE__
attr.c_ispeed = baudrate;
#endif
#if _HAVE_STRUCT_TERMIOS_C_OSPEED
#if _HAVE_STRUCT_TERMIOS_C_OSPEED || __APPLE__
attr.c_ospeed = baudrate;
#endif

Expand Down
6 changes: 4 additions & 2 deletions src/cpp/datareader/DataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ std::unique_ptr<DataReader> DataReader::create(
dds::xrce::OBJK_DataReader_Binary datareader_xrce;

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr cdr(fastbuffer);
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
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 @@ -111,7 +112,8 @@ bool DataReader::matched(
dds::xrce::OBJK_DataReader_Binary datareader_xrce;

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

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

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr cdr(fastbuffer);
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
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 @@ -105,7 +106,8 @@ bool DataWriter::matched(const dds::xrce::ObjectVariant& new_object_rep) const
dds::xrce::OBJK_DataWriter_Binary datawriter_xrce;

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

rv = proxy_client_->get_middleware().matched_datawriter_from_bin(get_raw_id(), datawriter_xrce);
Expand Down
16 changes: 16 additions & 0 deletions src/cpp/middleware/fastdds/FastDDSMiddleware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ bool FastDDSMiddleware::create_participant_by_ref(
int16_t domain_id,
const std::string& ref)
{
if(domain_id == UXR_CLIENT_DOMAIN_ID_TO_OVERRIDE_WITH_ENV){
domain_id = agent_domain_id_;
UXR_AGENT_LOG_WARN(
UXR_DECORATE_YELLOW("Overriding Micro XRCE-DDS Client DOMAIN_ID"),
"domain_id: {}", domain_id
);
}

bool rv = false;
fastrtps::ParticipantAttributes attrs;
auto participant_domain_id = domain_id;
Expand Down Expand Up @@ -97,6 +105,14 @@ bool FastDDSMiddleware::create_participant_by_xml(
int16_t domain_id,
const std::string& xml)
{
if(domain_id == UXR_CLIENT_DOMAIN_ID_TO_OVERRIDE_WITH_ENV){
domain_id = agent_domain_id_;
UXR_AGENT_LOG_WARN(
UXR_DECORATE_YELLOW("Overriding Micro XRCE-DDS Client DOMAIN_ID"),
"domain_id: {}", domain_id
);
}

bool rv = false;
std::shared_ptr<FastDDSParticipant> participant(new FastDDSParticipant(domain_id));
if (participant->create_by_xml(xml))
Expand Down
6 changes: 4 additions & 2 deletions src/cpp/participant/Participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ std::unique_ptr<Participant> Participant::create(
participant_xrce.domain_id(representation.domain_id());

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

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

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

rv = proxy_client_->get_middleware().matched_participant_from_bin(get_raw_id(), domain_id, participant_xrce);
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/processor/Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ bool Processor<EndPoint>::process_create_submessage(
dds::xrce::CREATE_Payload create_payload;
if (input_packet.message->get_payload(create_payload))
{
dds::xrce::Endianness endianness = static_cast<dds::xrce::Endianness>(input_packet.message->get_subheader().flags() & 0x01);
create_payload.object_representation().endianness(endianness);

dds::xrce::STATUS_Payload status_payload;
status_payload.related_request().request_id(create_payload.request_id());
status_payload.related_request().object_id(create_payload.object_id());
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/publisher/Publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ std::unique_ptr<Publisher> Publisher::create(
dds::xrce::OBJK_Publisher_Binary publisher_xrce;

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

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

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr cdr(fastbuffer);
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
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 @@ -108,7 +109,8 @@ bool Replier::matched(
dds::xrce::OBJK_Replier_Binary replier_xrce;

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

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

fastcdr::FastBuffer fastbuffer{reinterpret_cast<char*>(const_cast<uint8_t*>(rep.binary_representation().data())), rep.binary_representation().size()};
eprosima::fastcdr::Cdr cdr(fastbuffer);
eprosima::fastcdr::Cdr::Endianness endianness = static_cast<eprosima::fastcdr::Cdr::Endianness>(representation.endianness());
eprosima::fastcdr::Cdr cdr(fastbuffer, endianness);
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 @@ -110,7 +111,8 @@ bool Requester::matched(
dds::xrce::OBJK_Requester_Binary request_xrce;

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

rv = proxy_client_->get_middleware().matched_requester_from_bin(get_raw_id(), request_xrce);
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/subscriber/Subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ std::unique_ptr<Subscriber> Subscriber::create(
dds::xrce::OBJK_Subscriber_Binary subscriber_xrce;

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

created_entity = proxy_client->get_middleware().create_subscriber_by_bin(raw_object_id, participant_id, subscriber_xrce);
Expand Down
6 changes: 4 additions & 2 deletions src/cpp/topic/Topic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ std::unique_ptr<Topic> Topic::create(
dds::xrce::OBJK_Topic_Binary topic_xrce;

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

created_entity = proxy_client->get_middleware().create_topic_by_bin(raw_object_id, participant_id, topic_xrce);
Expand Down Expand Up @@ -103,7 +104,8 @@ bool Topic::matched(const dds::xrce::ObjectVariant& new_object_rep) const
dds::xrce::OBJK_Topic_Binary topic_xrce;

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

rv = proxy_client_->get_middleware().matched_topic_from_bin(get_raw_id(), topic_xrce);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/transport/serial/MultiTermiosAgentLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ void MultiTermiosAgent::init_multiport()
new_attrs.c_cc[VMIN] = termios_attrs_.c_cc[VMIN];
new_attrs.c_cc[VTIME] = termios_attrs_.c_cc[VTIME];

#if _HAVE_STRUCT_TERMIOS_C_ISPEED
#if _HAVE_STRUCT_TERMIOS_C_ISPEED || __APPLE__
cfsetispeed(&new_attrs, termios_attrs_.c_ispeed);
#endif
#if _HAVE_STRUCT_TERMIOS_C_OSPEED
#if _HAVE_STRUCT_TERMIOS_C_OSPEED || __APPLE__
cfsetospeed(&new_attrs, termios_attrs_.c_ospeed);
#endif

Expand Down
Loading

0 comments on commit 57d0862

Please sign in to comment.