Skip to content

Git repo for remake of the PermoCar. This is V3. Developing takes place during course D7039E and E7032E.

Notifications You must be signed in to change notification settings

Trobolit/PermoCar

Repository files navigation

PermoCar

Git repo for remake of the PermoCar. This is V3. Developing takes place during course D7039E and E7032E.

Node/code statuses

  • PC nodes
  • Rpi nodes
  • Arduino code
  • Other code/programs

PC nodes

Node Who? Status Comment
control_panel Oscar (Oscarsandstrom) Finished Up and running
PadPub (joy) Samuel (grammers) done up and running
permocar_scream (receiver on pc) launched whith script, not ros not needed?
referens_node Samuel up and running
RVis (lidar plot) Samuel Working and launchin with seetings

Rpi nodes

Node Who? Status Comment
coll_detect Oscar (Oscarsandstrom) working testing ongoing
encodercomm Robert (Trobolit) working needs testing and review
engine_mgmt Samuel (collaborative) running but not finished waiting for additional inputs
kalmanfilter (for v, w and troques) Olov Samuel not tuned not usable until better model parameters are aquired
gyro_node no hardware, no code, just an idea skiped for time constraint
LMS1xx (lidar node) Robert Running
motorcomm Robert (Trobolit) working Finalize comments etc
nmea_navsat_driver N/A Finished
relaycomm Robert, Samuel Working
permocar_scream (sender on Rpi) launched whith script, not ros
settings Samuel (grammers) working No contol panel to test against
step_responses Robert (Trobolit) working might never need to finish
vw_generator Robert (Trobolit) Working

Arduino Code

Node Who? Status Comment
encoder_listener Robert (Trobolit) working Working
motor_driver Robert (Trobolit) working, serious bug found fix for bug already implemented in relay_setter
relay_setter Robert (Trobolit) working

Hardware ports for arduinos

  • /dev/ttyACM0 - relaycomm
  • /dev/ttyACM1 - motordriver
  • /dev/ttyACM2 - encodercomm
  • /dev/ttyUSB0 - nmea_navsat_driver (gps)

Other code/programs

Node Who? Status Comment
catkin_simple Ready to use Build tool
lauch_permocar Oscar/Rasmus? working
launch_teleop Oscar/Rasmus? working
rviz ready to use might need config for gps
Simulation Repo Olov Sehlin Fully functional, probable parameter mismatches Includes all simulink files for simulating the permocar

Currently included git repos in launch files

Remember that there are scripts in this repo that automatically sets environment correctly and then calls the launch files.

on PC/controller

To update code/nodes on pc just run the UpdatePC.sh in this repo. It will autmatically update your catkin_ws in your home folder.

  • joy: Code that polls gamepad (ROS node).
  • control_panel: Code that creates a window with information of the data or topics during runtime. The control panel requires pygame to function, use sudo apt-get install python-pygame to install pygame.

on pi

To update code/nodes on pc just run the UpdatePi.sh in this repo. It will autmatically update your catkin_ws in your home folder.

  • motorcomm: Code (ROS node) that communicates with the arduino that drives the motors.
  • engine_mgmt: Code (ROS node) that manages motor power (subscribes to controller input, encoder data, etc., and uses that in control loops)
  • LMS1xx: lidar node
  • coll_detect: Code (ROS node) that subscribes to the lidar node and checks the ranges array to detect incoming collisions and then publishes a boolean telling other subcribers if it's about to collide.
  • encodercomm: Code that talks serially with the encoder arduino, extracts the data an publishes velocities of the wheels.

Nodes to be added in launch file

Code not yet in node format

  • permocar_scream: The code for the vision system is yet not integrated into ROS. It does run paralell with ROS and works.

Automatic Install instructions

Set up workspace

Create a catkin workspace where all the packages will be, together with the source folder.

Example:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
catkin config --extend /opt/ros/kinetic

Or one-liner:

cd ~/catkin_ws
catkin config --mkdirs --extend /opt/ros/kinetic --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Release

Download and build all relevant nodes

  • clone this repo: git clone https://github.com/Trobolit/PermoCar.git
  • cd PermoCar
  • run the updatefile that you want, e.g. ./UpdatePC.sh

If you update any source code just run catkin build and done!

Manual Install instructions (discouraged)

wstool with permo_car_X.rosinstall will clone all needed nodes for you.

  • permo_car_pc.rosinstall is for the nodes needed on the user PC.
  • permo_car_rpi.rosInstall is for the nodes needed on the rasbery pi.

First step

Create a catkin workspace where all the packages will be, together with the source folder.

Example:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
catkin config --extend /opt/ros/kinetic

Or one-liner:

cd ~/catkin_ws
catkin config --mkdirs --extend /opt/ros/kinetic --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Release

Populate src folder using wstool

Go to the catkin workspace:

cd ~/catkin_ws

Populate the src folder:

wstool init src permo_car_X.rosinstall

Updating (pulling latest changes)

To update or pull the latest changes run:

wstool update -t src

Finalizing

Now you can build the workspace as normally using catkin build.

Note: If the command catkin build cannot be found you might be missing python-catkin-tools. Use sudo apt-get install python-catkin-tools.

Install file

Format in the .rosinstall file shud be - git: {local-name: NOOD_NAME, uri: 'URL', version: BRANCH}

Run

To run the permocar use one of the launch scripts. To start the entire system use masterStart.sh (run it on the PC). It is important that you start the permocar part of the system first. To start permocar and PC seperat use startWscream.sh and startWscreamTeleop.sh. To start whiteout SCReAM use startPermoCar.sh and startTeleop.sh. If you not connected throe the WPN server can you use vierdStart.sh and vierTele.sh, but check that the IP are correct.

Notes

SICK LMS111 help scripts

Since the LIDAR may end up in wierd edge cases and the ROS node used might (not verified) put it in a bad state, that cannot be adjusted, some python scripts have been made to simplify the factory reset, network setup, and testing of it. The scripts are pretty self explainatory and can be found here: LMS111_helpScripts

Dialout group (serial permissions)

For ros nodes to be able to communicate over serial ports without modifying file permissions on boot the ros user needs to be in the dialout group. To add a user:

sudo adduser [username] dialout

For one time tests you can also run:

sudo chmod 666 /dev/tty[portname]

Bash scripts for startups

Remember to have set up ssh-keys for passwordless entry, otherwise these scripts might fail. See this link for instructions: http://owncld.duckdns.org/myDoc/Ericsson/screamSetup.html#setting-up-ssh-keys

Running ROS over VPN

Since ROS default is resolving ips through dhcp/dns server and the current VPN server does not have it, one needs to: on pi:

export ROS_IP=10.9.0.3

And on Laptop run

export ROS_IP=10.9.0.2

before starting nodes that need to communicate over the VPN link.

Printing to file for serial comm with Arduino

If you cant set serial link setup properly in the program you may need to run this command on the Pi before running the relayer.

stty -F /dev/ttyACM0 sane raw pass8 -echo -hupcl clocal 57600

Uploading .ino files to Arduino from RPI via terminal

There are two arduinos connected, one that is essentially an Uno that drives the motors and one that is arm-based and manages the encoders.

To upload code to the motor-driver the following suffices:

 .[path to arduino binary]/arduino --upload [path to .ino sketch]/OldArduinoDriver.ino  --port /dev/ttyACM0

To upload to the other additional flags might be needed.

Notes from Korken

  • use catkin_simple
  • use catkin build, not catkin make.
  • Dont use rosserial on arduino, make your own bridge instead.
  • Use Ros install files.
  • https://github.com/LTU-CEG
  • On RPI build for release since we are limited on speed.
  • Use one git repo per ROS-node.

About

Git repo for remake of the PermoCar. This is V3. Developing takes place during course D7039E and E7032E.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages