Git Product home page Git Product logo

jetson_car's Introduction

jetson_car

Repository for the development of the JHS Autonomous Race Car Club's ROS Jetson Car (TX2) with RealSense D400 series 3D camera

Check out system flowcharts

Master
Build Status CodeFactor

Development
Build Status CodeFactor

Getting Started

  • Make sure you have installed git lfs on the jetson, controller, and development computer
    • Git LFS will allow you to easily keep ML models up to date across computers with git version control
    • https://git-lfs.github.com/
    • Install of git lfs
      • This will need to be installed by source on the Jetson (DO NOT follow the instructions exactly. See below)
        • Get latest version of Go for Linux ARMv8 and run the extract command
        • Make sure that the $GOPATH is set to home/$USER/gocode and that Go is version 1.8 or higher go version
        • go get github.com/git-lfs/git-lfs
        • sudo cp ~/gocode/bin/git-lfs /usr/local/bin
        • git lfs install
  • Connect the nvidia jetson to the same network as the controller and make sure that you have an internet connection
  • Before setup make sure to sudo apt-get update and sudo apt-get upgrade
  • Clone/download the repository on both the jetson and the controller
  • See the Nvidia Jetson Setup section
  • If running on a desktop computer / controller without realsense packages installed run rosdep install --from-paths src --ignore-src -r -y and catkin_make -DCATKIN_BLACKLIST_PACKAGES="realsense2_camera" in workspace
    • If you want to run the realsense2 ROS node on a desktop / controller see Librealsense Setup (D415/D435) section and use the realsense2_camera pkg in the drivers folder by copying it into a local catkin_ws (do not push this change as it will brake the jetson side)
  • On the jetson run rosdep install --from-paths src --ignore-src -r -y and catkin_make in the jetsoncar_ws
  • Run the controller.sh or jetson.sh scripts to get the devices setup and communicating with each other OR run export ROS_MASTER_URI=http://tegra-ubuntu.local:11311 and export ROS_HOSTNAME=hostname_of_machine.local
    • It is highly recommended that you run the controller.sh and jetson.sh scripts on their respective devices
  • See DualShock 4 Controller Setup section for setting up the controller with the correct platform

Important Notes

  • When running the jetson car with WiFi make sure that WiFi power saving mode is off. sudo iw dev wlan0 set power_save off and check with sudo iw dev wlan0 get power_save. This needs to be done each time the WiFi reconnects to a new network.

Simulation Setup

  • Go through Librealsense Setup (demo/viewing tools are not required)
  • cd ~/Desktop/jetson_car/jetsoncar_ws
  • catkin_make (even if this fails)
  • soruce devel/setup.bash
  • rosdep install racecar_description
  • Install Tensor Flow (download GPU version if you have one)
  • Install Keras sudo pip install keras
  • sudo pip install h5py

Librealsense Setup (D415/D435)

  • Install the intel realsense 2 SDK (needed to catkin_make the catkin workspace if using the simulation of the physical sensor)
  • https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md
    • sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
    • sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main" -u
    • sudo apt-get update
    • sudo apt-get install librealsense2 librealsense2-dev librealsense2-dbg
    • sudo apt-get install librealsense2-dkms For demo
    • sudo apt-get install librealsense2-utils Tools for viewing physical camera data (See /usr/bin/realsense-viewer)
  • When ready plug in the realsense camera and test it using the /usr/bin/realsense-viewer
    • If needed update the firmware using the instruction found here

Nvidia Jetson Setup

  • Follow Nvidia Jetson setup and run as user nvidia (password nvidia)
  • Check to make sure you are running L4T version 28.2.1 for use with convenience scripts
  • make sure you have cloned https://github.com/JHS-ARCC-Club/jetson_car.git to Desktop
  • Run the following scripts in this order (in scripts/jetsonhacks): installLibrealsense.sh, buildPatchedKernal.sh, installROS.sh
  • Install USB driver for some arduino nano
  • Run the /scripts/jetson.sh script to setup network
  • Setup pip and download keras and tensorflow for python
    • sudo apt-get install -y python-pip
    • pip install keras
    • sudo pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp33 tensorflow-gpu
  • The following are done in the jetson.sh script but provided here for reference
    • sudo usermod -a -G dialout $USER to give proper permissions to the USB peripherals
    • Add a udev rule for i2c-1 so that the IMU interface program can access it
      • Go to /etc/udev/rules.d
      • Add a file called 50-i2c.rules
      • Add the line ACTION=="add", KERNEL=="i2c-[0-1]*", MODE="0666" to the 50-i2c.rules file
      • See this for additional information
  • sudo apt-get install ros-kinetic-rtabmap-ros ros-kinetic-robot-localization ros-kinetic-pointcloud-to-laserscan ros-kinetic-depthimage-to-laserscan

DualShock 4 Controller Setup (Ubuntnu 16.04)

  • Connect to the controller by pressing and holding the playstation button and the share button until the light begins flashing white
  • Go into Bluetooth settings and add the controller named wireless controller
  • Test the connection by making sure the /dev/input/js0 file exits
  • Run the joy_node ROS node and echo the /joy topic to confirm data is being sent properly from the controller to the computer

DualShock 4 Controller Setup (Ubuntu MATE RPI)

Running the tests

See the travis.yaml for running install/make tests and verifying a proper build.

Built With

  • ROS - Modern robot framework for running software
  • librealsense - Intel Realsense library for D415/D435
  • Git LFS - Manage and store trained AI models
  • Travis CI - Perform build tests

Authors

  • Michael Equi - Initial work

See also the list of contributors who participated in this project.

Acknowledgments

jetson_car's People

Contributors

caelinsutch avatar michael-equi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jetson_car's Issues

velocity publisher

Take in imu acceleration and integrate (at 75Hz) to velocity. Should publish a 3D velocity vector.

robot_localization

Fuse wheel odometry and IMU odometry
Understand co-variance for better sensor fusion

ARC1 Firmware

GPS
SPI Slave com with master RPI/Jetson
I2C
UART
PWM (50Hz/20ms with 1100-1500us duty cycle)

Implement Deadmans switch

Safety switch in the /racecar/ackermann_controller node that stop the car if its orientation changes quickly (rolling), if it is upside down, or if communication from the command node falls below 5Hz

Follow Me

Fun project if anyone wants to do it

joyop

Turn the joystick data into ackermann formatted data and publish it on the proper topic

Test the racecar around Jesuits track

Check network connection, usb device integrity, realsense camera reliability, and model generalization.

Schedule 2 track times. 1 for data collection and 1 for testing the model.

Plan out and develop track

Develop a plan for laying out and organizing the track so we can begin collecting training data and testing DIY robocars race specific AI models.

We will need two tracks in order to generalize enough for a good shot at the competition. The tiles should be able to be flipped over in order to have two track options.

We need a schedule, plan, and develop a timeline to ensure the car is trained and tested before the competition on Friday

command interface

Develop the rqt_reconfigure server and the deadmans switch publisher.

  • autonomous on/off
  • training on/off
  • autonomous mode on/off
  • produce signal for dead-mans switch
  • racemode on/off

Car Touchscreen Hardware

Touchscreen

  • - Add RPI 3B+ on back
  • - Mounting Bracket - Holdable
  • - Add Battery to back
  • - Add router

Super Setup Script

Write a script that sets up the jetson TX2 from fresh flash with everything it needs. Also make one for the user interface

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.