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

Could any one explain to me how to make the PID controller works?

asked 2017-08-21 14:23:34 -0500

Frdrckzn gravatar image

Hi guys I’m new with ROS and I'm trying to implement a PID because I need that my robot goes straight. I understand how the package works, but when I try to publish something in the set point or state topic and reading the pid_effort I get nothing. My cpp code is compilated so I dont have sintax errors but when I check the topic with rostopic info it says that I’m not subscribed on the topics or i'm not publishing in the control_effort. So I dont know how to use it. Maybe is like a step list or something to get he PID working I dont know, please help!

edit retag flag offensive close merge delete

Comments

Welcome. To better help you we're going to need more information. What package are you referring to? How are you running things? What's the output in your terminal? Where's your source code? Just because it compiles that doesn't mean that it's correct.

jayess gravatar image jayess  ( 2017-08-21 14:59:44 -0500 )edit

I'm using the PID package this is the one http://wiki.ros.org/pid The only thing im doing is making the node has the wiki sais and im trying to make it work in a simple way. In the terminal (I'm using Ubuntu 16.04) I get nothing because i just want to publish or read values of the topics of the PID

Frdrckzn gravatar image Frdrckzn  ( 2017-08-21 15:15:42 -0500 )edit

I will post by soure code when I get home and thanks for the answer jayess

Frdrckzn gravatar image Frdrckzn  ( 2017-08-21 15:17:18 -0500 )edit

Can you run "rqt_graph" and post the image in your question? It should show 4 nodes, connected as shown at http://wiki.ros.org/pid. If I were you, I would start from the given examples, then modify them.

AndyZe gravatar image AndyZe  ( 2017-08-21 16:58:19 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-08-23 17:10:58 -0500

AndyZe gravatar image

updated 2017-08-23 17:13:46 -0500

Can you run the examples? What happens when you do:

roslaunch pid servo_sim.launch

Look at the launch file for that ^. There are two nodes you can modify for your purposes. The other nodes you don't have to mess with. You can tune the "left_wheel_pid" node at run-time. These are the 2 nodes whose code you should modify:

<node name="servo_sim_node" pkg="pid" type="plant_sim" output="screen" >
  <param name="plant_order" value="2" />
</node>

<node name="setpoint_node" pkg="pid" type="setpoint_node" output="screen" />
edit flag offensive delete link more

Question Tools

Stats

Asked: 2017-08-21 14:23:34 -0500

Seen: 3,820 times

Last updated: Aug 23 '17