Page 1 of 1

Bad callback error after running getting started oneliner

Posted: Mon Dec 12, 2016 2:47 pm
by bartvandenberg
Hi,

First a short intro.
We are working on getting the Crazyflie to be part of science museum exhibition. Our goal is to learn kids about autonomous flight. Crazyflie and the LPS look like a great platform to do this! We're currently working on setting up our systems like described in the Getting Started https://wiki.bitcraze.io/doc:lps:index.

After following all the steps we are running into a problem with the example program. The script reports the following error:

Code: Select all

[ERROR] [1481552448.544456]: bad callback: <function callback_pos at 0xb71b1844>
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback
    cb(msg)
  File "/home/exhibit/flying-robots/src/lps-ros/scripts/lps_ekf_bridge.py", line 26, in callback_pos
    ps.pose.position.x = data.values[0]
IndexError: tuple index out of range
We're currently stuck at this point so it would be great if someone could provide feedback about what might be wrong.

Here's also the complete output. Thanks!

Code: Select all

started roslaunch server http://flying-robots:34294/

SUMMARY
========

PARAMETERS
 * /crazyflie/anchor0_pos: [0, 0, 1.85]
 * /crazyflie/anchor1_pos: [0, 2, 1.85]
 * /crazyflie/anchor2_pos: [4, 2, 1.85]
 * /crazyflie/anchor3_pos: [4, 0, 1.85]
 * /crazyflie/anchor4_pos: [1.3, 1, 1.85]
 * /crazyflie/anchor5_pos: [2.6, 1, 1.85]
 * /crazyflie/crazyflie_add/genericLogTopicFrequencies: [30, 30, 30]
 * /crazyflie/crazyflie_add/genericLogTopic_log_kfpos_Variables: ['kalman.stateX',...
 * /crazyflie/crazyflie_add/genericLogTopic_log_kfqt_Variables: ['kalman.q0', 'ka...
 * /crazyflie/crazyflie_add/genericLogTopic_log_ranges_Variables: ['ranging.distanc...
 * /crazyflie/crazyflie_add/genericLogTopics: ['log_kfpos', 'lo...
 * /crazyflie/crazyflie_add/tf_prefix: crazyflie
 * /crazyflie/crazyflie_add/uri: radio://0/80/250K
 * /crazyflie/joy/dev: /dev/input/js0
 * /crazyflie/joystick_controller/use_crazyflie_controller: True
 * /crazyflie/n_anchors: 6
 * /crazyflie/pose/name: goal
 * /crazyflie/pose/rate: 30
 * /crazyflie/pose/x: 3
 * /crazyflie/pose/y: 2.3
 * /crazyflie/pose/z: 1.0
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.6

NODES
  /crazyflie/
    controller_bridge (bitcraze_lps_estimator/crazyflie_controller_bridge.py)
    crazyflie_add (crazyflie_driver/crazyflie_add)
    joy (joy/joy_node)
    joystick_controller (crazyflie_demo/controller.py)
    lps_efk_bridge (bitcraze_lps_estimator/lps_ekf_bridge.py)
    lps_viz (bitcraze_lps_estimator/lps_viz.py)
    pose (crazyflie_demo/publish_pose_teleop.py)
  /
    crazyflie_server (crazyflie_driver/crazyflie_server)
    link1_broadcaster (tf/static_transform_publisher)
    log_range (bitcraze_lps_estimator/log_range.py)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [21732]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 26e57bfe-c076-11e6-99d5-d12836f2e9f7
process[rosout-1]: started with pid [21745]
started core service [/rosout]
process[log_range-2]: started with pid [21762]
process[rviz-3]: started with pid [21763]
process[crazyflie/crazyflie_add-4]: started with pid [21764]
process[crazyflie/joy-5]: started with pid [21770]
process[crazyflie/joystick_controller-6]: started with pid [21784]
process[crazyflie/controller_bridge-7]: started with pid [21790]
process[crazyflie/pose-8]: started with pid [21800]
[ INFO] [1481552442.118562557]: wait_for_service /add_crazyflie
[ INFO] [1481552442.132930450]: waitForService: Service [/add_crazyflie] has not been advertised, waiting...
process[crazyflie/lps_efk_bridge-9]: started with pid [21809]
[ INFO] [1481552442.236465399]: Opened joystick: /dev/input/js0. deadzone_: 0.050000.
/home/exhibit/flying-robots/src/crazyflie_ros/crazyflie_demo/scripts/publish_pose_teleop.py:46: SyntaxWarning: name 'lastData' is assigned to before global declaration
  global lastData
process[crazyflie/lps_viz-10]: started with pid [21814]
process[link1_broadcaster-11]: started with pid [21820]
process[crazyflie_server-12]: started with pid [21826]
[ INFO] [1481552442.911800857]: waitForService: Service [/add_crazyflie] is now available.
[ INFO] [1481552442.912696257]: found /add_crazyflie
[ INFO] [1481552443.104970057]: Adding radio://0/80/250K as crazyflie with trim(0.000000, 0.000000). Logging: 1, Parameters: 1, Use ROS time: 1
Configured Dongle with version 0.53
SYS: -------------------------
---

SYS: Crazyflie 2.0 is up and r
unning!

[crazyflie/crazyflie_add-4] process has finished cleanly
log file: /home/exhibit/.ros/log/26e57bfe-c076-11e6-99d5-d12836f2e9f7/crazyflie-crazyflie_add-4*.log
SYS: Build 204:740ac14535a5 (2
016.09-204) CLEAN

SYS: I am 0x353534303335510520
0039 and I have 1024KB of flas
h!

CFGBLK: v1, verification [OK]

MPU9250 I2C connection [OK].

AK8963 I2C connection [OK].

LPS25H I2C connection [OK].

DECK_DRIVERS: Found 9 drivers

DECK_INFO: Found 1 deck memory
.

DECK_CORE: 1 deck enumerated

EEPROM: I2C connection [OK].

AK8963: Self test [OK].

DECK_CORE: Deck 0 test [OK].

SYS: Free heap: 8032 bytes

[ INFO] [1481552445.015707577]: Requesting parameters...
Params: 110
[ INFO] [1481552447.279784173]: Requesting Logging variables...
[INFO] [1481552447.296800]: Setting anchor position ...
Log: 133
[INFO] [1481552447.319231]: Anchor 0 at [0, 0, 1.85]
[ INFO] [1481552447.383688263]: Update parameters
[INFO] [1481552447.477345]: Anchor 1 at [0, 2, 1.85]
[INFO] [1481552447.490778]: found update_params service
[INFO] [1481552447.494877]: waiting for emergency service
[INFO] [1481552447.516475]: found emergency service
[INFO] [1481552447.519841]: waiting for land service
[INFO] [1481552447.546845]: found land service
[ INFO] [1481552447.549206478]: Update parameters
[INFO] [1481552447.550790]: waiting for takeoff service
[INFO] [1481552447.565539]: found takeoff service
[INFO] [1481552447.685572]: Anchor 2 at [4, 2, 1.85]
[ INFO] [1481552447.743504158]: Update parameters
[INFO] [1481552447.817956]: Anchor 3 at [4, 0, 1.85]
[ INFO] [1481552447.871598852]: Update parameters
[INFO] [1481552447.972638]: Anchor 4 at [1.3, 1, 1.85]
[ INFO] [1481552448.037353231]: Update parameters
[INFO] [1481552448.160802]: Anchor 5 at [2.6, 1, 1.85]
[ INFO] [1481552448.228696135]: Update parameters
Could not find kalman.stateX in log toc!
Could not find kalman.stateY in log toc!
Could not find kalman.stateZ in log toc!
[ INFO] [1481552448.432797317]: Update parameters
Could not find kalman.q0 in log toc!
Could not find kalman.q1 in log toc!
Could not find kalman.q2 in log toc!
Could not find kalman.q3 in log toc!
[ERROR] [1481552448.544456]: bad callback: <function callback_pos at 0xb71b1844>
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback
    cb(msg)
  File "/home/exhibit/flying-robots/src/lps-ros/scripts/lps_ekf_bridge.py", line 26, in callback_pos
    ps.pose.position.x = data.values[0]
IndexError: tuple index out of range


Re: Bad callback error after running getting started oneliner

Posted: Mon Dec 12, 2016 3:00 pm
by tobias
Hi!

Sounds like a lot of fun and we would love to hear more about the outcome.

My first thought is did you update the firmware as described in this step?

Re: Bad callback error after running getting started oneliner

Posted: Mon Dec 12, 2016 4:33 pm
by bartvandenberg
Hi Tobias,

Thanks, that solved it. Did this the first time, but then needed to download the the firmware again and forgot this step. Coms are up now and no more errors :)

Is it correct that the Drone does not launch when the node positions are not set up yet? I have created the yaml file and I see the crazyflie moving in RViz. I tried a test launch with the X-button (when holding the drone) but nothing is happing yet. Or am I having an issue with the 360 controller?

Thanks, Bart

Re: Bad callback error after running getting started oneliner

Posted: Tue Dec 13, 2016 10:20 am
by arnaud
Hi Bart,

Do you have more than 1 joystick on your computer, I have seen sometime that laptop exposes the harddrive-protection accelerometer as a joystick.See this post: viewtopic.php?f=6&t=2212&p=11260&hilit= ... hot#p11260

/Arnaud

Re: Bad callback error after running getting started oneliner

Posted: Tue Dec 13, 2016 12:47 pm
by bartvandenberg
Thanks Arnaud,

After running cfclient I discovered that I actually have the XBOX One controller connected. This might very well be the problem... Will try again tomorrow with a 360 controller.
Screenshot from 2016-12-13 13-44-07.png

Re: Bad callback error after running getting started oneliner

Posted: Tue Dec 13, 2016 1:18 pm
by bartvandenberg
Okay, got it running with the 360 controller. Cool. Next step: putting the nodes in place.