This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polygon obstacle plumbing, obstacles fix (#69)
* parent 20bb8c2 author Lewy Seiden <[email protected]> 1697929321 -0700 committer Lewy Seiden <[email protected]> 1703659757 -0800 started playing with dt removed cmake cache made solution return actual dts unfucked(?) variable dt added min time to dt stopped double constraining dt changed kinematics constraint dt sampling to current sample instead of prev changed dt sample in discrete time goal added upper bound to dt increased maximum dt fixed control interval jumping Run wpiformat fixed swerve obstacles added polygon plumbing reduced max dt Run wpiformat reverted var-dt changes * added max dt based on robot frame size * ran wpiformat * fixed format violation * removed cmake generated files --------- Co-authored-by: Lewy Seiden <[email protected]>
- Loading branch information
1 parent
a2f290d
commit c9f8140
Showing
8 changed files
with
153 additions
and
18 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,57 @@ | ||
// Copyright (c) TrajoptLib contributors | ||
|
||
#include <vector> | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include "path/InitialGuessPoint.h" | ||
#include "path/SwervePathBuilder.h" | ||
|
||
TEST(ObstacleTest, GenerateLinearInitialGuess) { | ||
using namespace trajopt; | ||
trajopt::SwervePathBuilder path; | ||
path.SetDrivetrain({45, 6, | ||
[{ | ||
x : 0.6, | ||
y : 0.6, | ||
wheel_radius : 0.04, | ||
wheel_max_angular_velocity : 70.0, | ||
wheel_max_torque : 2.0, | ||
}, | ||
{ | ||
x : 0.6, | ||
y : -0.6, | ||
wheel_radius : 0.04, | ||
wheel_max_angular_velocity : 70.0, | ||
wheel_max_torque : 2.0, | ||
}, | ||
{ | ||
x : -0.6, | ||
y : 0.6, | ||
wheel_radius : 0.04, | ||
wheel_max_angular_velocity : 70.0, | ||
wheel_max_torque : 2.0, | ||
}, | ||
{ | ||
x : -0.6, | ||
y : -0.6, | ||
wheel_radius : 0.04, | ||
wheel_max_angular_velocity : 70.0, | ||
wheel_max_torque : 2.0, | ||
}]}); | ||
path.PoseWpt(0, 0.0, 0.0, 0.0); | ||
path.PoseWpt(1, 2.0, 2.0, 0.0); | ||
|
||
const length = 0.7; | ||
path.AddBumpers(trajopt::Bumpers{.safetyDistance = 0.1, | ||
.points = {{+length / 2, +width / 2}, | ||
{-length / 2, +width / 2}, | ||
{-length / 2, -width / 2}, | ||
{+length / 2, -width / 2}}}); | ||
|
||
path.SgmtObstacle( | ||
0, 1, trajopt::Obstacle{.safetyDistance = 1.0, .points = {{1.0, 1.0}}}); | ||
|
||
path.ControlIntervalCounts({10}); | ||
ASSERT_NO_THROW(trajopt::OptimalTrajectoryGenerator::Generate(path)); | ||
} |