-
Notifications
You must be signed in to change notification settings - Fork 2
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
Script feature #14
Conversation
rather than merge this to develop, i'm going to just have everyone pull this into their branch for now |
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"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this file
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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
Read() added to SensorCenter()
GPIOSensor can be created (has read() and readAll())
Register is currently commented out so that it cant add new sensors