ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

why do we need the (pid) controllers in ros_control?

asked 2021-12-25 21:41:58 -0500

zhixin gravatar image

For example, I have a robot with a motor controlled by a embeded board and I want to use ros applications to control the robot. Usually, there is a pid , let's say, speed controller implemented in the embeded board(or in the driver of motor). The SBC send(write) speed control signals to the embeded board. So I believe all we need is a hardware interface to translate ros msgs to embeded's control signal. what is the point of controllers in ros_control? Can I only implement a hardware interface and how?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-12-28 10:12:10 -0500

osilva gravatar image

Hi @zhixin, let's start with ros_control package:

The ros_control packages are a rewrite of the pr2_mechanism packages to make controllers generic to all robots beyond just the PR2.

The ros_control packages takes as input the joint state data from your robot's actuator's encoders and an input set point. It uses a generic control loop feedback mechanism, typically a PID controller, to control the output, typically effort, sent to your actuators. ros_control gets more complicated for physical mechanisms that do not have one-to-one mappings of joint positions, efforts, etc but these scenarios are accounted for using transmission

Source: http://wiki.ros.org/ros_control One of the goals of ROS is not to re-invent the wheel so ros_controlpackage allows for wide range of applications. However it's not the only way to interact with Hardware, you could do that through ROS1 messages and services. Refer to this tutorial: http://wiki.ros.org/ROS/Tutorials/Cre...

And take a look at example of robot implementation, you can communicate with drivers or other interfaces. https://docs.niryo.com/dev/ros/v3.2.0...

Finally I suggest you look at what is also available with ROS2 control: http://control.ros.org/

edit flag offensive delete link more

Comments

Thank you, Very informative anwser. So there are many ways to interact with the hardware. For the message and services as you mentioned, say I want controll a motor by sending the signal through a series port, I think the "actual send signal code" should be written in a node "control_signal_publisher", the messge is given to the topic not the actual SBC port. And I should assure the sended signal and the messge is the same. Is that right?

zhixin gravatar image zhixin  ( 2022-01-02 02:25:59 -0500 )edit

Take a look at this example using Arduino and rosserial: https://www.google.com/amp/s/atadiat....

I think you can do something similar. Not sure what do you mean by assuring the sent signal and message are the same, can you explain further pls

osilva gravatar image osilva  ( 2022-01-02 05:10:43 -0500 )edit

If the answer responded the original question please accept by clicking on the check mark

osilva gravatar image osilva  ( 2022-01-02 05:12:13 -0500 )edit

First thanks for the rosserial example, it solve my confusion. Then forget about "assuring the sent signal and message are the same". I just misundertand the communication between SBC and Arduino board: not realized that there is ros interface not only on SBC but also on Arduino. So rosseriel and ros_lib do the stuff I meant. User needn't to directly handle the seriel port(connect SBC and Arduino) stuff.

zhixin gravatar image zhixin  ( 2022-01-02 06:59:38 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-12-25 21:41:58 -0500

Seen: 297 times

Last updated: Dec 28 '21