Skip to content

Conversation

@abbbbbby
Copy link
Contributor

@abbbbbby abbbbbby commented Oct 1, 2016

No description provided.


private Config config;
private int times;
private Timer timer;
Copy link
Contributor

Choose a reason for hiding this comment

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

You are never initializing this. You should be able to get this from robot

@riftEmber
Copy link

Forgot to register command

@riftEmber
Copy link

Rename the command class-- there is no auton subsystem

@riftEmber
Copy link

Read the documentation of Timer, it's used wrong here

boolean blinding = vision.getLedState();
if(blinding && timer.hasPeriodElapsed(config.onTime)) {
vision.setLedState(false);
timer.reset();
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think resetting is necessary if you immediately start again

super("VisionFlashyFlash");
vision = robot.vision();
requires(vision);
this.timer = new Timer(robot.timeProvider());

Choose a reason for hiding this comment

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

use robot.timer() even though it isn't merged yet

logger.info("Flashing light {} times", config.maxTimes);
times = 0;
vision.setLedState(true);
timer.reset();

Choose a reason for hiding this comment

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

get rid of redundant timer function calls


static class Config {
public int maxTimes;
public float onTime;

Choose a reason for hiding this comment

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

We use doubles 'round these parts

@abbbbbby abbbbbby force-pushed the add-FlashyFlash branch 2 times, most recently from 9a156d0 to d78b628 Compare October 8, 2016 21:06
@vpzomtrrfrt vpzomtrrfrt dismissed amikhalev’s stale review October 15, 2016 21:19

Timer initialized

boolean blinding = vision.getLedState();
if(blinding && timer.hasPeriodElapsed(config.onTime)) {
vision.setLedState(false);
timer.start();
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently not necessary, hasPeriodElapsed restarts if it has

super("VisionFlashyFlash");
vision = robot.vision();
requires(vision);
timer = new Timer(robot.timeProvider());
Copy link
Contributor

Choose a reason for hiding this comment

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

Get the timer from robot

@riftEmber
Copy link

Needs autoformat

private AbstractVision vision;

public VisionFlashyFlash(CoreRobot robot) {
super("AutonFlashyFlash");

Choose a reason for hiding this comment

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

rename this

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants