-
Notifications
You must be signed in to change notification settings - Fork 11
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
Manuall merge of ros2-prealpha to ros2-dev #218
Conversation
import textwrap | ||
|
||
import click |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it pre-commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
panther_gpiod/src/gpio_driver.cpp
Outdated
gpiod::line::value new_output_value; | ||
if (!line_request_) { | ||
new_output_value = gpio_info.init_value; | ||
} else { | ||
new_output_value = gpio_info.value; | ||
} | ||
settings.set_output_value(new_output_value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gpiod::line::value new_output_value; | |
if (!line_request_) { | |
new_output_value = gpio_info.init_value; | |
} else { | |
new_output_value = gpio_info.value; | |
} | |
settings.set_output_value(new_output_value); | |
gpiod::line::value new_output_value = line_request_ ? gpio_info.value : gpio_info.init_value; | |
settings.set_output_value(new_output_value); |
just a suggestion
panther_gpiod/src/gpio_driver.cpp
Outdated
bool GPIODriver::IsPinAvaible(const GPIOPin pin) const | ||
{ | ||
for (auto & info : gpio_info_storage_) { | ||
if (info.pin == pin) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool GPIODriver::IsPinAvaible(const GPIOPin pin) const | |
{ | |
for (auto & info : gpio_info_storage_) { | |
if (info.pin == pin) { | |
return true; | |
} | |
} | |
return false; | |
} | |
bool GPIODriver::IsPinAvaible(const GPIOPin pin) const | |
{ | |
return std::any_of(gpio_info_storage_.begin(), gpio_info_storage_.end(), | |
[&](const auto &info) { return info.pin == pin; }); | |
} | |
It is considered more idiomatic in modern C++. Just another suggestion :p
With such changes, we still need to include .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry @KmakD. There is a typo in my comment caused by parsing <>
. With such changes, we still need to include <algorithm>
.
Manual merge of prealpha branch. Changes regarding
ros2_control
andpanther_hardware_interfaces
were omitted.