-
Notifications
You must be signed in to change notification settings - Fork 164
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
[cob_light] added new modes #411
base: noetic-devel
Are you sure you want to change the base?
Conversation
* added mode for a turnsignal to the left * added mode for a turnsingal to the right * optimized datatypes in different places
thanks for the contribution @benmaidel @LoyVanBeek |
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.
Thanks for the contribution!
The PR adds a few handy modes but also a lot of reformatting and whitespace changes. The latter is not desirable, as this brings it out of line with other code in this overall project.
So bits have also been removed and commented out without a clear reason (that I can see). The whole PR is one commit which makes it hard to go through the reasoning in the code.
Splitting the PR is multiple commits that each have their own piece of work (add mode X, optimize datastructures, handle whitespace etc) would make things easier to review.
|
||
std::string getName() | ||
{ | ||
return std::string("SignalRIght"); |
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.
Small typo.
{ | ||
cols.push_back(_color); | ||
} | ||
for (uint16_t i = (_num_leds / 2) - leds_margin; i < _num_leds; ++i) |
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 think this is the only difference between the left and right modes, correct?
Is there really no way to have these both derive from a common class (eg. DirectionIndicatorMode
or something better) and have a direction
variable set to either left/right that makes the quintessential difference between these modes?
ros::init(argc, argv, "cob_light"); | ||
// signal(SIGINT, sigIntHandler); | ||
|
||
// Override XMLRPC shutdown | ||
ros::XMLRPCManager::instance()->unbind("shutdown"); | ||
ros::XMLRPCManager::instance()->bind("shutdown", shutdownCallback); | ||
// ros::XMLRPCManager::instance()->unbind("shutdown"); | ||
// ros::XMLRPCManager::instance()->bind("shutdown", shutdownCallback); | ||
|
||
// create LightControl instance |
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.
Why has this been removed?
// color_tmp.r *= color.a; | ||
// color_tmp.g *= color.a; | ||
// color_tmp.b *= color.a; | ||
|
||
color_tmp.r = fabs(color_tmp.r * 255); | ||
color_tmp.g = fabs(color_tmp.g * 255); | ||
color_tmp.b = fabs(color_tmp.b * 255); | ||
// color_tmp.r = fabs(color_tmp.r * 255); | ||
// color_tmp.g = fabs(color_tmp.g * 255); | ||
// color_tmp.b = fabs(color_tmp.b * 255); |
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.
Why has this been removed?
@@ -93,6 +97,7 @@ void StageProfi::setColor(color::rgba color) | |||
|
|||
void StageProfi::setColorMulti(std::vector<color::rgba> &colors) | |||
{ | |||
ROS_WARN(__PRETTY_FUNCTION__); |
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.
Should be ROS_DEBUG at best I guess, if still needed at all
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.
marking as "Changes Requested"
see https://github.com/ipa320/cob_driver/pull/411#pullrequestreview-364693335
For the turnsignal to use simple state the color in witch the turn signal should be blinking and the frequency.