MMR: Difference between revisions

From Rsewiki
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page holds information relevant for the Natty Bumpo robot.
This page holds information relevant for the Natty Bumpo robot.


===make video from images===


1. Convert to filenames with sequential numbers and a supported image formap (e.g. png)
===Natty Bumpo – demo instructions (full version)===


2. run ffmpeg with appropriate options
* updated august 2009 / jca
* to demonstrate sensor capabilities (no autonomous drive - sorry)


A script to do so could be:
Using TOSHIBA PC for control (boot with linux).
#! /bin/bash
let COUNTER=1000000
for f in $( ls *.bmp ); do
  echo convert $f path$COUNTER.png
  convert $f path$COUNTER.png
  let PREV=$COUNTER
  let COUNTER+=1
  done
# convert to mpeg format
# -r 25 frames per second
# -b 5000000 bitrate på 5Mbit/sec
# -y betyder overskriv destination
ffmpeg -y -r 25 -b 5000000 -i path1%06d.png path.mpeg
ls -l path.mpeg


Login as jca/******


----
Connect network cable to MMR (yellow crossed net cable)


===Natty Bumpo – demo instructions (short version)===
Set IP adress (as root)


====Assumptions:====
root$ ifconfig eth0 10.0.2.100


Near AU, i.e. Wireless network running (if not: reboot to set default gateway).
Start a console, and create 4 tabs
(name the tabs: laser, cam, mrc, client)


(old mmrd version of software - pre 2007)
'''laser''' tab
jca$ ssh demo@smr16    (the usual demo password)
demo$ cd bin
demo$ ulmsserver
'''cam''' tab
jca$ ssh demo@smr16    (the usual demo password)
demo$ cd bin
demo$ ucamserver
'''mrc''' tab
jca$ ssh demo@smr16    (the usual demo password)
demo$ mrc -t1
'''client''' tab
jca$ cd replay/mmrlive
jca$ auclient
This should show camera images and a laser scanner view - in a demonstration mode


--
If the remote control is on and set to "comp" (top-left switch "up), and NØDSTOP is down, then the laser scanner display and coordinate system will follow movement of the MMR (push MMR to demonstrate)


Using acer PC for control (boot with linux).
* try (in the client tab)
>> disp help
for display options


Acer PC is connected with twisted network cable to Natty. Natty has IP 10.0.2.116,
Acer is assumed to have IP 10.0.2.1. (IP is set on acer in /etc/rc.d/rc.inet1.conf:
IPADDR[0]=”10.0.2.1”
USE_DHCP[0]=”no”
NETMASK[0]=”255.255.255.0”.


LMSserver and gpsserver must be running – check with ps -A. If not then start manually from a ssh session (no parameters required). SMRDEMO, UCAMSERVER and MMRD should be started manually, e.g.:


ssh demo@smr16            # and password
cd /rhome/demo/bin
./smrdemo -t1              # smrdemo opens port 31001


ssh demo@smr16
----
cd bin
./ucamserver -t "path gmk" --imagepath="/mnt/ram"      # camera server opens port 24920


And the navigation server currently called mmrd
===make video from images===


ssh demo@smr16
1. Convert to filenames with sequential numbers and a supported image format (e.g. png)
cd bin
./mmrd -i /mnt/ram  # drive planner opens port 24922


--
2. run ffmpeg with appropriate options to convert it to a video (final framerate can not be below 25 fps, so same image can be repeated a number of times.


''On acer: for mission control and monitoring''
A script to do so could be:
 
  #! /bin/bash
Find the graphical control application (based on openCV):
let COUNTER=1000000
  ./uclient  # is in /usr/local/smr/bin on "nyquist" and "jensen"
for f in $( ls *ann_2.bmp ); do
 
  echo convert $f path$COUNTER.png
Connect to smr16 (session3) port 24922
  convert $f path$COUNTER.png
 
  #let PREV=$COUNTER
>> connect smr16 24922
  let COUNTER+=1
>> connected ...
  # extra repeat of same image
 
  for n in {1..2}
To watch status image (getting laser scan and other info every 1 sec).
    do
 
    convert $f path$COUNTER.png
>> push cmd=”get all”        # major variable values
    let COUNTER+=1
>> push cmd=”obstget”        # obstacles
    done
>> push cmd=”planget status” # gets current command line (etc)
  done
>> push cmd=”scanget andall” # gets the laser scan and result of path finding (etc)
for k in {1..50}; do
 
  convert $f path$COUNTER.png
Run a mission e.g. Down the hall (25 meter on the left side):
  #let PREV=$COUNTER
  >> planset goto=”fwd left 25”
  let COUNTER+=1
Set (max) speed (to 0.9 m/s) – current speed is shown on status image (top-left):
  done
  >> set speed=0.9
  # convert to mp4 format
Run a script, (look in /rhome/demo/bin/*.mmr) place MMR in hall and try
  # -r 25 frames per second
  >> planset load="doors.mmr"
  # -y betyder overskriv destination
It will drive along left side of hallway (~25m) and stop at all open doors to the right, and return.
  ffmpeg -y -r 25 -i path1%06d.png landing.mp4
 
  ls -l *.mp4
For other commands try
----
>> help
>> shelp


If vision path finding is to be used, then the following parameter must be set:
===FAQ===
>> set visPathUse=true
The vision polygon can be seen by a further push command:
>> push cmd="get visPoly"
 
----
'''FAQ'''


''Tilt of laser scanner does not work.''
====Tilt of laser scanner does not work.====


The tilt controller can enter a no-operation mode where it needs a reset to resume operation.
The tilt controller can enter a no-operation mode where it needs a reset to resume operation.

Latest revision as of 13:34, 29 November 2016

This page holds information relevant for the Natty Bumpo robot.


Natty Bumpo – demo instructions (full version)

  • updated august 2009 / jca
  • to demonstrate sensor capabilities (no autonomous drive - sorry)

Using TOSHIBA PC for control (boot with linux).

Login as jca/******

Connect network cable to MMR (yellow crossed net cable)

Set IP adress (as root)

root$ ifconfig eth0 10.0.2.100

Start a console, and create 4 tabs (name the tabs: laser, cam, mrc, client)

laser tab

jca$ ssh demo@smr16    (the usual demo password)
demo$ cd bin
demo$ ulmsserver

cam tab

jca$ ssh demo@smr16    (the usual demo password)
demo$ cd bin
demo$ ucamserver

mrc tab

jca$ ssh demo@smr16    (the usual demo password)
demo$ mrc -t1

client tab

jca$ cd replay/mmrlive
jca$ auclient

This should show camera images and a laser scanner view - in a demonstration mode

If the remote control is on and set to "comp" (top-left switch "up), and NØDSTOP is down, then the laser scanner display and coordinate system will follow movement of the MMR (push MMR to demonstrate)

  • try (in the client tab)
>> disp help

for display options




make video from images

1. Convert to filenames with sequential numbers and a supported image format (e.g. png)

2. run ffmpeg with appropriate options to convert it to a video (final framerate can not be below 25 fps, so same image can be repeated a number of times.

A script to do so could be:

#! /bin/bash
let COUNTER=1000000
for f in $( ls *ann_2.bmp ); do 
 echo convert $f path$COUNTER.png
 convert $f path$COUNTER.png
 #let PREV=$COUNTER
 let COUNTER+=1
 # extra repeat of same image
 for n in {1..2}
   do
   convert $f path$COUNTER.png
   let COUNTER+=1
   done
 done
for k in {1..50}; do
 convert $f path$COUNTER.png
 #let PREV=$COUNTER
 let COUNTER+=1
 done
# convert to mp4 format
# -r 25 frames per second
# -y betyder overskriv destination
ffmpeg -y -r 25 -i path1%06d.png landing.mp4
ls -l *.mp4

FAQ

Tilt of laser scanner does not work.

The tilt controller can enter a no-operation mode where it needs a reset to resume operation. Reset can be done through the 'smrd' interface or by hardware action:

Hardware reset of laser scanner tilt controller:

Open plastic box behind the laser scanner (4 screws). The PCB closest to the laser scanner is the tilt controller board. The 2-wire (thick gray and orange wires) is the 24 volt supply, unplug this and reinsert. The tilt function should then find the lower extreme and reset to horizontal position.

If the tilt has passed one of the end-switches, the above reset might fail. In this case disconnect the two wires to the motor (red and black (red closest to scanner)) - screwed to the end of the controller board - and connect an external power supply (+/- 2 to 5 volt) to turn the tilt to a normal angle, then try the reset procedure again.

NB! Do not try to turn the laser scanner by hand - it will damage the axle.

Module will not load -- symbol not found

If the server is not compiled with the same library as the module, there may be "symbol not found" errors. The solution is to recompile their server with the same library as the modules (or vise versa).


Robot documentation

Documentation by Malte and Anders is on kalman:/vhome/ ... ?

hardware

1.2 GHz Via C2 processor with 512 MByte RAM.


Serial IO

The following devices are used:

/dev/ttyUSB0  // Laser scanner using USB/serial device
/dev/ttyS4    // symbolic link for old laser scanner server
/dev/ttyUSB1  // gps receiver
/dev/ttyACM0  // Small laser scanner (URG)
/dev/ttyS1    // used by smrd for RS485 interface

With kernel version 2.6.17, these are not the devices created by UDEV, they are now all in /dev/tts/*.

The com1 and com2 ports are swapped relative to ordinary SMRs, to correct for this the devices in the mmr are cross-linked in /etc/rc.d/rc.local as follows:

rm /dev/ttyS0
rm /dev/ttyS1
ln -s /dev/tts/1 /dev/ttyS0
ln -s /dev/tts/0 /dev/ttyS1

Further the devices /dev/tts/USB0 and /dev/tts/USB1 may be swapped after a reboot, to solve for this issue the devices are mapped to /dev/ttyUSB0 for gps and /dev/ttyUSB1 for SICK This is done in /etc/rc.d/rc.local using:

 if udevinfo -a -p /class/tty/ttyUSB0 | grep 'DRIVER=="pl2303"'; then
   echo USB0 is GPS, USB1 is SICK
   # direct ttyUSB0 to tts/USB0 as it is the gps connection
   ln -s /dev/tts/USB0 /dev/ttyUSB0
   # direct ttyS4 to tts/USB1 as it is the SICK laserscanner
   ln -s /dev/tts/USB1 /dev/ttyS4
   ln -s /dev/tts/USB1 /dev/ttyUSB1
 else
   echo USB0 is SICK, USB1 is GPS
   # direct ttyUSB0 to tts/USB1 as it is the gps connection
   ln -s /dev/tts/USB1 /dev/ttyUSB0
   # direct ttyS4 and ttyUSB1 to tts/USB0 as it is the SICK laserscanner
   ln -s /dev/tts/USB0 /dev/ttyS4
   ln -s /dev/tts/USB0 /dev/ttyUSB1
 fi



RAM disk

A RAM disk is mounted at

/mnt/ram

with write access for all. Remember all content are lost after a reboot. The RAM-disk takes RAM as needed up to a maximum of 300 MByte.

The ram disk size is defined in with the other disk definitions

/etc/fstab

with the line

tmpfs /mnt/ram tmpfs size=300m 0 0

The ram-disk is intended for temporary data (logging), that can be used in areas, where no network connection is available or as a fast logging device. These data can then later be copied to a more permanent place - if needed.


Flash disk

An user area is created on the flash disk for more permanent files at

/rhome

Please make a home directory using your initials or project number. e.g. like:

/rhome/ex39

There is limited space on the flash disk - p.t. approx 150 MByte. (Check disk space with the 'df' command).