Skip to content

Commit

Permalink
fix windows casting
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <[email protected]>
  • Loading branch information
delihus committed Jul 4, 2023
1 parent da2f08a commit 70cd923
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/uxr/agent/middleware/fastdds/FastDDSMiddleware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ class FastDDSMiddleware : public Middleware
std::shared_ptr<FastDDSParticipant>& participant,
const fastrtps::ReplierAttributes& attrs);

uint8_t get_domain_id_from_env();
int16_t get_domain_id_from_env();

uint8_t agent_domain_id_ = 0;
int16_t agent_domain_id_ = 0;
std::unordered_map<uint16_t, std::shared_ptr<FastDDSParticipant>> participants_;
std::unordered_map<uint16_t, std::shared_ptr<FastDDSTopic>> topics_;
std::unordered_map<uint16_t, std::shared_ptr<FastDDSPublisher>> publishers_;
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/middleware/fastdds/FastDDSMiddleware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ bool FastDDSMiddleware::create_participant_by_bin(
uint16_t participant_id,
const dds::xrce::OBJK_DomainParticipant_Binary& participant_xrce)
{
auto participant_domain_id = static_cast<int16_t>(participant_xrce.domain_id());
auto participant_domain_id = participant_xrce.domain_id();
if(participant_domain_id == UXR_CLIENT_DOMAIN_ID_TO_OVERRIDE_WITH_ENV){
participant_domain_id = static_cast<int16_t>(agent_domain_id_);
participant_domain_id = agent_domain_id_;
UXR_AGENT_LOG_WARN(
UXR_DECORATE_YELLOW("Overriding Micro XRCE-DDS Client DOMAIN_ID"),
"domain_id: {}", participant_domain_id);
Expand Down Expand Up @@ -1259,12 +1259,12 @@ bool FastDDSMiddleware::matched_replier_from_bin(
return rv;
}

uint8_t FastDDSMiddleware::get_domain_id_from_env(){
int16_t FastDDSMiddleware::get_domain_id_from_env(){
uint8_t agent_domain_id = 0;
const char * agent_domain_id_env = std::getenv( "ROS_DOMAIN_ID" );
if (nullptr != agent_domain_id_env)
{
agent_domain_id = std::atoi(agent_domain_id_env);
agent_domain_id = static_cast<int16_t>(std::atoi(agent_domain_id_env));
}
return agent_domain_id;
}
Expand Down

0 comments on commit 70cd923

Please sign in to comment.