Closed acbuynak closed 2 years ago
Setup
1 - Init ROS Node
2 - Setup Publisher to topic /paintbrush_color using custom message type: light_painting/RGBState.msg
Main
3 - Read pixel value < r, g, b >
4 - Instantiate and build a new RGBState message
5 - Set values of message. Must be UINT8 values (0-255)
This might look something like this pseudo-ish code. This is just some relevant chunks, does not include everything needed for a ROS node w/ publisher. This will not run.
import rospy
from light_painting.msg import RGBState
pub = rospy.Publisher('paintbrush_color ', RGBState, queue_size=5)
msg = RGBState()
msg.red = 187
msg.green = 0
msg.blue = 0
pub.publish(msg)
@MohammadKhan-3 Left a review of code. See comments in the review. Once changes made, I think this is ready to merge.
Let's do a regular Merge Pull Request
on this one to maintain the commit history.
Built the rosserial_arduino library
I ran rosrun rosserial_arduino serial_node.py -port=/tty/ACM0 -baud=500000
but still getting this error:
[ERROR] [1649688048.164270]: Error opening serial: [Errno 2] could not open port -port=/tty/ACM0: [Errno 2] No such file or directory: '-port=/tty/ACM0'
To create the Binary publisher:
Rolled back three commits to have this PR only include RGB. Moving Greyscale feature onto a new branch following this PR.
RGB Led onboard an Arduino Uno is controllable via ROS. PR updates Arduino Sketchbook.
Major Updates
/paintbrush_color
topicTests
Launched control to Arduino using
roslaunch light_painting t2_led_paintbrush.launch
. Used RQT's Message Publisher to publish test messages and confirmed LED updated to match RGB setting.Design Notes:
Verified Arduino had sufficient buffer size on Arduino Uno. Message is 3xUINT8 values (ie. 3 bytes). Current program size leaves ~600 bytes of memory available for variables. This is sufficient.
Program Control Flow:
Remaining Work