Git Product home page Git Product logo

can_to_ros's Introduction

can_to_ros

can_to_ros is a ROS package that provide a real-time and offline decoding of CAN bus messages. It is also integrated with libpanda to send control commands to Toyota RAV4.

Software Requirements and Dependencies


  • Ubuntu 18.04/20.04 AMD64 or Ubuntu18.04/20.04 ARM
  • ROS melodic or ROS noetic
  • libpanda (must be installed in /opt directory)

Launch File Descriptions:

vehicle_control.launch

This is automatically installed in robot_upstart with libpanda's scripts/installCanToRos.sh script

Invokes the following:

  1. vehicle_interface - Main interface for libpanda's ToyotHandler for vehicle control
  2. publishCommands - Maintains a regular 100Hz publish rate from /cmd_accel_safe to /car/cruise/accel_input
  3. node_status.py - Regulary publishes a 0 to /cmd_accel to maintain libpanda's command heartbeat if other commands are not sent
  4. launch/safety_checks.launch
    • cut_in_disengager - Ensures that cars cutting in ahead do no coincide with large deceleration commands by disengaging the cruise controller.
    • cruise_start_safety_check - Ensures that acceleration commands start within safe bounds and that a lead vehicle is seen on engage requests (otherwise a disengage is invoked)
  1. topic_check.py - Checks publish rate of /car/libpanda/controls_allowed to dispaly status on Blinkt kit

Expected interface topics:

/cmd_accel - std_msgs/Float64 - This is where control commands should be sent. cut_in_disengager will ensure convert this to /cmd_accel_safe as needed, then publishCommands will convert /cmd_accel_safe to /car/cruise/accel_input /realtime_raw_data - std_msgs/String - Reports CAN data. Use the node subs_fs.cpp to interpret these into car sensing data

Node Descriptions:

vehicle_interface.cpp

This ROS node interfaces libpanda's ToyotaHandler

Publishers:

  1. /realtime_raw_data - std_msgs/String - This publishes CAN data of interest where the can_to_ros node named subs_fs.cpp can interpret values
  2. /car/panda/gas_interceptor_detected - std_msgs/Bool - Reported by the Panda is their gas interceptor hardware is detected
  3. /car/panda/controls_allowed - std_msgs/Bool - Reported by the comma.ai panda. This is not event-based from the Panda, but is regularly checked at 2 Hz to reset the Panda's heartbeat
  4. /car/libpanda/controls_allowed - std_msgs/Bool - Reported by logic within libpanda. This is event based from libpanda using CAN messages. When no events occur, this regularly published at 1 Hz which can be used to assess libpanda's control command health

Subscribers:

  1. /car/cruise/accel_input - std_msgs/Float64 - This is for acceleration commands to be sent to the car's cruise controller (priorly known as /commands)
  2. /car/hud/mini_car_enable - std_msgs/Bool - When true, this will display a mini-vehicle on the car's HUD which cruise control is on and engaged
  3. /car/hud/cruise_cancel_request - std_msgs/Bool - When true published, the cruise controller will disengage and notify the driver with an audible chime

Installation


1.Create a ROS Workspace

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/
$ catkin_make

2.Clone the repo.

$ cd ~/catkin_ws/src/
$ git clone https://github.com/jmscslgroup/can_to_ros.git

Note: make sure to install libpanda before running catkin_make.

3.Build the WS

$ cd ~/catkin_ws
$ catkin_make

4.Source your enviroment:

$source ~/catkin_ws/devel/setup.bash

Tests:


The following tests were performed on a Toyota RAV4

1-Sending Acceleration Commands to RAV4

We created a set of slides (Step Input Commands Test) that have the steps needed to send acceleration commands to a Toyota RAV4.

2-Runnig Cruise Control Test

The goad of this test is to replicate the cruise control functionality with a PID controller. Steps to run the test are here.

can_to_ros's People

Contributors

ahayat16 avatar alexosadventurervandy avatar blegas78 avatar georgegunter avatar kjang96 avatar matthewnice avatar rahulbhadani avatar safwanelmadani avatar sprinkjm avatar

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.