0
$\begingroup$

Rosanswers logo

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!


Originally posted by Frdrckzn on ROS Answers with karma: 1 on 2017-08-21

Post score: 0


Original comments

Comment by jayess on 2017-08-21:
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.

Comment by jayess on 2017-08-21:
http://wiki.ros.org/Support#Guidelines_for_asking_a_question_.28Please_read_before_posting.29

Comment by Frdrckzn on 2017-08-21:
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

Comment by Frdrckzn on 2017-08-21:
I will post by soure code when I get home and thanks for the answer jayess

Comment by AndyZe on 2017-08-21:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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" /> 

Originally posted by AndyZe with karma: 2331 on 2017-08-23

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$