-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into jtc/parse_urdf
- Loading branch information
Showing
11 changed files
with
132 additions
and
32 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
Binary file added
BIN
+29 KB
rqt_joint_trajectory_controller/doc/rqt_joint_trajectory_controller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
:github_url: https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/rqt_joint_trajectory_controller/doc/userdoc.rst | ||
|
||
.. _rqt_joint_trajectory_controller_userdoc: | ||
|
||
rqt_joint_trajectory_controller | ||
=============================== | ||
|
||
rqt_joint_trajectory_controller is a GUI plugin for rqt that allows to command a joint_trajectory_controller. | ||
|
||
.. image:: rqt_joint_trajectory_controller.png | ||
:width: 400 | ||
:alt: rqt_joint_trajectory_controller |
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
110 changes: 110 additions & 0 deletions
110
steering_controllers_library/test/test_steering_odometry.cpp
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,110 @@ | ||
// Copyright (c) 2023, Virtual Vehicle Research GmbH | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "gmock/gmock.h" | ||
|
||
#include "steering_controllers_library/steering_odometry.hpp" | ||
|
||
TEST(TestSteeringOdometry, initialize) | ||
{ | ||
EXPECT_NO_THROW(steering_odometry::SteeringOdometry()); | ||
|
||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 3.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
EXPECT_DOUBLE_EQ(odom.get_heading(), 0.); | ||
EXPECT_DOUBLE_EQ(odom.get_x(), 0.); | ||
EXPECT_DOUBLE_EQ(odom.get_y(), 0.); | ||
} | ||
|
||
TEST(TestSteeringOdometry, ackermann_fwd_kin_linear) | ||
{ | ||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 1.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
odom.update_open_loop(2., 0., 0.5); | ||
EXPECT_DOUBLE_EQ(odom.get_linear(), 2.); | ||
EXPECT_DOUBLE_EQ(odom.get_x(), 1.); | ||
EXPECT_DOUBLE_EQ(odom.get_y(), 0.); | ||
} | ||
|
||
TEST(TestSteeringOdometry, ackermann_fwd_kin_angular_left) | ||
{ | ||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 1.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
odom.update_open_loop(1., 1., 1.); | ||
EXPECT_DOUBLE_EQ(odom.get_linear(), 1.); | ||
EXPECT_DOUBLE_EQ(odom.get_angular(), 1.); | ||
|
||
EXPECT_GT(odom.get_x(), 0); // pos x | ||
EXPECT_GT(odom.get_y(), 0); // pos y, ie. left | ||
} | ||
|
||
TEST(TestSteeringOdometry, ackermann_fwd_kin_angular_right) | ||
{ | ||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 1.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
odom.update_open_loop(1., -1., 1.); | ||
EXPECT_DOUBLE_EQ(odom.get_linear(), 1.); | ||
EXPECT_DOUBLE_EQ(odom.get_angular(), -1.); | ||
EXPECT_GT(odom.get_x(), 0); // pos x | ||
EXPECT_LT(odom.get_y(), 0); // neg y ie. right | ||
} | ||
|
||
TEST(TestSteeringOdometry, ackermann_back_kin_linear) | ||
{ | ||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 1.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
odom.update_open_loop(1., 0., 1.); | ||
auto cmd = odom.get_commands(1., 0.); | ||
auto cmd0 = std::get<0>(cmd); // vel | ||
EXPECT_EQ(cmd0[0], cmd0[1]); // linear | ||
EXPECT_GT(cmd0[0], 0); | ||
auto cmd1 = std::get<1>(cmd); // steer | ||
EXPECT_EQ(cmd1[0], cmd1[1]); // no steering | ||
EXPECT_EQ(cmd1[0], 0); | ||
} | ||
|
||
TEST(TestSteeringOdometry, ackermann_back_kin_left) | ||
{ | ||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 1.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
odom.update_from_position(0., 0.2, 1.); // assume already turn | ||
auto cmd = odom.get_commands(1., 0.1); | ||
auto cmd0 = std::get<0>(cmd); // vel | ||
EXPECT_GT(cmd0[0], cmd0[1]); // right (outer) > left (inner) | ||
EXPECT_GT(cmd0[0], 0); | ||
auto cmd1 = std::get<1>(cmd); // steer | ||
EXPECT_LT(cmd1[0], cmd1[1]); // right (outer) < left (inner) | ||
EXPECT_GT(cmd1[0], 0); | ||
} | ||
|
||
TEST(TestSteeringOdometry, ackermann_back_kin_right) | ||
{ | ||
steering_odometry::SteeringOdometry odom(1); | ||
odom.set_wheel_params(1., 2., 1.); | ||
odom.set_odometry_type(steering_odometry::ACKERMANN_CONFIG); | ||
odom.update_from_position(0., -0.2, 1.); // assume already turn | ||
auto cmd = odom.get_commands(1., -0.1); | ||
auto cmd0 = std::get<0>(cmd); // vel | ||
EXPECT_LT(cmd0[0], cmd0[1]); // right (inner) < left outer) | ||
EXPECT_GT(cmd0[0], 0); | ||
auto cmd1 = std::get<1>(cmd); // steer | ||
EXPECT_GT(std::abs(cmd1[0]), std::abs(cmd1[1])); // abs right (inner) > abs left (outer) | ||
EXPECT_LT(cmd1[0], 0); | ||
} |