Feature: LED Colour Controller Package#7
Open
Vicente-III-H wants to merge 24 commits into
Open
Conversation
Collaborator
|
can you add the setup instruction into README file under src/led_controller. Git action is complaining can you also take a look and we want the git action to build properly. |
billylin609
reviewed
Jun 20, 2026
| @@ -0,0 +1,3 @@ | |||
| uint8 red_val | |||
| uint8 green_val | |||
| uint8 blue_val No newline at end of file | |||
Collaborator
There was a problem hiding this comment.
https://docs.ros.org/en/noetic/api/std_msgs/html/msg/ColorRGBA.html
This is the ros official message for RGB i think for compatibility we should use the standard message.
| @@ -0,0 +1,99 @@ | |||
| #include <chrono> | |||
Collaborator
There was a problem hiding this comment.
need header file for clean interface
| timer_ = this->create_wall_timer(1s, std::bind(&LedColourControllerNode::publish_random_colour, this)); | ||
| timer_->cancel(); // Start with the timer stopped | ||
|
|
||
| publish_colour(255, 255, 0); // Turn to yellow after configuring |
Collaborator
There was a problem hiding this comment.
color should not be magic numbers
| colour->green_val = g; | ||
| colour->blue_val = b; | ||
|
|
||
| RCLCPP_INFO(this->get_logger(), "Publishing colour: R(%d), G(%d), B(%d)", colour->red_val, colour->green_val, colour->blue_val); |
| } | ||
|
|
||
| private: | ||
| void publish_colour(std::uint8_t r, std::uint8_t g, std::uint8_t b) { |
Collaborator
There was a problem hiding this comment.
Need to return operation success or fail for debugging
…-CIRC-2026 into feature/led-controller Merge main with branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This package contains a lifecycle node that publishes RGB values to the
/led_colourtopic and changes behaviour depending on the node's current lifecycle state:/led_colour/led_colour/led_colourInstructions
Build and Run Package
To build the package, run:
Then, source the workspace:
source install/setup.bashThen, run the LED Colour Controller:
Node Commands
To change the state of the node, run the commands below:
To view the output of the node, run:
ros2 topic echo /led_colour