[Video] Alternative Kinect Control (using depth images)

Firmware/software/electronics/mechanics
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 »

Hey guys,
sorry been super busy with my day job, hardly have had time for the flie at all! Also managed to break my arm..cant really type!

I did not catkinize the package yet, so running rosmake is the way to go now. This basically build the messages. If you change the firmware (add logging configs), you can generate the messages from the GUI settings tab and rosmake again to build the new messages.

in theory, any controller with enough axis/buttons should work fine, however you will need to modify joy_driver_pid.py to remap the axis and the buttons. That code is a bit messy and I hacked in some different mappings already (see the enums) so it should be pretty easy to remap them.

Not sure about the ResourceNotFound error - please explain exactly how you ended up with it. Furthermore, did you check out: http://wiki.ros.org/rgbd_launch and if you have further issues you can also ask on http://answers.ros.org/.

It looks like its just not installed, try

Code: Select all

sudo apt-get install ros-$ROS_DISTRO-rgbd-launch
Good luck)
DerP0LE
Beginner
Posts: 3
Joined: Mon Jun 30, 2014 10:42 am

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

Post by DerP0LE »

Hey
after I installed the rgbd-launch and try to do this: "roslaunch freenect_launch freenect.launch", I get this 2 errors:

Image

Here the whole code:

Code: Select all

... logging to /home/raphael/.ros/log/0b56a738-2ac2-11e4-af83-84a6c878b2ac/roslaunch-RaphLap-602.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://RaphLap:47232/

SUMMARY
========

PARAMETERS
 * /camera/camera_nodelet_manager/num_worker_threads: 4
 * /camera/depth_rectify_depth/interpolation: 0
 * /camera/depth_registered_rectify_depth/interpolation: 0
 * /camera/disparity_depth/max_range: 4.0
 * /camera/disparity_depth/min_range: 0.5
 * /camera/disparity_registered_hw/max_range: 4.0
 * /camera/disparity_registered_hw/min_range: 0.5
 * /camera/disparity_registered_sw/max_range: 4.0
 * /camera/disparity_registered_sw/min_range: 0.5
 * /camera/driver/data_skip: 0
 * /camera/driver/debug: False
 * /camera/driver/depth_camera_info_url: 
 * /camera/driver/depth_frame_id: /camera_depth_opt...
 * /camera/driver/depth_registration: False
 * /camera/driver/device_id: #1
 * /camera/driver/diagnostics_max_frequency: 30.0
 * /camera/driver/diagnostics_min_frequency: 30.0
 * /camera/driver/diagnostics_tolerance: 0.05
 * /camera/driver/diagnostics_window_time: 5.0
 * /camera/driver/enable_depth_diagnostics: False
 * /camera/driver/enable_ir_diagnostics: False
 * /camera/driver/enable_rgb_diagnostics: False
 * /camera/driver/rgb_camera_info_url: 
 * /camera/driver/rgb_frame_id: /camera_rgb_optic...
 * /rosdistro: indigo
 * /rosversion: 1.11.8

NODES
  /camera/
    camera_nodelet_manager (nodelet/nodelet)
    debayer (nodelet/nodelet)
    depth_metric (nodelet/nodelet)
    depth_metric_rect (nodelet/nodelet)
    depth_points (nodelet/nodelet)
    depth_rectify_depth (nodelet/nodelet)
    depth_registered_rectify_depth (nodelet/nodelet)
    disparity_depth (nodelet/nodelet)
    disparity_registered_hw (nodelet/nodelet)
    disparity_registered_sw (nodelet/nodelet)
    driver (nodelet/nodelet)
    points_xyzrgb_hw_registered (nodelet/nodelet)
    points_xyzrgb_sw_registered (nodelet/nodelet)
    rectify_color (nodelet/nodelet)
    rectify_ir (nodelet/nodelet)
    rectify_mono (nodelet/nodelet)
    register_depth_rgb (nodelet/nodelet)
  /
    camera_base_link (tf/static_transform_publisher)
    camera_base_link1 (tf/static_transform_publisher)
    camera_base_link2 (tf/static_transform_publisher)
    camera_base_link3 (tf/static_transform_publisher)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[camera/camera_nodelet_manager-1]: started with pid [620]
process[camera/driver-2]: started with pid [628]
[ INFO] [1408799239.400242831]: Initializing nodelet with 4 worker threads.
process[camera/debayer-3]: started with pid [657]
process[camera/rectify_mono-4]: started with pid [671]
process[camera/rectify_color-5]: started with pid [687]
[ERROR] [1408799239.772948889]: Failed to load nodelet [/camera/driver] of type [freenect_camera/driver]: Could not find library corresponding to plugin freenect_camera/driver. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
[FATAL] [1408799239.773472219]: Service call failed!
process[camera/rectify_ir-6]: started with pid [703]
process[camera/depth_rectify_depth-7]: started with pid [717]
process[camera/depth_metric_rect-8]: started with pid [743]
[camera/driver-2] process has died [pid 628, exit code 255, cmd /opt/ros/indigo/lib/nodelet/nodelet load freenect_camera/driver camera_nodelet_manager --no-bond ir:=ir rgb:=rgb depth:=depth depth_registered:=depth_registered projector:=projector __name:=driver __log:=/home/raphael/.ros/log/0b56a738-2ac2-11e4-af83-84a6c878b2ac/camera-driver-2.log].
log file: /home/raphael/.ros/log/0b56a738-2ac2-11e4-af83-84a6c878b2ac/camera-driver-2*.log
process[camera/depth_metric-9]: started with pid [757]
process[camera/depth_points-10]: started with pid [793]
process[camera/register_depth_rgb-11]: started with pid [813]
process[camera/points_xyzrgb_sw_registered-12]: started with pid [850]
process[camera/depth_registered_rectify_depth-13]: started with pid [864]
process[camera/points_xyzrgb_hw_registered-14]: started with pid [881]
process[camera/disparity_depth-15]: started with pid [924]
process[camera/disparity_registered_sw-16]: started with pid [973]
process[camera/disparity_registered_hw-17]: started with pid [996]
process[camera_base_link-18]: started with pid [1012]
process[camera_base_link1-19]: started with pid [1041]
process[camera_base_link2-20]: started with pid [1066]
process[camera_base_link3-21]: started with pid [1079]
and when i open the kinect.rviz i get in the displays panel some errors (Global Status: Error; Fixed Frame; Axes; Status: Error)
When I type "lsusb" he just show me a "Micrsoft Corp.", or must be there a "Microsoft Corp. Kinect"?
robogrow
Beginner
Posts: 1
Joined: Thu Aug 28, 2014 3:35 am

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

Post by robogrow »

I have hack the low res version of the Kinect camera. Is this for the new hi res version?

I would like to track a crazyflie over a 2' by 8' space and eventually over an entire 100 x 30 foot area. My goal is within a few centimeters.

I would like to join this effort.

facebook.com/robogrow
Veerachart
Member
Posts: 45
Joined: Mon Jan 13, 2014 4:12 am

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

Post by Veerachart »

desertdiver wrote:Thanks =] I used rosmake to build the thing and it worked. I made a new folder ~/indigo_ws/sandbox (like it says in the tutorial on the ROS wiki) and git cloned there.
Now I'm having some trouble installing freenect part (In the end I want to try using kinect to control the flie). I built the freenect_stack just like I did with crazyflieROS but I get this error:

Code: Select all

ResourceNotFound: rgbd_launch
.
Also I don't have a PS3 controller, only xbox. Is there any way to get that to work?

Which version of Ubuntu and ROS are you using? I cannot remember if I had a problem installing freenect on ROS Hydro on Ubuntu 13.10, but with Groovy, Ubuntu 12.04, there is no problem like this (as far as my memory is good enough :D) Let me check my log later.

EDIT: Well, it seems like I don't have Freenect installed on my 13.10 computer, can't remember about the reason.
Anyway, if you can install Openni package, it's also possible to use Openni instead of freenect, but requires some modification in manifest.xml file.
Bumbolt
Beginner
Posts: 16
Joined: Tue Feb 18, 2014 10:53 pm

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

Post by Bumbolt »

Hi,

I'm also jumping on this topic as an undergraduate student. I hope to learn the basics of ROS through this topic and maybe expand on the project a little.
I already tested some stuff and my controller works perfectly. I'm a complete beginner in ROS and i wonder how i get the client running in the first place.

It seems evident that i have to compile the code i try this by doing 'rosmake crazyflieROS'. Then i try to start the project by running 'rosrun crazyflieROS driver.py' but i doesn't seem to find the newly made crazyflieROS module. Can someone help me with this, this isn't documented on the github since it expects you to be familiar with ROS.

Thanks in advance and thanks to Patrik (i already learned alot from your posts here)

[UPDATE]

Seems like i messed up with the workspace setup. I can run the client now but still get an error on the controller (the controller and driver work with the original client and i can also log it with joy in ros (echotopic...)) But i get this

Code: Select all

bitcraze@bitcraze-vm:~/pa_01/crazyflieROS$ roslaunch crazyflieROS pid.launch js:=2
[pid.launch] is neither a launch file in package [crazyflieROS] nor is [crazyflieROS] a launch file name
The traceback for the exception was written to the log file
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

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

Post by whoenig »

Did you source your workspace correctly, i.e.

Code: Select all

source devel/setup.bash
? It sounds like it doesn't find the package.
Bumbolt
Beginner
Posts: 16
Joined: Tue Feb 18, 2014 10:53 pm

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

Post by Bumbolt »

That was the initial problem but now i can rosrun the package so it's found but it seems that the launch files are not included somehow?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

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

Post by whoenig »

On github there seems to be a launch file named pid.launch in the launch subfolder of the package. Can you check if you have that on your local file system as well?
Bumbolt
Beginner
Posts: 16
Joined: Tue Feb 18, 2014 10:53 pm

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

Post by Bumbolt »

I'm sorry as it turns out you were right the first time. As i was testing i manualy ran the source commands and exports for package path. Hence I had built it with correct paths but was running roscore and roslaunch commands in other terminals with wrong paths.

Seems like i made a mistake in my .bashrc (still don't know what) but it's not loading the path's correctly.

Yes i have that file.

I'm learning basic ROS by using this project so sorry for my basic questions. Hope you understand :)

[UPDATE]

It seems like the setup file of the inital ros install overwrites the package path. I switched the order of my source and export commands and now it loads paths correctly.

[UPDATE2]

Found a similar problem earlier in the topic. Fixed most of my problems by making a directory in mij workspace and cloning into that (i was working in the workspace root).

Now I'm stuck on the following problem:

Code: Select all

[ERROR] [WallTime: 1417165974.976993] bad callback: <bound method JoyController.new_joydata of <__main__.JoyController instance at 0x9461dcc>>
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 688, in _invoke_callback
    cb(msg)
  File "/home/bitcraze/pa_01/workspace/sandbox/crazyflieROS/bin/joy_driver_pid.py", line 597, in new_joydata
    if self.pressed(Button.Circle):
  File "/home/bitcraze/pa_01/workspace/sandbox/crazyflieROS/bin/joy_driver_pid.py", line 326, in pressed
    return not self.prev_cmd.buttons[id] and self.curr_cmd.buttons[id]
IndexError: tuple index out of range
The controller node keeps spamming there errors. But both the GUI and JoystickReconfigure GUI come up so that's good.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

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

Post by whoenig »

Great progress! I guess you are just using a different controller than what Oliver used to use (PS3?!). If you look in joy_driver_pid.py, line 128 you can see that the offending button is defined as index 13. If your controller has less than 14 buttons, you would crash. You can use jstest to see the joystick mapping for your joystick and update the mapping in joy_driver_pid.py.
Post Reply