Robotics StackExchange | Archived questions

Teleop isn't moving Gopigo2 robot

Gopigo2 Rpi2B - Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux PRETTYNAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSIONID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian

When I run teleoptwistkeyboard and try to initiate a command on my gopigo nothing happens. You can see the messages change as shown below but no change on the gopigo/ropigo. The topics are displaying on the remote PC(not ssh). Any idea what I should look at first? Thanks in advance.

ubuntu@ubuntu:~$ rostopic echo /cmd_vel
linear: 
  x: 0.0
  y: 0.0
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: 0.0
---
linear: 
  x: 0.55
  y: 0.0
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: 1.1

ubuntu@ubuntu:~/catkin_ws$ rostopic list
/battery
/cmd_vel
/lwheel
/rosout
/rosout_agg
/rwheel
/servo_cmd
/servo_state
/ultrasonic

pi@raspberrypi:~/gopigo_ws $ rosrun ropigo ropigo_node
[ INFO] [1514071469.689818951]: GoPiGo Firmware Version: 16
[ INFO] [1514071469.690366452]: GoPiGo Board Version: 14

pi@raspberrypi:~/Dexter/GoPiGo/Troubleshooting $ roswtf
No package or stack in context
================================================================================
Static checks summary:

No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /ropigo:
   * /servo_cmd


=============================
GoPiGo Troubleshooting Script
=============================

Adding permissions to the scripts
=================================

Check space left
================
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  8.0G   21G  29% /
devtmpfs        458M     0  458M   0% /dev
tmpfs           462M     0  462M   0% /dev/shm
tmpfs           462M  6.3M  456M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           462M     0  462M   0% /sys/fs/cgroup
/dev/mmcblk0p1   42M   21M   21M  51% /boot
tmpfs            93M     0   93M   0% /run/user/1000

Check for dependencies
======================
python 2.7.9-1 install ok installed
python-pip 1.5.6-5 install ok installed
git 1:2.1.4-2.1+deb8u5 install ok installed
libi2c-dev 3.1.1+svn-2 install ok installed
python-serial 2.6-1.1 install ok installed
python-rpi.gpio 0.6.3~jessie-1 install ok installed
i2c-tools 3.1.1+svn-2 install ok installed
python-smbus 3.1.1+svn-2 install ok installed
arduino 2:1.0.5+dfsg2-4 install ok installed
minicom 2.7-1+deb8u1 install ok installed
scratch 1.4.0.6~dfsg1-5 install ok installed

wiringPi Found
wiringPi Found
I2C still in blacklist (ERR)
SPI still in blacklist (ERR)


Check for addition in /modules
==============================
I2C-dev already there
i2c-bcm2708 already there
spi-dev already there


Hardware revision
=================
gpio version: 2.36
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Embest 
  * Device tree is enabled.
  *--> Raspberry Pi 2 Model B Rev 1.1
  * This Raspberry Pi supports user-level GPIO access.


Check the /dev folder
=====================
i2c-1
ttyAMA0

USB device status
=================
Bus 001 Device 004: ID 148f:7601 Ralink Technology, Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 5: Dev 4, If 0, Class=Vendor Specific Class, Driver=mt7601u, 480M

Checking for Atmega chip
========================


avrdude: Version 5.10, compiled on Jun 18 2012 at 12:38:29
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : unknown
         Using Programmer              : gpio
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : GPIO
         Description     : Use sysfs interface to bitbang GPIO lines

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 7F
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as 7F
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK

avrdude done.  Thank you.


Checking I2C bus for devices
============================

Checking I2C bus 0
==================
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory

Checking I2C bus 1
==================
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Checking for firmware version and CPU Speed and Voltage
=======================================================
v 1.6
CPU speed: 2
4.33 V


CHECKING ENCODER READINGS
0 0
Both motors moving Forward with LED On
after 5 sec 40 33
Both motors stopped with LED Off
None after stop cmd 42 34
None after 2 more sec 42 34
Both motors moving back with LED On
after 5 sec 82 69
Both motors stopped with LED Off
None after stop cmd 84 70
None after 2 more sec  84 70

CHECKING ENCODER TARGETING

Initial encoder read vals: 0 0
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
FAIL
Final encoder read vals: 47 42

Initial encoder read vals: 0 0
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
FAIL
Final encoder read vals: 49 40

Initial encoder read vals: 0 0
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
FAIL
Final encoder read vals: 49 39

Initial encoder read vals: 0 1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
FAIL
Final encoder read vals: 50 39

Initial encoder read vals: 0 0
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
Enc tgt Status:  1
FAIL
Final encoder read vals: 50 38

Asked by Noidea on 2017-12-23 19:55:29 UTC

Comments

Tip: state the problem in the title. E.g., "Teleop isn't moving Gopigo2 robot."

Asked by clyde on 2017-12-24 13:17:11 UTC

Looks like https://github.com/ros-gopigo/ros-node-ropigo/blob/master/src/ropigo.cpp has lots of DEBUG messages. You can use these to make sure that the node is receiving and responding to the message. See http://wiki.ros.org/rosconsole#Configuration for logging configuration.

Asked by clyde on 2017-12-24 13:18:57 UTC

Thanks clyde I added to my post the output from turning on a LED but the LED doesnt light.

Asked by Noidea on 2017-12-24 15:22:38 UTC

Does it work if you run teleop_twist_keyboard on the raspberry PI over SSH? If it does, it could indicate a network issue.

Asked by ahendrix on 2017-12-26 23:07:25 UTC

Hi ahendrix, I tried enabling a LED through the service directly on the robot and it says it enable and returns no errors but the LED never comes on. When I initial the cpp file with rosrun the LED's light as they should but for some reason the service is no initiating the enable command.

Asked by Noidea on 2017-12-27 13:09:56 UTC

Answers