Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rec_core] Record ecalhdf5 v6, respecting topic-id. #1884

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KerstinKeller
Copy link
Contributor

We want to record both Publisher and its unque ID within the measurement.
This PR aims to do that.
We do not need to do any kind of quality computation any longer.
Later on, we might be able to play back only topics published by a given publisher.

Currently, it builds, however, nothing is recorded. Need to review why it breaks the recording.

@KerstinKeller KerstinKeller added the cherry-pick-to-NONE Don't cherry-pick these changes label Jan 10, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -695,12 +695,12 @@ namespace eCAL
return subscribed_topics;
}

void EcalRecImpl::EcalMessageReceived(const eCAL::Registration::STopicId& topic_id_, const eCAL::SReceiveCallbackData& data_)
void EcalRecImpl::EcalMessageReceived(const Registration::STopicId& topic_id_, const SDataTypeInformation& datatype_info_, const SReceiveCallbackData& callback_data_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'datatype_info_' is unused [misc-unused-parameters]

Suggested change
void EcalRecImpl::EcalMessageReceived(const Registration::STopicId& topic_id_, const SDataTypeInformation& datatype_info_, const SReceiveCallbackData& callback_data_)
void EcalRecImpl::EcalMessageReceived(const Registration::STopicId& topic_id_, const SDataTypeInformation& /*datatype_info_*/, const SReceiveCallbackData& callback_data_)

{
auto ecal_receive_time = eCAL::Time::ecal_clock::now();
auto system_receive_time = std::chrono::steady_clock::now();

std::shared_ptr<Frame> frame = std::make_shared<Frame>(&data_, topic_id_.topic_name, ecal_receive_time, system_receive_time);
std::shared_ptr<Frame> frame = std::make_shared<Frame>(callback_data_, topic_id_, ecal_receive_time, system_receive_time);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'frame' of type 'std::shared_ptr' can be declared 'const' [misc-const-correctness]

Suggested change
std::shared_ptr<Frame> frame = std::make_shared<Frame>(callback_data_, topic_id_, ecal_receive_time, system_receive_time);
std::shared_ptr<Frame> const frame = std::make_shared<Frame>(callback_data_, topic_id_, ecal_receive_time, system_receive_time);

data_.reserve(callback_data->size);
data_.assign((char*)callback_data->buf, (char*)callback_data->buf + callback_data->size);
data_.reserve(callback_data.size);
data_.assign((char*)callback_data.buf, (char*)callback_data.buf + callback_data.size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]

        data_.assign((char*)callback_data.buf, (char*)callback_data.buf + callback_data.size);
                                               ^

data_.reserve(callback_data->size);
data_.assign((char*)callback_data->buf, (char*)callback_data->buf + callback_data->size);
data_.reserve(callback_data.size);
data_.assign((char*)callback_data.buf, (char*)callback_data.buf + callback_data.size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]

        data_.assign((char*)callback_data.buf, (char*)callback_data.buf + callback_data.size);
                     ^

@@ -168,8 +168,10 @@ namespace eCAL

for (const auto& topic : topic_info_map_to_set)
{
// convert from eCAL core types to eCAL measurement types before writing to the measurement.
eh5::SChannel channel{ topic.first.topic_name, topic.first.topic_id.entity_id };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'channel' of type 'eh5::SChannel' (aka 'eCAL::experimental::measurement::base::Channel') can be declared 'const' [misc-const-correctness]

Suggested change
eh5::SChannel channel{ topic.first.topic_name, topic.first.topic_id.entity_id };
eh5::SChannel const channel{ topic.first.topic_name, topic.first.topic_id.entity_id };

}

std::lock_guard<decltype(monitoring_mutex_)> monitoring_lock(monitoring_mutex_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'monitoring_lock' of type 'std::lock_guard<decltype(this->monitoring_mutex_)>' (aka 'lock_guardstd::mutex') can be declared 'const' [misc-const-correctness]

Suggested change
std::lock_guard<decltype(monitoring_mutex_)> monitoring_lock(monitoring_mutex_);
std::lock_guard<decltype(monitoring_mutex_)> const monitoring_lock(monitoring_mutex_);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-to-NONE Don't cherry-pick these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant