[Video] Alternative Kinect Control (using depth images)

Firmware/software/electronics/mechanics
Patrik
Beginner
Posts: 20
Joined: Wed Apr 09, 2014 2:43 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by Patrik »

Thanks!

I'll have a look at the firmware in the morning :)

Patrik
tom
Beginner
Posts: 1
Joined: Wed Apr 16, 2014 11:29 am

Re: [Video] Alternative Kinect Control (using depth images)

Post by tom »

Hi Patrik,

I tried to run Oliver's code too. However, I faced a problem on "roslaunch crazyflieROS pid.launch js:=0". It failed with following error:

Code: Select all

process[CrazyFlieJoystickDriver-2]: started with pid [11088]
Traceback (most recent call last):
  File "/home/tom/ros/crazyflieROS/bin/joy_driver_pid.py", line 9, in <module>
    from duplicity.file_naming import new_sig_re
ImportError: No module named duplicity.file_naming
[CrazyFlieJoystickDriver-2] process has died [pid 11088, exit code 1, cmd /home/tom/ros/crazyflieROS/bin/joy_driver_pid.py __name:=CrazyFlieJoystickDriver __log:=/home/tom/.ros/log/21bdf5e8-c551-11e3-81cb-b8ca3a9fbe8b/CrazyFlieJoystickDriver-2.log].
log file: /home/tom/.ros/log/21bdf5e8-c551-11e3-81cb-b8ca3a9fbe8b/CrazyFlieJoystickDriver-2*.log
respawning...
Did you have a similar problem before?

Regards,
Tom
Patrik
Beginner
Posts: 20
Joined: Wed Apr 09, 2014 2:43 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by Patrik »

Yes! I updated the code and the firmware and its working :)

Image

Now it's just the kinect part..

Hi Tom!

I did get i similar import error before i ran rosmake on the crazyflieROS package. Not the same though.. I assume you changed "js:=0" to "js:=2" or something similar.

It's not much help but I'm a beginner as well so please bear with me :)

Patrik
lkachun9129
Beginner
Posts: 1
Joined: Wed Mar 05, 2014 4:20 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by lkachun9129 »

Hi Patrik,

Thanks for the update. I am a colleague of Tom :)

The problem we are facing is that joy_driver_pid.py failed to import some files.

Here is the latest error:

Code: Select all

process[CrazyFlieJoystickDriver-3]: started with pid [1371]
Traceback (most recent call last):
  File "/home/tom/ros/crazyflieROS/bin/joy_driver_pid.py", line 9, in <module>
    from crazyflieROS.msg import cmd as CFJoyMSG
ImportError: No module named msg


can you show us your $PYTHONPATH value? we are not sure whether we got the correct env value....
besides, is there any file listed under ~/catkin_ws/devel/lib? we got nothing there...

Regards,
Ronald
Patrik
Beginner
Posts: 20
Joined: Wed Apr 09, 2014 2:43 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by Patrik »

Hi Ronald!

My $PYTHONPATH refers to /opt/ros/hydro/lib/python2.7/dist-packages

I don't think I have the other directory you're speaking of..

But I did get the same error before i ran "rosmake crazyflieROS" I believe. If you can't run rosmake you might have downloaded the wrong git branch. Another thing to check is if you have set all the permissions correct.

Patrik
omwdunkley
Expert
Posts: 162
Joined: Thu Jun 06, 2013 9:56 pm
Location: Munich

Re: [Video] Alternative Kinect Control (using depth images)

Post by omwdunkley »

Hi Tom, Patrik, Ronald,

sorry Im extremely short on time these days!
Patrik - glad the firmware/client part works at least :)) How is it working on the Kinect end of things?
Ronald, Tom - any luck on that error? Ive actually never seen that one before; not sure what it could refer to. It seems be calling a function

Code: Select all

from duplicity.file_naming import new_sig_re
which isnt there. Maybe

Code: Select all

sudo apt-get install duplicity
could help? No idea what it is, but maybe its something that ROS needs internally. Ive never had to manually install that package before, so maybe something went wrong when installing ROS? Not sure, just thinking out loud here!

Patrik wrote:Hi Ronald!

My $PYTHONPATH refers to /opt/ros/hydro/lib/python2.7/dist-packages

I don't think I have the other directory you're speaking of..

But I did get the same error before i ran "rosmake crazyflieROS" I believe. If you can't run rosmake you might have downloaded the wrong git branch. Another thing to check is if you have set all the permissions correct.

Patrik
Patrik
Beginner
Posts: 20
Joined: Wed Apr 09, 2014 2:43 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by Patrik »

Hi Guys!

We've been on easter break the last weeks, but now we're back! At the moment we are looking to implement openCV using a Asus xtion pro to track our flie. But first we wanted to try the kinect just to get things started. We got the same error as Tom when we ran joy_driver_pid.py but installing duplicity solved that. So now we're following the directions for using the kinect in Olivers readme file (in the master branch, as the readme in the other branch isn't updated).

The problem we're having now seems to be compablity problems. Running "rosrun rviz rviz -d kinect.vcg" we get the following error:

Code: Select all

ERROR: the config file 'kinect.vcg' is a .vcg file, which is the old rviz config format.
       New config files have a .rviz extension and use YAML formatting.  The format changed
       between Fuerte and Groovy.  There is not (yet) an automated conversion program.
This was solved by changing the command to "rosrun rviz rviz -d kinect.rviz" but we still don't get any picture. In Rviz we get "Global Status: Error", "Fixed Frame [map] does not exist".

We also get the following error when launching "roslaunch crazyflieROS pid.launch js:=2".

Code: Select all

[WARN] [WallTime: 1399300054.172483] Could not look up cf_gt2d -> goal
Any thoughts? :)

Patrik
omwdunkley
Expert
Posts: 162
Joined: Thu Jun 06, 2013 9:56 pm
Location: Munich

Re: [Video] Alternative Kinect Control (using depth images)

Post by omwdunkley »

Hi Patrik,

actually that all sounds pretty good :)

The readme is really just a first draft, Im sure there is plenty missing. Use it with a grain of salt!

Code: Select all

rosrun rviz rviz -d kinect.vcg"
is indeed the correct commands, I only recently added the kinect.vcg file. Ill update the readme, thanks for point that out!

Lauching rviz like that should actually set the Fixed Frame to "world". If it doesnt, you can set it manually with the drop-down in the Global Options | Fixed Frame setting.

Next step is to make the TF tree is set up correctly. Easiest way to debug this is to look at the TF | tree setting in RVIZ.

You will need the following transforms:
world -> camera_link (this positions the kinect in the world frame. Once this is set, you should be able to see point clouds in rviz. Make sure there is a Pointcloud2 visualization set in rviz (if not press add and chose pointcloud2). Also make sure the topic is set correctly (/camera/depth_registered/points) and double check that the kinect node is in depth_registered mode (see the readme). I set the transform using this command:

Code: Select all

rosrun tf static_transform_publisher -1.5 0 1 0 0 0 /world /camera_link 10
. This sets the camera to be 1.5 meters back and 1 meter high looking at point [0 0 1], ie level towards the scene center.

Then you also need a transform that relates the crazyflie attitude transform to one I called cf_gt (for ground truth). Note that I might have changed the names, so make sure the existing transforms line up (visualise with rviz):

Code: Select all

rosrun tf static_transform_publisher 0 0 0 0 0 0 /cf0 /cf_gt 10
Assuming I didnt mess up the names above, you should have the following chain of transforms:
world -> kinect -> flie -> imu (I cannot remember the exact names).
The kinect is in the world, and gives a flie position estimate. Then the gyro rotation is applied onto the position to get full 6DOF pose (with yaw drift).

Hopefully I didnt miss any transforms or change the names in a git push...Ill be running this code a lot next week for some experiments. Please write whatever difficulties you have here and I can help out. Or wait a week or two till I get my hands on a kinect and run this code again!
[WARN] [WallTime: 1399300054.172483] Could not look up cf_gt2d -> goal
This is quite normal - it means one of two things: Either the transform tree is broken, or more likely that flie is currently not detected. The pid controller node sends out a world -> goal transform (/goal) and tries to connect that to the current flie pose estimate. If the flie is not being detected the pose is not estimated and there is no error function to do a PID over ;)

Again, sorry for the mess, some of the transform names may have changed as I move to equipping the crazyflie with an onboard camera and connecting to multiple flies at the same time (eg /cf was changed to /cf0,/cf1, /cfX etc).

I'm here to help, keep me posted. Thanks for trying to run this makeshift code!
Oll
Patrik
Beginner
Posts: 20
Joined: Wed Apr 09, 2014 2:43 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by Patrik »

Thanks for the thorough response :)

We can't find any file named kinect.vcg only kinect.rviz (maybe thats the one you meant).

We've followed your instructions but we've run into some problems.

We can see camera_link under TF->Tree->world (you have to add TF). Also we added PointCloud2. We couldn't change depth_registered using the gui but instead used "rosparam set /camera/driver/depth_registered true". I don't know how to check if the topic is set to /camera/depth_registered/points so no idea if it is right. We don't see either points or an rgb picture in Rviz. What we belive we can see is the static transforms showing as coordinate systems with a vector pointing at them.

Do you know where we are doing something wrong?

Patrik
Patrik
Beginner
Posts: 20
Joined: Wed Apr 09, 2014 2:43 pm

Re: [Video] Alternative Kinect Control (using depth images)

Post by Patrik »

I found the problem!

I missed a step in installing the drivers for the kinect. You should blacklist the default kernel module if you are using Ubuntu 13.04 using:

Code: Select all

sudo modprobe -r gspca_kinect
echo 'blacklist gspca_kinect' | sudo tee -a /etc/modprobe.d/blacklist.conf
Now I can access the parameters from the Reconfigure gui. But, of course we are faced with a new error. Under TF->Status:Warn->cf0 we get "No transform from [cf0] to frame [world]" and theres still no dots nor picture :(

Patrik
Post Reply