-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from JohannesPankert/fix/external_torque
fix gravity compensation in external torque computation
- Loading branch information
Showing
9 changed files
with
102 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <geometry_msgs/WrenchStamped.h> | ||
#include <gtest/gtest.h> | ||
#include <ros/ros.h> | ||
|
||
TEST( | ||
#if ROS_VERSION_MINIMUM(1, 15, 13) | ||
TestSuite, /* noetic & newer */ | ||
#else | ||
DISABLED_TestSuite, /* melodic */ | ||
#endif | ||
franka_hw_sim_compensates_gravity_on_F_ext) { | ||
ros::NodeHandle n; | ||
|
||
for (int i = 0; i < 50; i++) { | ||
auto msg = ros::topic::waitForMessage<geometry_msgs::WrenchStamped>( | ||
"/franka_state_controller/F_ext", n); | ||
|
||
auto now = msg->header.stamp; | ||
|
||
EXPECT_LE(std::abs(msg->wrench.force.x), 0.5) << "During time: " << now; | ||
EXPECT_LE(std::abs(msg->wrench.force.y), 0.5) << "During time: " << now; | ||
EXPECT_LE(std::abs(msg->wrench.force.z), 0.5) << "During time: " << now; | ||
EXPECT_LE(std::abs(msg->wrench.torque.x), 0.25) << "During time: " << now; | ||
EXPECT_LE(std::abs(msg->wrench.torque.y), 0.25) << "During time: " << now; | ||
EXPECT_LE(std::abs(msg->wrench.torque.z), 0.25) << "During time: " << now; | ||
} | ||
} | ||
|
||
int main(int argc, char** argv) { | ||
testing::InitGoogleTest(&argc, argv); | ||
ros::init(argc, argv, "franka_hw_sim_test"); | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<arg name="debug" default="false" doc="Bringup Gazebo GUI during the test?" /> | ||
<include file="$(find franka_gazebo)/launch/panda.launch"> | ||
<arg name="controller" value="cartesian_impedance_example_controller"/> | ||
<arg name="arm_id" value="panda"/> | ||
<arg name="x" value="-0.5"/> | ||
<arg name="world" value="$(find franka_gazebo)/world/stone.sdf"/> | ||
<arg name="headless" value="$(eval not arg('debug'))"/> | ||
</include> | ||
<test test-name="franka_hw_sim_gazebo_test" pkg="franka_gazebo" type="franka_hw_sim_gazebo_test" time-limit="600.0"/> | ||
</launch> |