Coder Social home page Coder Social logo

carnd-capstone's Introduction

Deprecated Repository

Udacity has launched a newer version of the associated Nanodegree program Self-Driving Car Engineer; as a result, the current repository is deprecated. We are no longer maintaining this repository and going to archive it. However, learners will be able to fork it to their personal Github account but cannot submit PRs to this repository. If you have any issues or suggestions to make, feel free to:

  • Utilize the https://knowledge.udacity.com/ forum to seek help on content-specific issues.
  • Submit a support ticket along with the link to your forked repository if (learners are) blocked for other reasons. You can find the link to file a support ticket in your classroom home.

This is the project repo for the final project of the Udacity Self-Driving Car Nanodegree: Programming a Real Self-Driving Car. For more information about the project, see the project introduction here.

Please use one of the two installation options, either native or docker installation.

Native Installation

  • Be sure that your workstation is running Ubuntu 16.04 Xenial Xerus or Ubuntu 14.04 Trusty Tahir. Ubuntu downloads can be found here.

  • If using a Virtual Machine to install Ubuntu, use the following configuration as minimum:

    • 2 CPU
    • 2 GB system memory
    • 25 GB of free hard drive space

    The Udacity provided virtual machine has ROS and Dataspeed DBW already installed, so you can skip the next two steps if you are using this.

  • Follow these instructions to install ROS

  • Download the Udacity Simulator.

  • You can check the Udacity Similator repository here

Docker Installation

Install Docker

Build the docker container

docker build . -t capstone

Run the docker file

docker run -p 4567:4567 -v $PWD:/capstone -v /tmp/log:/root/.ros/ --rm -it capstone

Port Forwarding

To set up port forwarding, please refer to the "uWebSocketIO Starter Guide" found in the classroom (see Extended Kalman Filter Project lesson).

Usage

  1. Clone the project repository
git clone https://github.com/udacity/CarND-Capstone.git
  1. Install python dependencies
cd CarND-Capstone
pip install -r requirements.txt
  1. Make and run styx
cd ros
catkin_make
source devel/setup.sh
roslaunch launch/styx.launch
  1. Run the simulator

Real world testing

  1. Download training bag that was recorded on the Udacity self-driving car.
  2. Unzip the file
unzip traffic_light_bag_file.zip
  1. Play the bag file
rosbag play -l traffic_light_bag_file/traffic_light_training.bag
  1. Launch your project in site mode
cd CarND-Capstone/ros
roslaunch launch/site.launch
  1. Confirm that traffic light detection works on real life images

Other library/driver information

Outside of requirements.txt, here is information on other driver/library versions used in the simulator and Carla:

Specific to these libraries, the simulator grader and Carla use the following:

Simulator Carla
Nvidia driver 384.130 384.130
CUDA 8.0.61 8.0.61
cuDNN 6.0.21 6.0.21
TensorRT N/A N/A
OpenCV 3.2.0-dev 2.4.8
OpenMP N/A N/A

We are working on a fix to line up the OpenCV versions between the two.

Updating the instructions

Feel free to submit PRs or issues should you see a scope for improvement.

carnd-capstone's People

Contributors

abhiojha8 avatar aoinakanishi avatar awbrown90 avatar baumanab avatar bydavy avatar carlosgalvezp avatar ckirksey3 avatar erik-rosen avatar hurtadosanti avatar ianboyanzhang avatar j-rojas avatar luisandroide avatar mvirgo avatar ncondo avatar olala7846 avatar spicavigo avatar sudkul avatar swwelch avatar uanjali avatar viennaharvey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carnd-capstone's Issues

using docker and sim

When Using the provided docker container and the sim running nativaly, I get the following error when I execute "roslaunch launch/styx.launch"

message handler error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/engineio/server.py", line 398, in _trigger_event
return self.handlersevent
File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 509, in _handle_eio_message
self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 448, in _handle_event
self._handle_event_internal(self, sid, data, namespace, id)
File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 451, in _handle_event_internal
r = server._trigger_event(data[0], namespace, sid, *data[1:])
File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 480, in _trigger_event
return self.handlers[namespace]event
File "/capstone/ros/src/styx/server.py", line 58, in image
bridge.publish_camera(data)
File "/capstone/ros/src/styx/bridge.py", line 180, in publish_camera
image_message = self.bridge.cv2_to_imgmsg(image_array, encoding="rgb8")
File "/opt/ros/kinetic/lib/python2.7/dist-packages/cv_bridge/core.py", line 248, in cv2_to_imgmsg
img_msg.height = cvim.shape[0]
IndexError: tuple index out of range

Restart problem

Hey guys,

I have installed ROS Kinetic natively on Ubuntu 16.04 and also running the simulator natively.
For the first time (say after OS reboot) I launch the styx.launch file which starts wsgi server on port 4567 as shown below,

core service [/rosout] found
process[styx_server-1]: started with pid [3239]
process[unity_simulator-2]: started with pid [3240]
What is the full path to your Unity simulator?
process[dbw_node-3]: started with pid [3244]
process[waypoint_loader-4]: started with pid [3245]
process[pure_pursuit-5]: started with pid [3246]
process[waypoint_updater-6]: started with pid [3249]
process[tl_detector-7]: started with pid [3263]
[INFO] [1507094692.698115]: --- throttle=0.0, brake=0.0, steer=0.0
[INFO] [1507094692.798314]: --- throttle=0.0, brake=0.0, steer=0.0
[INFO] [1507094692.898259]: --- throttle=0.0, brake=0.0, steer=0.0
[INFO] [1507094692.998241]: --- throttle=0.0, brake=0.0, steer=0.0
[INFO] [1507094693.098218]: --- throttle=0.0, brake=0.0, steer=0.0
[INFO] [1507094693.198182]: --- throttle=0.0, brake=0.0, steer=0.0
[INFO] [1507094693.298184]: --- throttle=0.0, brake=0.0, steer=0.0
(3239) wsgi starting up on http://0.0.0.0:4567
[INFO] [1507094693.398199]: --- throttle=0.0, brake=0.0, steer=0.0

And when I start the simulator, there is a successful connection between ros and simulator and the car drives around the track successfully.

Now when i close the ROS launch terminal by pressing CTRL+C the process ends, i exit the simulator also. But when I restart the ROS launch 2nd time, I dont see the message wsgi starting up. Now because of the simulator also does not connect. There is no way for me to work around except rebooting my machine which is horrible.

What I noticed was, if I dont start the simulator and do a ROS launch then everytime I kill and relaunch wsgi starts successfully. I dont understand whats happening but found a thread on socket.io which is very similar to what I am observing. Can you PLEASE_PLEASE take a look?

socketio/socket.io#1602

Catkin_make failed

I installed ROS Kinetic and Dataspped DBW on Ubuntu 16.04. I tried to make and run this repository without any changes, but it showed the error as follows:

Base path: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros
Source space: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src
Build space: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/build
Devel space: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel
Install space: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/install

Running command: "cmake /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src -DCATKIN_DEVEL_PREFIX=/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel -DCMAKE_INSTALL_PREFIX=/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/install -G Unix Makefiles" in "/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/build"

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 8 packages in topological order:
-- ~~ - camera_info_publisher
-- ~~ - styx
-- ~~ - styx_msgs
-- ~~ - twist_controller
-- ~~ - waypoint_follower
-- ~~ - waypoint_loader
-- ~~ - waypoint_updater
-- ~~ - tl_detector
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'camera_info_publisher'
-- ==> add_subdirectory(camera_info_publisher)
-- +++ processing catkin package: 'styx'
-- ==> add_subdirectory(styx)
-- +++ processing catkin package: 'styx_msgs'
-- ==> add_subdirectory(styx_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- styx_msgs: 4 messages, 0 services
-- +++ processing catkin package: 'twist_controller'
-- ==> add_subdirectory(twist_controller)
-- +++ processing catkin package: 'waypoint_follower'
-- ==> add_subdirectory(waypoint_follower)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'waypoint_loader'
-- ==> add_subdirectory(waypoint_loader)
-- +++ processing catkin package: 'waypoint_updater'
-- ==> add_subdirectory(waypoint_updater)
-- +++ processing catkin package: 'tl_detector'
-- ==> add_subdirectory(tl_detector)
-- Configuring done
-- Generating done
-- Build files have been written to: /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/build

Running command: "make -j12 -l12" in "/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/build"

Scanning dependencies of target std_msgs_generate_messages_lisp
Scanning dependencies of target std_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_eus
Scanning dependencies of target geometry_msgs_generate_messages_lisp
Scanning dependencies of target _styx_msgs_generate_messages_check_deps_TrafficLight
Scanning dependencies of target sensor_msgs_generate_messages_lisp
Scanning dependencies of target _styx_msgs_generate_messages_check_deps_TrafficLightArray
Scanning dependencies of target _styx_msgs_generate_messages_check_deps_Lane
Scanning dependencies of target sensor_msgs_generate_messages_eus
Scanning dependencies of target sensor_msgs_generate_messages_nodejs
Scanning dependencies of target _styx_msgs_generate_messages_check_deps_Waypoint
Scanning dependencies of target std_msgs_generate_messages_eus
[ 0%] Built target geometry_msgs_generate_messages_eus
[ 0%] Built target sensor_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target sensor_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 0%] Built target sensor_msgs_generate_messages_nodejs
[ 0%] Built target geometry_msgs_generate_messages_lisp
Scanning dependencies of target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_py
Scanning dependencies of target sensor_msgs_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_eus
Scanning dependencies of target std_msgs_generate_messages_py
[ 0%] Built target sensor_msgs_generate_messages_cpp
[ 0%] Built target geometry_msgs_generate_messages_nodejs
[ 0%] Built target std_msgs_generate_messages_cpp
Scanning dependencies of target geometry_msgs_generate_messages_py
[ 0%] Built target geometry_msgs_generate_messages_cpp
[ 0%] Built target _styx_msgs_generate_messages_check_deps_Lane
[ 0%] Built target _styx_msgs_generate_messages_check_deps_TrafficLightArray
[ 0%] Built target _styx_msgs_generate_messages_check_deps_TrafficLight
[ 0%] Built target sensor_msgs_generate_messages_py
[ 0%] Built target geometry_msgs_generate_messages_py
[ 0%] Built target styx_msgs_generate_messages_check_deps_Waypoint
[ 0%] Built target std_msgs_generate_messages_py
Scanning dependencies of target styx_msgs_generate_messages_eus
Scanning dependencies of target styx_msgs_generate_messages_nodejs
Scanning dependencies of target styx_msgs_generate_messages_lisp
Scanning dependencies of target styx_msgs_generate_messages_py
Scanning dependencies of target styx_msgs_generate_messages_cpp
[ 18%] Built target styx_msgs_generate_messages_py
[ 33%] Built target styx_msgs_generate_messages_nodejs
[ 51%] Built target styx_msgs_generate_messages_eus
[ 66%] Built target styx_msgs_generate_messages_lisp
[ 81%] Built target styx_msgs_generate_messages_cpp
Scanning dependencies of target styx_msgs_generate_messages
Scanning dependencies of target libwaypoint_follower
[ 81%] Built target styx_msgs_generate_messages
[ 85%] Building CXX object waypoint_follower/CMakeFiles/libwaypoint_follower.dir/lib/libwaypoint_follower.cpp.o
[ 88%] Linking CXX shared library /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel/lib/liblibwaypoint_follower.so
[ 88%] Built target libwaypoint_follower
Scanning dependencies of target pure_pursuit
[ 92%] Building CXX object waypoint_follower/CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o
[ 96%] Building CXX object waypoint_follower/CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o
[100%] Linking CXX executable /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel/lib/waypoint_follower/pure_pursuit
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function void ros::Publisher::publish<geometry_msgs::TwistStamped_<std::allocator<void> > >(geometry_msgs::TwistStamped_<std::allocator<void> > const&) const': /opt/ros/kinetic/include/ros/publisher.h:108: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/opt/ros/kinetic/include/ros/publisher.h:108: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /opt/ros/kinetic/include/ros/publisher.h:108: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/opt/ros/kinetic/include/ros/publisher.h:112: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /opt/ros/kinetic/include/ros/publisher.h:112: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o:/opt/ros/kinetic/include/ros/publisher.h:112: more undefined references to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' follow CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function main':
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:41: undefined reference to ros::init(int&, char**, std::string const&, unsigned int)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:43: undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&)'
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:44: undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)' CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function param':
/opt/ros/kinetic/include/ros/node_handle.h:2122: undefined reference to ros::NodeHandle::hasParam(std::string const&) const' /opt/ros/kinetic/include/ros/node_handle.h:2124: undefined reference to ros::NodeHandle::getParam(std::string const&, bool&) const'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function main': /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:48: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:48: undefined reference to ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > const&, char const*, int, char const*)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:52: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:56: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:65: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function ros::SubscriptionCallbackHelperT<boost::shared_ptr<geometry_msgs::TwistStamped_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)': /opt/ros/kinetic/include/ros/subscription_callback_helper.h:126: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function ros::SubscriptionCallbackHelperT<boost::shared_ptr<geometry_msgs::PoseStamped_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)': /opt/ros/kinetic/include/ros/subscription_callback_helper.h:126: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o:/opt/ros/kinetic/include/ros/subscription_callback_helper.h:126: more undefined references to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' follow CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o: In function waypoint_follower::PurePursuit::getCmdVelocity(int) const':
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:61: undefined reference to ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > const&, char const*, int, char const*)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:61: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o: In function waypoint_follower::PurePursuit::calcLookaheadDistance(int)': /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:80: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o: In function waypoint_follower::PurePursuit::calcCurvature(geometry_msgs::Point_<std::allocator<void> >) const': /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:100: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:100: undefined reference to ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > const&, char const*, int, char const*)' CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o: In function waypoint_follower::PurePursuit::getNextWaypoint()':
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:291: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o: In function waypoint_follower::PurePursuit::outputTwist(geometry_msgs::Twist
<std::allocator >) const':
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:339: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/pure_pursuit.dir/src/pure_pursuit_core.cpp.o: In function waypoint_follower::PurePursuit::go()':
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:358: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:388: undefined reference to ros::console::print(ros::console::FilterBase*, void*, ros::console::levels::Level, std::basic_stringstream<char, std::char_traits, std::allocator > const&, char const*, int, char const*)'
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:352: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:355: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:370: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /media/pixel/intelssd1TB/Cap/carnd_capstone/ros/src/waypoint_follower/src/pure_pursuit_core.cpp:388: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
collect2: error: ld returned 1 exit status
waypoint_follower/CMakeFiles/pure_pursuit.dir/build.make:338: recipe for target '/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel/lib/waypoint_follower/pure_pursuit' failed
make[2]: *** [/media/pixel/intelssd1TB/Cap/carnd_capstone/ros/devel/lib/waypoint_follower/pure_pursuit] Error 1
CMakeFiles/Makefile2:2094: recipe for target 'waypoint_follower/CMakeFiles/pure_pursuit.dir/all' failed
make[1]: *** [waypoint_follower/CMakeFiles/pure_pursuit.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j12 -l12" failed

Does anyone know how to fix this?

Mention that we're using python 2 somewhere

Everywhere else in the program we've been using python 3. It should be noted somewhere in the environment setup part of the README.md (probably right by the pip install -r requirements.txt that we're using python 2 and not python 3.

Cannot resize the simulator window (on Mac OS X 10.11.x)

Hello --

I am unable to resize the simulator window on Mac OS X 10.11.x.
It has taken over my entire Macbook display.
I cannot grab hold of the edges / corner of the window and resize it like any normal Mac program.

I've tried clicking on the green button, but it barely changes the size of the window.

See below.
Any pointers?? Greatly appreciated! Thanks!

screen shot 2017-09-28 at 3 56 36 pm

Fix CSV file of waypoints for the test track

They are specified in the wrong order, as discussed on Slack.
The only thing available to us is the rosbag udacity_succesful_light_detection.bag, from which we should listen to /base_waypoints and generate our own CSV file.

Please release an official CSV file, or update the documentation to point students on what to do.

Yaw in `wp_yaw_const.txt` given in degrees, not radians

This is then passed to tf.transformations.quaternion_from_euler which expects radians.
We should not change the code to transform to radians, because churchlot_with_cars.csv is (presumably) correctly given in radians.

So: please re-generate wp_yaw_const.txt with the yaw in radians. It would also be nice to name it with csv extension, for consistency.

Follow-up: if wp_yaw.txt is not being used, please remove it.

wp_yaw_const.csv problem

I find the values in wp_yaw_const.csv are not latitude and longitude coordinates. What do these data mean in wp_yaw_const.csv ๏ผŸ How to calculate them from latitude and longitude coordinates?

Stop Lights Setup

The stop lights in the sim are hanging overhead. The lights in the course are on single poles ( if the test pictures provided are an accurate example). Shouldn't the stop light setup in the sim match the lights used in the Carla testing course? Obviously the difference will affect things like where to look for the light in the image returned form the camera.

Can't install rosbag

I use the Udacity provided VM to develop the project. It shows the rosbag is not installed: The program 'rosbag' is currently not installed. You can install it by typing:
sudo apt install python-rosbag. When I do this, it shows "some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming". It also shows "unable to correct problems"

Please add gcc requirement for native build

I'm using Ubuntu 16.04 LTS. Native ROS kinetic install.

gcc4.9 doesn't work for the project build, catkin_make will complain:

[ 92%] Linking CXX executable /work/git_repo/CarND-Capstone/ros/devel/lib/waypoint_follower/pure_pursuit
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function void ros::Publisher::publish<geometry_msgs::TwistStamped_<std::allocator<void> > >(geometry_msgs::TwistStamped_<std::allocator<void> > const&) const': /opt/ros/kinetic/include/ros/publisher.h:108: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/opt/ros/kinetic/include/ros/publisher.h:108: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /opt/ros/kinetic/include/ros/publisher.h:108: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/opt/ros/kinetic/include/ros/publisher.h:112: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' /opt/ros/kinetic/include/ros/publisher.h:112: undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o:/opt/ros/kinetic/include/ros/publisher.h:112: more undefined references to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' follow CMakeFiles/pure_pursuit.dir/src/pure_pursuit.cpp.o: In function main':
/work/git_repo/CarND-Capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:41: undefined reference to ros::init(int&, char**, std::string const&, unsigned int)' /work/git_repo/CarND-Capstone/ros/src/waypoint_follower/src/pure_pursuit.cpp:43: undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&)'
...

Switching to gcc5.4.1, works fine. Got clue from comments here: https://answers.ros.org/question/234322/linker-error-on-ros-kinetic-ubuntu-1604/

Please document the units

It's not clear to me if the velocity units are in mph, k/h, or m/s?! Same goes with the constants defined in dbw_node.py. The units should not be ambiguous!

Transformation between `/world/` and `/base_link` not available in rosbags

This transformation is currently provided by bridge.py, using the TransformBroadcaster class.

However, in site.launch, bridge.py is not included and the rosbags don't seem to have any /tf information at all. You can easily check with:

rosrun tf view_frames
evince frames.pdf

The result is that the tf tree is empty.

Thus the provided code in tl_detector does not work because it tries to listen to the transformation between /world and /base_link which does not exist...

Socket Timeout while running roslaunch launch/styx.launch in Ubuntu 14.04.5

I followed the installation instructions for Ubuntu 14.04.5 however when I run After running 'roslaunch launch/styx.launch' I get socket.timeout Exception. I am unable to proceed further .

process[master]: started with pid [19241]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 16369e3c-f61c-11e7-b7b8-10feed1aa417
process[rosout-1]: started with pid [19254]
started core service [/rosout]
process[styx_server-2]: started with pid [19262]
process[unity_simulator-3]: started with pid [19272]
What is the full path to your Unity simulator?
process[dbw_node-4]: started with pid [19276]
process[waypoint_loader-5]: started with pid [19277]
process[pure_pursuit-6]: started with pid [19278]
process[waypoint_updater-7]: started with pid [19279]
process[tl_detector-8]: started with pid [19283]
(19262) wsgi starting up on http://0.0.0.0:4567
(19262) wsgi exited, is_accepting=True
Traceback (most recent call last):
  File "/home/vikash/CarND-Capstone/ros/src/styx/server.py", line 68, in <module>
    eventlet.wsgi.server(eventlet.listen(('', 4567)), app)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 896, in server
    client_socket = sock.accept()
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", line 224, in accept
    self._trampoline(fd, read=True, timeout=self.gettimeout(), timeout_exc=_timeout_exc)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", line 207, in _trampoline
    mark_as_closed=self._mark_as_closed)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/__init__.py", line 163, in trampoline
    return hub.switch()
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 295, in switch
    return self.greenlet.switch()
socket.timeout: timed out
[WARN] [WallTime: 1515598676.756611] Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details.
[styx_server-2] process has died [pid 19262, exit code 1, cmd /home/vikash/CarND-Capstone/ros/src/styx/server.py __name:=styx_server __log:=/home/vikash/.ros/log/16369e3c-f61c-11e7-b7b8-10feed1aa417/styx_server-2.log].
log file: /home/vikash/.ros/log/16369e3c-f61c-11e7-b7b8-10feed1aa417/styx_server-2*.log

Simulator returns incorrect value for /vehicle/steering_report

The message for the topic /vehicle/steering_report is a dbw_mkz_msgs/SteeringReport.

The simulator is returning the steering angle in radians within the steering_wheel_angle_cmd member. However this value should be the steering wheel angle which is multiplied by the steering wheel ratio. This would make these reports match the input provided by the SteeringCmd message.

The simulator is incorrect whereas Carla's SteeringReport values for this field match the intended value of the steering wheel angle.

QUESTION: Versions of CUDA, CUDNN, TensorRT, GCC and Others

What are the versions of:

  • nvidia driver installed on Carla
  • nvidia cuda
  • nvidia cudnn
  • nvidia TensorRT
  • OpenCV
  • does Carla have OpenMP and of what version?

I need this information because I consider using YOLO v3 for detection and classification of traffic signs. It is originally implemented using darknet neural networks framework which performs significantly faster than YOLO v3 converted to TensorFlow. I want to build a C shared library and include it into my submission. But for this, I need to know the versions of libraries I specified above.

Negative linear velocity in twist_cmd

Want to check if this is a bug.

While car runs stable around the lap, the linear velocity in twist_cmd is around 11.11.
After some time of car driving around the lap, the twist_cmd starts generating negative values for linear.x. This causes unstable car crashes.

OutputTwist in pure_pursuit_core.cpp has following code,

  double max_v = g_lateral_accel_limit / omega;

  double a = v * omega;
 
 ROS_INFO("lateral accel = %lf", a);

  twist.twist.linear.x = fabs(a) > g_lateral_accel_limit ? max_v
                    : v;
  twist.twist.angular.z = omega;

  return twist;

Here lateral accel goes above 5, and if max_v is negative, linear.x is negative.
Since omega can be negative, max_v can also be negative.

I changed max_v definition to

double max_v = fabs(g_lateral_accel_limit / omega);

Then the twist_cmd outputs positive values of linear.x, and car doesnt crash.

Omega is angular velocity which depends on curvature. If curvature can be negative (if car moves in clockwise or anticlockwise curves), then omega can be negative?
twist.angular.z = current_velocity_.twist.linear.x * curvature;

So the question is should we use fabs in the max_v definition above?

Inconsistency in traffic light locations

Hi, it seems there is an inconsistency between

  1. the light_positions specified in sim_traffic_light_config.yaml
  2. the actual values published by rostopic echo /vehicle/traffic_lights, e.g., the first several are [x: 1172.183, y: 1186.299], [x: 1584.065, y: 1156.953], [x: 2126.353, y: 1550.636],...

It seems the actual light locations in the sim player is consistent of 1. rather than 2. This causes problems when testing directly using the ground-truth by /vehicle/traffic_lights. Please suggest.

Communication Issue with Simulator in MacOSX and VirtualBox

Several students and I too have experienced an issue with the simulator running in Mac and ROS in the VirtualBox VM, the car does not move, despite publishing valid messages in throttle_cmd, and with the port forwarding correctly setup. This has been reported in the forums here:
https://discussions.udacity.com/t/car-freezes-in-simulator-solved/363942

Apparently, the issue is solved by modifying the /src/styx/server.py file as explained here

[unity_simulator-3] process has died

Hi,
I have installed docker and went until roslaunch launch/styx.launch step
but when i enter this step terminal get-back this error

OS: Ubuntu 16.04 - x64

auto-starting new master
process[master]: started with pid [1427]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to f11fe186-b77b-11e8-8226-0242ac110002
process[rosout-1]: started with pid [1440]
started core service [/rosout]
process[styx_server-2]: started with pid [1456]
process[unity_simulator-3]: started with pid [1458]
/capstone/ros/src/styx/unity_simulator_launcher.sh: line 19: sudo: command not found
process[dbw_node-4]: started with pid [1463]
process[waypoint_loader-5]: started with pid [1465]
process[pure_pursuit-6]: started with pid [1466]

[unity_simulator-3] process has died [pid 1458, exit code 127, cmd /capstone/ros/src/styx/unity_simulator_launcher.sh __name:=unity_simulator __log:=/root/.ros/log/f11fe186-b77b-11e8-8226-0242ac110002/unity_simulator-3.log].

log file: /root/.ros/log/f11fe186-b77b-11e8-8226-0242ac110002/unity_simulator-3*.log
process[waypoint_updater-7]: started with pid [1467]
process[tl_detector-8]: started with pid [1476]
(1456) wsgi starting up on http://0.0.0.0:4567

missing some specific topic in simulator env.

in example code, gave us some variables about vehicle to calculate the speed, accceleration, throttle, and also gave gas/fuel realted variables, but in simulation env, missing the fuel_report topic, which is used for fetcth the fuel container, but in real env, it is there.

Simulator refuses to run. "There is no data folder"

Hi, the simulator worked the previous days, but after updating docker version (and its dependencies), it refuses to run:

ricardo@Mahou:~/Descargas/linux_sys_int$ ./system_integration.x86_64 
Set current directory to /home/ricardo/Descargas/linux_sys_int
Found path: /home/ricardo/Descargas/linux_sys_int/system_integration.x86_64
There is no data folder
ricardo@Mahou:~/Descargas/linux_sys_int$ 

It doesn't show anymore the configuration dialog.

Just for clarification, I'm not running the simulator in docker. I just mention it because this is what has changed in my computer from yesterday (simulator working) to today (simulator not working). I guess there are some dependencies that has been updated and broke whatever is needed by the simulator.

Any tip?

Thank you very much

interface between ros point cloud 2 and obstacle data out of simulator seems not fit

I've got following error whenever I started the simulator and launch stxy:

message handler error
Traceback (most recent call last):
  File "/home/chili/.local/lib/python2.7/site-packages/engineio/server.py", line 408, in _trigger_event
    return self.handlers[event](*args)
  File "/home/chili/.local/lib/python2.7/site-packages/socketio/server.py", line 522, in _handle_eio_message
    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
  File "/home/chili/.local/lib/python2.7/site-packages/socketio/server.py", line 458, in _handle_event
    self._handle_event_internal(self, sid, data, namespace, id)
  File "/home/chili/.local/lib/python2.7/site-packages/socketio/server.py", line 461, in _handle_event_internal
    r = server._trigger_event(data[0], namespace, sid, *data[1:])
  File "/home/chili/.local/lib/python2.7/site-packages/socketio/server.py", line 490, in _trigger_event
    return self.handlers[namespace][event](*args)
  File "/home/chili/Dokumente/CarND-Capstone/ros/src/styx/server.py", line 48, in obstacle
    bridge.publish_obstacles(data)
  File "/home/chili/Dokumente/CarND-Capstone/ros/src/styx/bridge.py", line 156, in publish_obstacles
    cloud = pcl2.create_cloud_xyz32(header, data['obstacles'])
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/sensor_msgs/point_cloud2.py", line 165, in create_cloud_xyz32
    return create_cloud(header, fields, points)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/sensor_msgs/point_cloud2.py", line 138, in create_cloud
    pack_into(buff, offset, *p)
error: pack_into expected 3 items for packing (got 6)

What went wrong with my installation?

Car leaves the lane when I switch on the "Camera" button in the Simulator

The v1.3 release of the simulator solved a serious issue which prevented me from running the project on my machine.

The issue I had is that the car left the track suddenly after following the central lane for some time. The issue is completely solved with the v1.3 simulator when turning off the camera. When turning on the camera the issue is present as it was with the v1.2 simulator.

My first setup was running the simulator on Windows and ROS in a VirtualBox. I also tried native Slackware. The issue was the same.

Please, solve the camera issue.

providing executable for ARM

I'm currently working on a nvidia jetson tx1. Is there a chance that you provide the simulator compiled for arm architecture?

Simulator `steer_ratio` is incorrect. It should be 18.3345

The evidence for this is related to issue #110.

The /vehicle/steering_report returns the steering angle in radians, based upon the range of these values being [-0.447241, 0.447241] which is close to 25.62 degrees. I assume this is the correct maximum steering angle that can be actuated as most cars would have a ~40 degree steering angle.

If the above assumption is true, the SteeringCmd.steering_wheel_angle_cmd values are about ~18.33x the values output by SteeringReport.steering_wheel_angle_cmd. I've tested this with a few different values and it holds true for all valid steering angles.

Focal lengths wrong

Hi,

from sim_traffic_light_config.yaml:

"focal_length_x: 0.97428
focal_length_y: 1.73205"

I think these values are probably not correct. In 10m distance, an object with a width oft 1m (wider than a traffic light) would just be 0.1 pixels wide in the image plane which is impossible to detect of course. Typical values for fx and fy are in the range of 1000 pixels. As a consequence, the projection of the TLs always ends up at the focus of expansion. Please clarify or adapt focal length values.

Keras 1.2.0 InceptionV3 issue when using TensorFlow 1.0.0

Our team has the following issue when trying to re-train an InceptionV3 net or running a pre-trained InceptionV3 net with the requirements keras==1.2.0 and tensorflow==1.0.0:

loading traffic light detector model
Traceback (most recent call last):
  File "/udacity/ros/src/tl_detector/tl_detector.py", line 295, in <module>
    TLDetector()
  File "/udacity/ros/src/tl_detector/tl_detector.py", line 51, in __init__
    self.light_classifier = TLClassifier()
  File "/udacity/ros/src/tl_detector/light_classification/tl_classifier.py", line 23, in __init__
    self.model = keras.models.load_model(model_path)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/models.py", line 140, in load_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/models.py", line 190, in model_from_config
    return layer_from_config(config, custom_objects=custom_objects)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 38, in layer_from_config
    return layer_class.from_config(config['config'], custom_objects=custom_objects)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 2575, in from_config
    process_layer(layer_data)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 2572, in process_layer
    layer(input_tensors)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 1452, in __call__
    self.add_inbound_node(layers, node_indices, tensor_indices)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 632, in add_inbound_node
    Node.create_node(self, inbound_layers, node_indices, tensor_indices)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 170, in create_node
    output_tensors = to_list(outbound_layer.call(input_tensors, mask=input_masks))
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 1388, in call
    return K.concatenate(inputs, axis=self.concat_axis)
  File "/home/udacity/.local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1222, in concatenate
    return tf.concat(axis, [to_dense(x) for x in tensors])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1061, in concat
    dtype=dtypes.int32).get_shape(
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 611, in convert_to_tensor
    as_ref=False)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 676, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 121, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 102, in constant
    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 376, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

The effect is that we can not use transfer learning using Keras, which we think is a major setback for all Capstone teams.

The issue is also discussed in this upstream Keras issue: keras-team/keras#3548

We can solve this issue by upgrading Keras to version 1.2.2 locally, but we would need the same version running on Carla to be able to submit the project.

Version Number

I don't see a version number in the software so I am unsure which version I am using. Adding and "about" with a version number would be helpful. Obviously, I can download the latest version so this item is minor.

VM catkin_make error: "Could not find a package configuration file provided by "pcl_ros""

Followed instructions in README to run catkin_make from a base clone of this repo, and encountered the following error:

student@udacity:~/CarND-Capstone$ cd ros
student@udacity:~/CarND-Capstone/ros$ catkin_make
Base path: /home/student/CarND-Capstone/ros
Source space: /home/student/CarND-Capstone/ros/src
Build space: /home/student/CarND-Capstone/ros/build
Devel space: /home/student/CarND-Capstone/ros/devel
Install space: /home/student/CarND-Capstone/ros/install
####
#### Running command: "cmake /home/student/CarND-Capstone/ros/src -DCATKIN_DEVEL_PREFIX=/home/student/CarND-Capstone/ros/devel -DCMAKE_INSTALL_PREFIX=/home/student/CarND-Capstone/ros/install -G Unix Makefiles" in "/home/student/CarND-Capstone/ros/build"
####
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/student/CarND-Capstone/ros/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python (found version "2.7.12") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/student/CarND-Capstone/ros/build/test_results
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/local/bin/nosetests-2.7
-- catkin 0.7.6
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 8 packages in topological order:
-- ~~  - camera_info_publisher
-- ~~  - styx
-- ~~  - styx_msgs
-- ~~  - twist_controller
-- ~~  - waypoint_follower
-- ~~  - waypoint_loader
-- ~~  - waypoint_updater
-- ~~  - tl_detector
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'camera_info_publisher'
-- ==> add_subdirectory(camera_info_publisher)
-- +++ processing catkin package: 'styx'
-- ==> add_subdirectory(styx)
-- +++ processing catkin package: 'styx_msgs'
-- ==> add_subdirectory(styx_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- styx_msgs: 4 messages, 0 services
-- +++ processing catkin package: 'twist_controller'
-- ==> add_subdirectory(twist_controller)
-- +++ processing catkin package: 'waypoint_follower'
-- ==> add_subdirectory(waypoint_follower)
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "pcl_ros" with any
  of the following names:

    pcl_rosConfig.cmake
    pcl_ros-config.cmake

  Add the installation prefix of "pcl_ros" to CMAKE_PREFIX_PATH or set
  "pcl_ros_DIR" to a directory containing one of the above files.  If
  "pcl_ros" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  waypoint_follower/CMakeLists.txt:10 (find_package)


-- Could not find the required component 'pcl_ros'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "pcl_ros" with any
  of the following names:

    pcl_rosConfig.cmake
    pcl_ros-config.cmake

  Add the installation prefix of "pcl_ros" to CMAKE_PREFIX_PATH or set
  "pcl_ros_DIR" to a directory containing one of the above files.  If
  "pcl_ros" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  waypoint_follower/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/student/CarND-Capstone/ros/build/CMakeFiles/CMakeOutput.log".
See also "/home/student/CarND-Capstone/ros/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

Resolution: Ran sudo apt install ros-kinetic-pcl-ros which resolved this dependency issue.

turning on the camera slows car down so auto-mode gets messed up

turning on the camera slows car down so automode gets messed up
Profile image
Rupert S
about 1 hour ago
Hi

I am able to successfully complete many laps in the sim in automode. car follows green line.

but when i turn on the camera everything slows down such that the communication between ros and the car gets out of sync. for example right at the first stop light the car starts lagging behind the green waypoint line (ie the line sticks out the back of the car).

I suspect that the VM coms to external simulator is too slow ? or the image traffic to large.

I have also traffic lights working and the car slows down when seeing the first red light but cannot stop in time. when it sees green it accelerates

how can i debug this problem ??

thanks

Errors in the Docker image when selecting Camera in the simulator first track

After running 'roslaunch launch/styx.launch' from the Docker image while the simulator is running and the connection is established, then once I click on the camera check box, I get thse errors in ros (the errors are repetitive as long as there's a connection):

message handler error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/engineio/server.py", line 405, in _trigger_event
    return self.handlers[event](*args)
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 509, in _handle_eio_message
    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 448, in _handle_event
    self._handle_event_internal(self, sid, data, namespace, id)
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 451, in _handle_event_internal
    r = server._trigger_event(data[0], namespace, sid, *data[1:])
  File "/usr/local/lib/python2.7/dist-packages/socketio/server.py", line 480, in _trigger_event
    return self.handlers[namespace][event](*args)
  File "/capstone/ros/src/styx/server.py", line 60, in image
    bridge.publish_camera(data)
  File "/capstone/ros/src/styx/bridge.py", line 182, in publish_camera
    image_message = self.bridge.cv2_to_imgmsg(image_array, encoding="rgb8")
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/cv_bridge/core.py", line 248, in cv2_to_imgmsg
    img_msg.height = cvim.shape[0]
IndexError: tuple index out of range

FYI, I am running the Docker image on MacBook Pro (I tired two different Macs) both running MacOS Sierra.

Code runs different between two submits.

The code runs well (follow waypoints and desired speed) after commit (sha: dfc7d7b).
However when adding waypoints visualization after commit (sha: 3a2aef5), the car has a different behavior and is easily out of line. It seems the control doesn't work well.

Could anyone help to tell what's the difference between two commits and why the car's behavior is different.

I only change three files.

  • waypoint_updater.py
  • twist_controller.py
  • dbw_node.py

If you want to reproduce my result. The code is:

The codes come from d2macster's github.

waypoint_updater.py

#!/usr/bin/env python

import rospy
import math
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from itertools import islice, cycle

LOOKAHEAD_WPS = 200  # Number of waypoints we will publish. You can change this number


class WaypointUpdater(object):
    def __init__(self):
        rospy.init_node('waypoint_updater')

        # Subscribers
        rospy.Subscriber('/current_pose', PoseStamped, self.pose_cb, queue_size=1)
        rospy.Subscriber('/base_waypoints', Lane, self.waypoints_cb)
        # when taking traffic info into account, need two more subscribers here
        # /traffic_waypoint and /current_velocity (for planning waypoints at traffic light)
        # TODO: Add a subscriber for /traffic_waypoint and /obstacle_waypoint below

        # Publisher
        # This topic: /final_waypoints is subscribed from node pure_pursuit in waypoint_follower package
        self.final_waypoints_pub = rospy.Publisher('final_waypoints', Lane, queue_size=1)

        # Initialize important parameters
        self.current_pose = None
        self.waypoints = None
        self.final_waypoints = Lane()

        rospy.spin()

    def pose_cb(self, msg):
        # TODO: Implement
        self.current_pose = msg.pose
        next_waypoints = self.prepare_lookahead_waypoints()
        if next_waypoints is not None:
            self.publish_final_waypoints(next_waypoints)

    def waypoints_cb(self, msg):
        # TODO: Implement
        # Note that the publisher for /base_waypoints publishes only once
        # so we fill in the data only when it receives no prior waypoints info
        if self.waypoints is None:
            self.waypoints = msg.waypoints

    def traffic_cb(self, msg):
        # TODO: Callback for /traffic_waypoint message. Implement
        # will implement this later
        pass

    def obstacle_cb(self, msg):
        # TODO: Callback for /obstacle_waypoint message. We will implement it later
        # leave this part
        # no obstacle in the simulator
        pass

    def get_waypoint_velocity(self, waypoint):
        return waypoint.twist.twist.linear.x

    def set_waypoint_velocity(self, waypoints, waypoint, velocity):
        waypoints[waypoint].twist.twist.linear.x = velocity

    def distance(self, waypoints, wp1, wp2):
        dist = 0
        dl = lambda a, b: math.sqrt((a.x-b.x)**2 + (a.y-b.y)**2 + (a.z-b.z)**2)
        for i in range(wp1, wp2+1):
            dist += dl(waypoints[wp1].pose.pose.position, waypoints[i].pose.pose.position)
            wp1 = i
        return dist

    def prepare_lookahead_waypoints(self):
        if self.waypoints is None or self.current_pose is None:
            rospy.loginfo("Base waypoint or current pose info are missing. Not publishing waypoints ...")
            return None
        else:
            # current pose of the car (x and y coordinates)
            car_x, car_y = self.current_pose.position.x, self.current_pose.position.y
            closest_dist = 1000000000  # initialize with very large value
            closest_wp_pos = None  # closest waypoint's position (among the waypoint list)
            for i in range(len(self.waypoints)):
                # extract waypoint coordinates
                waypoint = self.waypoints[i]
                wp_x = waypoint.pose.pose.position.x
                wp_y = waypoint.pose.pose.position.y
                # calculate distance between the car's pose to each waypoint
                dist = math.sqrt((car_x-wp_x)**2 + (car_y-wp_y)**2)
                # search for position of closest waypoint to the car
                if dist < closest_dist:
                    closest_dist = dist
                    closest_wp_pos = i
            seq = cycle(self.waypoints)  # loop string of waypoints
            end_pos = closest_wp_pos + LOOKAHEAD_WPS - 1  # to build waypoint list with a fixed size
            next_waypoints = list(islice(seq, closest_wp_pos, end_pos))  # list of lookahead waypoints

            # without considering any traffic
            # let's make the car move forward with constant velocity (10mph)
            # we have to modify this part later
            for i in range(len(next_waypoints)-1):
                target_vel = self.mph_to_mps(10)
                self.set_waypoint_velocity(next_waypoints, i, target_vel)
            return next_waypoints

    def publish_final_waypoints(self, waypoints):
            lane = Lane()
            lane.header.frame_id = '/world'
            lane.header.stamp = rospy.Time(0)
            lane.waypoints = waypoints
            self.final_waypoints_pub.publish(lane)

    def mph_to_mps(self, data):
        return data*0.447

if __name__ == '__main__':
    try:
        WaypointUpdater()
    except rospy.ROSInterruptException:
        rospy.logerr('Could not start waypoint updater node.')

dbw_node.py

#!/usr/bin/env python

import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math

from twist_controller import Controller

class DBWNode(object):
    def __init__(self):
        rospy.init_node('dbw_node')

        vehicle_mass = rospy.get_param('~vehicle_mass', 1736.35)
        fuel_capacity = rospy.get_param('~fuel_capacity', 13.5)
        brake_deadband = rospy.get_param('~brake_deadband', .1)
        decel_limit = rospy.get_param('~decel_limit', -5)
        accel_limit = rospy.get_param('~accel_limit', 1.)
        wheel_radius = rospy.get_param('~wheel_radius', 0.2413)
        wheel_base = rospy.get_param('~wheel_base', 2.8498)
        steer_ratio = rospy.get_param('~steer_ratio', 14.8)
        max_lat_accel = rospy.get_param('~max_lat_accel', 3.)
        max_steer_angle = rospy.get_param('~max_steer_angle', 8.)

        self.steer_pub = rospy.Publisher('/vehicle/steering_cmd',
                                         SteeringCmd, queue_size=1)
        self.throttle_pub = rospy.Publisher('/vehicle/throttle_cmd',
                                            ThrottleCmd, queue_size=1)
        self.brake_pub = rospy.Publisher('/vehicle/brake_cmd',
                                         BrakeCmd, queue_size=1)

        self.controller = Controller(
            wheel_base=wheel_base,
            steer_ratio=steer_ratio,
            min_speed=0.0,
            max_lat_accel=max_lat_accel,
            max_steer_angle=max_steer_angle,
            vehicle_mass=vehicle_mass,
            fuel_capacity=fuel_capacity,
            wheel_radius=wheel_radius,
            brake_deadband=brake_deadband,
            decel_limit=decel_limit,
            accel_limit=accel_limit)

        self.dbw_enabled = False
        self.current_velocity = None
        self.twist_cmd = None

        rospy.Subscriber('/current_velocity', TwistStamped, self.current_velocity_cb)
        rospy.Subscriber('/twist_cmd', TwistStamped, self.twist_cmd_cb)
        rospy.Subscriber('/vehicle/dbw_enabled', Bool, self.dbw_enabled_cb)

        self.loop()

    def current_velocity_cb(self, msg):
        self.current_velocity = msg

    def twist_cmd_cb(self, msg):
        self.twist_cmd = msg

    def dbw_enabled_cb(self, msg):
        self.dbw_enabled = bool(msg.data)

    def loop(self):
        rate = rospy.Rate(50)  # 50Hz
        while not rospy.is_shutdown():

            if self.dbw_enabled:
                throttle, brake, steering = self.controller.control(
                    twist_cmd=self.twist_cmd,
                    current_velocity=self.current_velocity,
                    dbw_enabled=self.dbw_enabled)

                self.publish(throttle, brake, steering)

            rate.sleep()

    def publish(self, throttle, brake, steer):
        tcmd = ThrottleCmd()
        tcmd.enable = True
        tcmd.pedal_cmd_type = ThrottleCmd.CMD_PERCENT
        tcmd.pedal_cmd = throttle
        self.throttle_pub.publish(tcmd)

        scmd = SteeringCmd()
        scmd.enable = True
        scmd.steering_wheel_angle_cmd = steer
        self.steer_pub.publish(scmd)

        bcmd = BrakeCmd()
        bcmd.enable = True
        bcmd.pedal_cmd_type = BrakeCmd.CMD_TORQUE
        bcmd.pedal_cmd = brake
        self.brake_pub.publish(bcmd)


if __name__ == '__main__':
    DBWNode()

twist_controller.py

GAS_DENSITY = 2.858
ONE_MPH = 0.44704

import rospy
import math

from pid import PID
from yaw_controller import YawController


class Controller(object):
    def __init__(self, *args, **kwargs):
        self.pid_controller = PID(1.0, 0.2, 4)
        self.yaw_controller = YawController(
            wheel_base=kwargs['wheel_base'],
            steer_ratio=kwargs['steer_ratio'],
            min_speed=kwargs['min_speed'],
            max_lat_accel=kwargs['max_lat_accel'],
            max_steer_angle=kwargs['max_steer_angle']
        )

        self.prev_time = None
        self.prev_throttle = 0

        total_vehicle_mass = kwargs['vehicle_mass'] + kwargs['fuel_capacity'] * GAS_DENSITY
        self.max_brake_torque = total_vehicle_mass * abs(kwargs['decel_limit']) * kwargs['wheel_radius']

    def control(self, twist_cmd, current_velocity, dbw_enabled):
        """
        :return: (throttle, brake, steer)
        """

        throttle = 0.0
        brake = 0.0
        steering = 0.0

        if not dbw_enabled:
            self.pid_controller.reset()
            return throttle, brake, steering

        if not all((twist_cmd, current_velocity)):
            return throttle, brake, steering

        desired_linear_velocity = twist_cmd.twist.linear.x
        desired_angular_velocity = twist_cmd.twist.angular.z

        current_linear_velocity = current_velocity.twist.linear.x

        steering = self.yaw_controller.get_steering(
            linear_velocity=desired_linear_velocity,
            angular_velocity=desired_angular_velocity,
            current_velocity=current_linear_velocity)

        if not self.prev_time:
            self.prev_time = rospy.get_time()
            return throttle, brake, steering

        delta_v = desired_linear_velocity - current_linear_velocity
        delta_t = float(rospy.get_time() - self.prev_time)
        self.prev_time = rospy.get_time()

        control = self.pid_controller.step(
            error=delta_v,
            sample_time=delta_t
        )
        # throttle : [0 .. 1]
        # brake : torque (N*m) = F(acceleration, weight, wheel radius)


        if control > 0:
            throttle = 2 * math.tanh(control)
            throttle = max(0.0, min(1.0, throttle))
            if throttle - self.prev_throttle > 0.1:
                throttle = self.prev_throttle + 0.1
            brake = 0.0
        elif control >= -1:
            throttle = 0.0
            brake = 0.0
        else:
            throttle = 0.0
            brake = min(self.max_brake_torque, -control + 1)

        self.prev_throttle = throttle

        return throttle, brake, steering

Please clarify the use of /vehicle/traffic_lights

@ckirksey3 wrote this on Slack :

Carlos Galvez [4 days ago] 
@caleb Thanks! So if I understand correctly, we should always subscribe to `/vehicle/traffic_lights`. The only difference between simulator and real life, is that we will *not* get the status of the light in the test track. Is that correct? In other words, we will *always* get `(x, y, z, yaw)` of the traffic light both in test track and simulator?

Caleb Kirksey [3 days ago] 
@carlosgalvezp Yes, exactly

However the documentation in tl_detector and Udacity's project description are not aligned with that statement:

    '''
    /vehicle/traffic_lights helps you acquire an accurate ground truth
    data source for the traffic light classifier, providing the location
    and current color state of all traffic lights in the simulator.
    This state can be used to generate classified images or subbed into
    your solution to help you work on another single component of the node.
    This topic won't be available when testing your solution in real life
    so don't rely on it in the final submission.
    '''

Therefore: could this be officially clarified?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.