Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Include udacity master branch updates + update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahim-mo committed Dec 19, 2017
1 parent 7a57e11 commit 57be11d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ build
devel

profile.tmp

.DS_Store
.idea
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is the project repo for the final project of the Udacity Self-Driving Car N
* [ROS Indigo](http://wiki.ros.org/indigo/Installation/Ubuntu) if you have Ubuntu 14.04.
* [Dataspeed DBW](https://bitbucket.org/DataspeedInc/dbw_mkz_ros)
* Use this option to install the SDK on a workstation that already has ROS installed: [One Line SDK Install (binary)](https://bitbucket.org/DataspeedInc/dbw_mkz_ros/src/81e63fcc335d7b64139d7482017d6a97b405e250/ROS_SETUP.md?fileviewer=file-view-default)
* Download the [Udacity Simulator](https://github.com/udacity/CarND-Capstone/releases/tag/v1.2).
* Download the [Udacity Simulator](https://github.com/udacity/CarND-Capstone/releases).

### Docker Installation
[Install Docker](https://docs.docker.com/engine/installation/)
Expand Down
18 changes: 17 additions & 1 deletion ros/src/styx/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from std_msgs.msg import Header
from cv_bridge import CvBridge, CvBridgeError

from styx_msgs.msg import TrafficLight, TrafficLightArray
from styx_msgs.msg import TrafficLight, TrafficLightArray, Lane
import numpy as np
from PIL import Image as PIL_Image
from io import BytesIO
Expand All @@ -31,6 +31,7 @@
'steer_cmd': SteeringCmd,
'brake_cmd': BrakeCmd,
'throttle_cmd': ThrottleCmd,
'path_draw': Lane,
'image':Image
}

Expand All @@ -48,6 +49,7 @@ def __init__(self, conf, server):
'/vehicle/steering_cmd': self.callback_steering,
'/vehicle/throttle_cmd': self.callback_throttle,
'/vehicle/brake_cmd': self.callback_brake,
'/final_waypoints': self.callback_path
}

self.subscribers = [rospy.Subscriber(e.topic, TYPE[e.type], self.callbacks[e.topic])
Expand Down Expand Up @@ -188,3 +190,17 @@ def callback_throttle(self, data):

def callback_brake(self, data):
self.server('brake', data={'brake': str(data.pedal_cmd)})

def callback_path(self, data):
x_values = []
y_values = []
z_values = []
for waypoint in data.waypoints:
x = waypoint.pose.pose.position.x
y = waypoint.pose.pose.position.y
z = waypoint.pose.pose.position.z+0.5
x_values.append(x)
y_values.append(y)
z_values.append(z)

self.server('drawline', data={'next_x': x_values, 'next_y': y_values, 'next_z': z_values})
1 change: 1 addition & 0 deletions ros/src/styx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{'topic':'/vehicle/steering_cmd', 'type': 'steer_cmd', 'name': 'steering'},
{'topic':'/vehicle/throttle_cmd', 'type': 'throttle_cmd', 'name': 'throttle'},
{'topic':'/vehicle/brake_cmd', 'type': 'brake_cmd', 'name': 'brake'},
{'topic':'/final_waypoints', 'type': 'path_draw', 'name': 'path'},
],
'publishers': [
{'topic': '/current_pose', 'type': 'pose', 'name': 'current_pose'},
Expand Down
4 changes: 3 additions & 1 deletion ros/src/styx/server.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env python

import socketio
import eventlet
eventlet.monkey_patch(socket=True, select=True, time=True)

import eventlet.wsgi
import socketio
import time
from flask import Flask, render_template

Expand Down
41 changes: 0 additions & 41 deletions twist_controller.py

This file was deleted.

0 comments on commit 57be11d

Please sign in to comment.