Skip to content

Robot Localizer#3754

Open
Andrewyx wants to merge 13 commits into
UBC-Thunderbots:masterfrom
Andrewyx:Andrewyx/robot_localizer
Open

Robot Localizer#3754
Andrewyx wants to merge 13 commits into
UBC-Thunderbots:masterfrom
Andrewyx:Andrewyx/robot_localizer

Conversation

@Andrewyx
Copy link
Copy Markdown
Contributor

Description

Completes the ported changes from #3716, and implements the robot localizer, its various interfaces, and completes refactoring on much of the thunderloop pipeline.

Testing Done

Resolved Issues

Resolves #3725

Length Justification and Key Files to Review

  • thunderloop.cpp
  • primitive_executor.cpp
  • robot_localizer.cpp

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Andrewyx where were these changes from? It seems to completely break the simulated test. When I go watch the replay of the logs there is just nothing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these were hotfixes to try and add ci mode and fix sim tests for merged branch. I haven't verified if they are correct/are working. Feel free to audit and fix them to pass the tests.

Copy link
Copy Markdown
Contributor

@StarrryNight StarrryNight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Added some comments.

* different
* @return True if the trajectories are different, false otherwise
*/
bool isNew(const Trajectory<double, double, double>& other,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDifferent could be a better representation of what the function does

* different in degrees.
* @return True if the trajectories are different, false otherwise
*/
bool isNew(const Trajectory<Angle, AngularVelocity, AngularAcceleration>& other,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

* different
* @return True if the trajectories are different, false otherwise
*/
virtual bool isNew(const Trajectory<P, V, A>& other, double threshold) const = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

* different
* @return True if the trajectories are different, false otherwise
*/
bool isNew(const Trajectory<Point, Vector, Vector>& other,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

Comment thread src/software/embedded/motion_control/pid_controller.h
clock_gettime(CLOCK_MONOTONIC, &last_kicker_fired);
}
else if (direct_control_.power_control().chicker().has_chip_distance_meters() ||
direct_control_.power_control()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to implement a chicker_status in power_control

// Robot 1
Point(world_ptr->field().centerPoint() +
Vector(-world_ptr->field().centerCircleRadius(), 0)),
Vector(-0.95 * world_ptr->field().centerCircleRadius(), 0)),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we doing this?

void StSpinMotorController::updateEuclideanVelocity(
EuclideanSpace_t target_euclidean_velocity)
{
const Vector local_velocity(target_euclidean_velocity[1],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we just swap these indices? Same for other ones.


// If we are lagging behind trajectory too much, we have stalled! We need to
// regenerate trajectory.
if (trajectory_path_.has_value())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add guard current_primitive_.has_move()

Angle orientation_to_destination =
orientation_.minDiff(angular_trajectory_->getDestination());
if (orientation_to_destination.toDegrees() < 5)
if (angular_trajectory_.has_value())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Robot Localizer

4 participants