ROBOTIS-GIT / OpenCR

Software for ROS Embedded board (a.k.a. OpenCR). OpenCR means Open-source Control Module for ROS.
Apache License 2.0
383 stars 238 forks source link

Connecting a Servo to the OpenCR #304

Open pitosalas opened 2 years ago

pitosalas commented 2 years ago

Looking around the source code and googling around, it seems to be that the Turtlebot3 / OpenCR board is set up to accept a servo connector. I see there's a package called servo etc. My question is where on the OpenCR board should we attach the servo connector? THank you!

shiba-8ro commented 2 years ago

Hi, If it is meaning PWM servo, ROBOTIS e-manual has the Pin assign description. https://emanual.robotis.com/docs/en/parts/controller/opencr10/#pwm

pitosalas commented 2 years ago

I see. Can you say whether how to enable the topic via rosserial on the OpenCR or does that happen "automatically"?

ROBOTIS-Will commented 2 years ago

Hi, This OpenCR ROS examples may help you to implement the publisher / subscriber for PWM motor control. Similar sub/pubs are implemented in the TurtleBot3 ROS example.

pitosalas commented 2 years ago

Thank you. I cannot locate the OpenCR ROS examples. And the TB3 ROS example shows the ROS side. I am asking about the OpenCR side. For example:

self.bumper_sub = rospy.Subscriber('sensor_state', SensorState, self.get_bumper, queue_size = 1)

I need the code on the OpenCR side that would publish sensor_state

Any pointers?

Pito Salas Faculty, Computer Science Brandeis University

On Apr 12, 2022, at 5:06 AM, Will Son @.***> wrote:

Hi, This OpenCR ROS examples may help you to implement the publisher / subscriber for PWM motor control. Similar sub/pubs are implemented in the TurtleBot3 ROS example.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

ROBOTIS-Will commented 2 years ago

@pitosalas I'm sorry about the delayed response. ROS examples in OpenCR board manager have those pub/sub implmentations. For example, the bumper status is published via "bumper" topic in the example below. https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/ROS/examples/02.%20Sensors/a_bumper/a_bumper.ino#L58

Similarly, the TurtleBot3 sensor state message is published in the below. https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/turtlebot3/examples/turtlebot3_burger/turtlebot3_core/turtlebot3_core.ino#L258

Thank you.

pitosalas commented 2 years ago

Thanks… Is there a developer guide for OpenCR? Because I understand the code you linked me to but I dont know where the “main loop” is for opencr where I would add rosserial code to subscribe to a topic and send the right commands to the servo.

Pito Salas Faculty, Computer Science Brandeis University

On Apr 20, 2022, at 10:45 PM, Will Son @.***> wrote:

@pitosalas I'm sorry about the delayed response. ROS examples in OpenCR board manager have those pub/sub implmentations. For example, the bumper status is published via "bumper" topic in the example below. https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/ROS/examples/02.%20Sensors/a_bumper/a_bumper.ino#L58 Thank you.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.