ros-controls / ros_control

Generic and simple controls framework for ROS
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
469 stars 307 forks source link

Exception thrown while initializing controller 'test_velocity_controller' - error not descriptive enough #501

Open JanezCim opened 2 years ago

JanezCim commented 2 years ago

ROS Noetic OS: Ubuntu 20.04 ros_control - branch noetic-devel - 53c2487d1b56a40f1d00b06c49512aa7fd2bf465 - pulled and compiled locally

when i start the controler manger with parameters pose_covariance_diagonal and twist_covariance_diagonal loaded from .launch file like this

<param name="/test_velocity_controller/pose_covariance_diagonal" value="[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]"/>
<param name="/test_velocity_controller/twist_covariance_diagonal" value="[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]"/>

I get an error.

[ERROR] [1634720945.369268249]: Exception thrown while initializing controller 'test_velocity_controller'
[ERROR] [1634720945.369395193]: Initializing controller 'test_velocity_controller' failed
[ERROR] [1634720946.372959]: Failed to load test_velocity_controller

I figured out that the correct way of loading list params into rosparam is like this:

<rosparam param="/test_velocity_controller/pose_covariance_diagonal">[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]</rosparam>
<rosparam param="/test_velocity_controller/twist_covariance_diagonal">[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]</rosparam>

and the thing ended up working afterward, but it took me A LONG LONG time to figure this out (more then i care to admit).

Problem: Exception thrown while initializing controller 'test_velocity_controller' is not descriptive enough in this edge case and it takes a lot of energy and backward engineering to actually find out what the heck is wrong.

Humble suggestion: Please make the error message more descriptive, ideally point out exactly what parameter is causing the exception but maybe point out also the reason.

Otherwise excellent work with the package! Thanks!

bmagyar commented 1 year ago

Hello, I'd be very happy to review a Pull Request from you addressing this ;)