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

running pid node from roslaunch, process dies

asked 2015-07-24 10:18:14 -0600

radzaeem gravatar image

I tried running the controller node from pid package http://wiki.ros.org/pid

running from command line with rosrun works fine. but using launch file:

<launch>
    <node name="linear_controller" pkg="pid" type="controller"
   args="1 6 .001 2000 -tfc lin_effort -tfp lin_state -fc 1000"/>
</launch>

getting error

    process[linear_controller-3]: started with pid [28035]
*** stack smashing detected ***: /opt/ros/indigo/lib/pid/controller terminated
[linear_controller-3] process has died [pid 28035, exit code -6, cmd /opt/ros/indigo/lib/pid/controller 1 6 .001 2000 -tfc lin_effort -tfp lin_state -fc 1000 __name:=linear_controller __log:=/home/muaz/.ros/log/c6a3233e-3216-11e5-a8c9-20689d31db97/linear_controller-3.log].
log file: /home/muaz/.ros/log/c6a3233e-3216-11e5-a8c9-20689d31db97/linear_controller-3*.log

why it is getting stack smashing and exit code -6?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-07-26 01:47:02 -0600

AndyZe gravatar image

Hello,

I think this thread has the answer. Roslaunch is adding additional arguments, which screws up the pid node. It expects a particular order for the first 4 arguments.

http://ros-users.122217.n3.nabble.com...

I'm not sure what the workaround is yet. Perhaps I could re-release the package so the command is:

$ rosrun pid controller -Kp 2 -Ki 0.1 -Kd 0.05 -rate 200

It sucks to make the command even longer, though...

edit flag offensive delete link more

Comments

2

A ROS node should be able to handle these args properly. See ros::removeROSArgs(..).

gvdhoorn gravatar image gvdhoorn  ( 2015-07-26 02:42:52 -0600 )edit
1

Alright, that worked. Thanks. I'm pushing new versions of the package to ROS (takes ~1 month), or you can get it directly from my repo in the meantime. There's a launch file with the package now. https://bitbucket.org/AndyZe/pid/src/...

AndyZe gravatar image AndyZe  ( 2015-07-26 11:27:52 -0600 )edit

I think if you called check_user_input(..)afterros::init(argc, argv, node_name), the 'additional arguments' should already have been parsed and removed by ROS. Are things like remapping still working correctly the way you set things up?

gvdhoorn gravatar image gvdhoorn  ( 2015-07-26 11:52:53 -0600 )edit

Yes, remapping appears to work. It might have been easier to put check_user_input(..) after ros::init(argc, argv, node_name), but I'm not sure how that would affect node_name (since the node name needs to be parsed).

AndyZe gravatar image AndyZe  ( 2015-07-26 12:17:38 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-24 10:16:56 -0600

Seen: 2,983 times

Last updated: Jul 26 '15