Page 2 of 3

Re: Address configure error

Posted: Wed Oct 19, 2016 11:56 pm
by whoenig
Can you try

Code: Select all

roslaunch crazyflie_demo teleop_ps3.launch uri:=radio://0/20/2M/0xE7E7E7E701
?
Internally, std::sscanf is used for parsing, so perhaps the behavior of that is not well defined. Which OS (version)/compiler are you using?

Re: Address configure error

Posted: Thu Oct 20, 2016 7:48 am
by ryanwallis
Hi Whoenig,

Unfortunately that command did not work either, no data is being sent.

OS:
Ubuntu 14.04.3 LTS
and compilers:
The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /tmp/catkin_test/devel
-- Using CMAKE_PREFIX_PATH: /home/jan/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/jan/catkin_ws/devel;/opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /tmp/catkin_test/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.14
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/catkin_test/build

Re: Address configure error

Posted: Thu Oct 20, 2016 8:07 am
by ryanwallis
It could still be the decoding because with:
success = std::sscanf(link_uri.c_str(), "radio://%d/%d/%d%c/%lx",...
The address becomes:
Radio Address:: 4294967295

But when it is:
success = std::sscanf(link_uri.c_str(), "radio://%d/%d/%d%c/%llx",...
print I added to crazyflie.cpp
Succes :: 1 LenSS :: 5 Vals: 0 20 2 M 996028180225
Which corresponds to:
cfclient:
INFO:cflib.crazyflie.mem:{'radio_channel': 20, 'version': 1, 'pitch_trim': 0.0, 'radio_speed': 2, 'roll_trim': 0.0, 'radio_address': 996028180225}
Though there is still no connection.

Re: Address configure error

Posted: Thu Oct 20, 2016 8:51 am
by ryanwallis
Found it... This computer was missing libusb-dbg!

Thanks for all your help guys, will try everything out and report back if I still get problems


Some other niche problems I encountered:

Changing to:
success = std::sscanf(link_uri.c_str(), "radio://%d/%d/%d%c/%llx",
in Crazyflie.cpp

And also, ROS will not connect to crazyflies if they are not power cycled after being connected to the python client (cfclient)

Re: Address configure error

Posted: Thu Oct 20, 2016 9:02 am
by arnaud
Strange problem bug glad that you found a solution.

About power cycling, is it happening all the time or only when changing settings? When changing radio settings the Crazyflie must be power-cycled to use the new settings.

Re: Address configure error

Posted: Thu Oct 20, 2016 9:05 am
by ryanwallis
No, all the time, no idea as to why

Re: Address configure error

Posted: Thu Oct 20, 2016 9:14 pm
by whoenig
There is no connection state in crazyflie_ros. What you might be seeing is that it tries to configure something, but never gets the expected message back. What you describe, could be related to https://github.com/whoenig/crazyflie_ros/issues/29, that is the cfclient configures some log blocks, the crazyflie_ros stack tries the same and currently there is no proper handling for this case. In principle, this should not happen since crazyflie_ros tries to delete all log blocks once it connects, but this might fail in your case for some other reason.

You can try the requestBatching branch of crazyflie_ros, which has proper timeout handling and some other improvements to see if that fixes your issue.

Re: Address configure error

Posted: Fri Oct 21, 2016 8:08 am
by ryanwallis
Hey Whoenig, thanks for the suggestion.

I tried running:
roslaunch crazyflie_demo teleop_ps3.launch uri:=radio://0/20/2M/E7E7E7E701
But I received an error running the server, when using the requestBranch:
process[rqt_plot3-9]: started with pid [14403]
terminate called after throwing an instance of 'std::runtime_error'
what(): timeout
[INFO] [WallTime: 1477037924.979081] found update_params service
[INFO] [WallTime: 1477037924.979316] waiting for emergency service
[INFO] [WallTime: 1477037924.980327] found emergency service
[crazyflie_server-2] process has died [pid 14280, exit code -6, cmd /home/jan/catkin_ws/devel/lib/crazyflie_driver/crazyflie_server __name:=crazyflie_server __log:=/home/jan/.ros/log/fb116282-9766-11e6-b95c-18a90517f873/crazyflie_server-2.log].
log file: /home/jan/.ros/log/fb116282-9766-11e6-b95c-18a90517f873/crazyflie_server-2*.log

Re: Address configure error

Posted: Fri Oct 21, 2016 4:58 pm
by whoenig
If that always happens, it is most likely related to your original problem of %llx vs. %lx in the scanf function. The error indicates that there was a timeout, i.e. the copter didn't respond within a given timeframe. Unfortunately, the error message is still generic and doesn't tell us where it is coming from exactly.

Re: Address configure error

Posted: Sat Oct 22, 2016 11:16 am
by ryanwallis
Hey Whoenig, you were right, it was the scanf function.

However, I am getting an error running the server
check_vrpn_cookie(): VRPN Note: minor version number doesn't match: (prefer 'vrpn: ver. 07.33', got 'vrpn: ver. 07.20 0'). This is not normally a problem.
[ INFO] [1477135386.922091971]: Connection established
[crazyflie_server-2] process has died [pid 7136, exit code -6, cmd /home/jan/catkin_ws/devel/lib/crazyflie_driver/crazyflie_server __name:=crazyflie_server __log:=/home/jan/.ros/log/e662a0ba-9849-11e6-b9ff-18a90517f873/crazyflie_server-2.log].
log file: /home/jan/.ros/log/e662a0ba-9849-11e6-b9ff-18a90517f873/crazyflie_server-2*.log
[crazyflie2/crazyflie_add-10] process has finished cleanly
Also,

I have been getting a low-signal warning when using multiple radios.
Additionally, flying 3 crazyflies (2 off the one radio), the crazyflies have a high oscillation in only their Z-axis (I'm talking about to .3-.5m oscillation).
I am using a powered USB-Hub and have also tried a USB-USB extender to try and avoid interference.
I have a 3D printed body on the crazyflie2s to hold motion-tracking markers, so there is some extra weight, however flying solo seems to be decently stable.
Any suggestions?