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

[cob_light] added new modes #411

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

JeroenKempen
Copy link

  • added mode for a turnsignal to the left
  • added mode for a turnsingal to the right
  • optimized datatypes in different places

For the turnsignal to use simple state the color in witch the turn signal should be blinking and the frequency.

* added mode for a turnsignal to the left
* added mode for a turnsingal to the right
* optimized datatypes in different places
@JeroenKempen JeroenKempen changed the title Added new modes [cob_light] added new modes Feb 20, 2020
@fmessmer
Copy link
Contributor

thanks for the contribution
this is related to https://github.com/mojin-robotics/cob4/issues/1414

@benmaidel @LoyVanBeek
please review

Copy link
Contributor

@LoyVanBeek LoyVanBeek left a 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");
Copy link
Contributor

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)
Copy link
Contributor

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?

Comment on lines +496 to 503
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
Copy link
Contributor

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?

Comment on lines +62 to +68
// 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);
Copy link
Contributor

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__);
Copy link
Contributor

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

Copy link
Contributor

@fmessmer fmessmer left a comment

Choose a reason for hiding this comment

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

@fmessmer fmessmer changed the base branch from kinetic_dev to noetic-devel April 17, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants