Team302 / 2024Crescendo

MIT License
2 stars 0 forks source link

Update FaceSpeaker #316

Open witcpalek opened 9 months ago

witcpalek commented 9 months ago

Do this after https://github.com/Team302/2024Crescendo/issues/312

Make this class a subclass of FaceVisionTarget

pragma once

include "frc/geometry/Pose3d.h"

// Team302 Includes

include "chassis/headingStates/FaceVisionTarget.h"

class FaceSpeaker : public FaceVisionTarget { public: FaceSpeaker(); ~FaceSpeaker() = default;

protected: frc::Pose3d GetVisionTargetPose() override; };

FaceSpeaker::FaceSpeaker() : FaceVisionTarget(ChassisOptionEnums::HeadingOption::FACE_SPEAKER) { }

Pose3d FaceSpeaker::GetVisionTargetPose() { int apriltag = (FMSData::GetInstance()->GetAllianceColor() == frc::DriverStation::Alliance::kBlue) ? 7 :4; DragonAprilTagInifo aprilTagInfo; return aprilTagInfo.Get3DPose(apriltag); }

witcpalek commented 9 months ago
int aprilTag = (FMSData::GetInstance()->GetAllianceColor() == frc::DriverStation::kBlue ? FaceTarget::BLUE_AMP : FaceTarget::RED_AMP);
return frc::LoadAprilTagLayoutField(frc::AprilTagField::k2024Crescendo).GetTagPose()l;
witcpalek commented 9 months ago

Implement #367 at the same time