Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script feature #14

Merged
merged 29 commits into from
Apr 15, 2017
Merged

Script feature #14

merged 29 commits into from
Apr 15, 2017

Conversation

leotrj
Copy link
Contributor

@leotrj leotrj commented Mar 25, 2017

Read() added to SensorCenter()
GPIOSensor can be created (has read() and readAll())
Register is currently commented out so that it cant add new sensors

@TrevorEdwards
Copy link
Contributor

rather than merge this to develop, i'm going to just have everyone pull this into their branch for now

@TrevorEdwards
Copy link
Contributor

code review will come later

Output.txt Outdated
@@ -0,0 +1,10 @@
HIIIIIIIHIIIIIIIHIIIIIIIGot: {"COLOR_SENSOR":{"data":0}}

Got: {"COLOR_SENSOR":{"data":0},"name":{"data":"INVALID: Abstract Sensor"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

delete this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

right = Sensor(bot, 'right')
center = Sensor(bot, 'center')
# redundant? bot.register_sensor(left)
# redundant? bot.register_sensor(right)
Copy link
Contributor

Choose a reason for hiding this comment

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

put this file in a different folder (like received/examples) and also remove these three comments

while(not end):

while(center.read()==1):
bot.move_foward(100)
Copy link
Contributor

Choose a reason for hiding this comment

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

this script doesn't compile- can you put the most recent working one up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't worry about it

Copy link
Contributor

Choose a reason for hiding this comment

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

i did already i thinks?

script.py Outdated

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

class BaseMiniBot:
Copy link
Contributor

Choose a reason for hiding this comment

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

update the classname and docs to reflect that this is a simulated bot

script.py Outdated
:param power The percentage of the bot's power to use from 0-100
:return True if the action is supported
"""
# print("Unimplemented: Moving backward "+str(power))
Copy link
Contributor

Choose a reason for hiding this comment

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

delet unnecessary commented code

script.py Outdated
:param power The percentage of the bot's power to use from 0-100
:return True if the action is supported
"""
# print("Unimplemented: Turning clockwise "+str(power))
Copy link
Contributor

Choose a reason for hiding this comment

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

delet

Thread t = new TCPServer(11111, this, this.commandCenter, this.sensorCenter);
this.runningThread = (TCPServer)t;
this.runningThread.start();
// t.start();
Copy link
Contributor

Choose a reason for hiding this comment

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

delet

e.printStackTrace();
}

// Reader r = new Reader(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

delet


public void run() {
while (true) {
System.out.println(parent.sensorCenter.getAllDataGson());
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesnt seem to be needed

Copy link
Contributor

Choose a reason for hiding this comment

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

at least disable it before the merge

break;
case "LEFT":
this.commandCenter.setWheelPower(-value, value, -value, value);
// System.out.println("LEFT " + value);
Copy link
Contributor

Choose a reason for hiding this comment

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

delete commented prints in this section

b.setLinearVelocity(new Vec2(0.0f, 0.0f));
b.setAngularVelocity((float)(turningspeed*fl/100));
}

//turning left
else if(fl < 0 && fr > 0 && bl < 0 && br > 0) {
System.out.println("turning left");
// System.out.println("turning left");
Copy link
Contributor

Choose a reason for hiding this comment

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

delet

…sname, added line follower script in seperate file
@TrevorEdwards TrevorEdwards mentioned this pull request Apr 12, 2017
@TrevorEdwards TrevorEdwards merged commit e554f5f into develop Apr 15, 2017
@TrevorEdwards TrevorEdwards deleted the script-feature branch April 15, 2017 02:01
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.

5 participants