andreynech/udacity-cs373
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
This repository is for the experimental and demonstration purposes. Programs here are inspired by the CS-373 "Programming a robotic car" online class offered by Udacity.com: http://www.udacity.com/overview/Course/cs373/CourseRev/apr2012 . The goal was to introduce as less modifications as possible to the code written and explained in the class. However, there were typically two modifications necessary. The first set of modifications is to initialize our remoting infrastructure and get connected to the vehicle. For these purposes we introduce the main application class Client which inherits Ice.Application class. Then we move different functions presented in corresponding units into our Client class. And finally, the main application logic resides in the Client.run() function. This function is invoked from Client.main() function within the following typical start-up code fragment: if __name__ == "__main__": app = Client() app.main(sys.argv, "client.config") All the connection parameters (like host and port of the vehicle to connect) are specified in the client.config file. The second modification is the class which receives information (callbacks) from sonar sensors. We define this class as following: # Callback interface with function which will be invoked every time # the new sensor data is available from the robot class SensorDataReceiverI(sensors.SensorFrameReceiver): def __init__(self): self.sonar = -1 # Callback function with new sensor data as frame parameter def nextSensorFrame(self, frame, current=None): for measurement in frame: # 0xE6 is the ID of the rear sonar. # Other sonars have following IDs: # 0xE0 - front, 0xE2 - left, 0xE4 - right if measurement.sensorid == 0xE6 and len(measurement.shortdata) > 0: # Sonar self.sonar = measurement.shortdata[0] Here SensorDataReceiverI.nextSensorFrame(...) function is invoked every time the new ranging information from sonars is available. The corresponding initialization code could be found at the beginning of the Client.run(...) function.
About
Experimental code inspired by the Udacity's CS373 class
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published