matthias-mayr / Cartesian-Impedance-Controller

A C++ implementation of Cartesian impedance control for torque-controlled manipulators with ROS bindings.
https://matthias-mayr.github.io/Cartesian-Impedance-Controller/
BSD 3-Clause "New" or "Revised" License
212 stars 32 forks source link

Added unit tests #13

Closed jsaltducaju closed 10 months ago

jsaltducaju commented 10 months ago

Changes are: -All unit tests (including necessary changes in CMakeLists.txt and package.xml). -Panda setup files necessary until we have a minimal working example to replace this. -I added a throw exception for the damping to avoid having negative values (which can be very dangerous).

Note: I had to change the format of package.xml which implied changing all 'run_depend' commands for 'exec_depend'. It should not modify the functioning of previous elements of this repo.

matthias-mayr commented 10 months ago

What's the relation between base_tests_old.cpp and base_tests.cpp? The _old file looks "newer" actually

jsaltducaju commented 10 months ago

What's the relation between base_tests_old.cpp and base_tests.cpp? The _old file looks "newer" actually

I did the '_old' file tests first without the ROS environment. Then, I modified this test to include ROS (that is 'base_test.cpp'). Some of the commands of the cmake are meant to include ROS: https://github.com/jsaltducaju/Cartesian-Impedance-Controller/blob/master/CMakeLists.txt, e.g., add_rostest_gtest.

matthias-mayr commented 10 months ago

I edited some things here and there. Mostly to make things a bit clearer.

Right now there are two immediate things:

  1. The commanded-torque test fails sometimes because of nan values
  2. The reference_pose test always fails. For 2., I am not sure what it should check. reference_pose is a topic that is served from the outside, so someone sends a pose. Probably it succeeded before, because of the Panda interactive marker constantly sent poses. But the thing is that this test will always succeed if someone publishes there, even if the controller did not start up.

Another small todo is to add the tests to the CI pipeline.