jsk-ros-pkg / jsk_control

jsk control ros packages
http://github.com/jsk-ros-pkg/jsk_control
13 stars 51 forks source link

Question about the usage of unit test codes #747

Closed JaehyunShim closed 4 years ago

JaehyunShim commented 4 years ago

Hi @garaemon,

I have a question about how to write unit test codes for robot controllers. Since you do not use a physical robot while unit testing your controller, you can only use a simulator, in this case, Gazebo, as you elaborated in this code, but this is not really following the syntax recommended in the ROS instruction. Instead of just running each command-line written on the top of the code one by one and run your test.py executable, is there any other way to check if your controller works fine by just using catkin_make with the run_tests option?

Any advice would be appreciated. Thank you in advance, Ryan

garaemon commented 4 years ago

As far as I remember, the code is a demonstration code rather than a unit test code.

In order to make test_footstep_controller.py a unit test, rostest can be a good solution.

JaehyunShim commented 4 years ago

@garaemon

I thought it was a test code as it was in the test folder. Thank you for your advice. I will try that

Ryan