ros_robotics_projects icon indicating copy to clipboard operation
ros_robotics_projects copied to clipboard

Chapter 11 Creating a teleoperation node using the Leap Motion controller

Open stevensu1838 opened this issue 6 years ago • 5 comments

Hi qbotics,

I've been following your book to teleoperate the Turtlebot with leap motion. I get stuck at creating the package vr_leap_teleop. I did use $ catkin_create_pkg vr_leap_teleop roscpp rospy std_msgs visualization_msgs geometry_msgs message_generation visualization_msgs as below:

ysu66@mech1331:~/catkin_ws/src$ catkin_create_pkg vr_leap_teleop roscpp rospy std_msgs visualization_msgs geometry_msgs message_generation visualization_msgs WARNING: Packages with messages or services should depend on both message_generation and message_runtime Created file vr_leap_teleop/CMakeLists.txt Created file vr_leap_teleop/package.xml Created folder vr_leap_teleop/include/vr_leap_teleop Created folder vr_leap_teleop/src Successfully created files in /home/ysu66/catkin_ws/src/vr_leap_teleop. Please adjust the values in package.xml. ysu66@mech1331:~/catkin_ws/src $ tree /home/ysu66/catkin_ws/src/vr_leap_teleop ├── CMakeLists.txt ├── include │ └── vr_leap_teleop ├── package.xml └── src

Then, I tried to copy the python script from vr_leap_teleop files you provided in github. But I cannot build the package successfully later on.

I might be wrong but I think the vr_leap_teleop package files you provided in githubhttps://github.com/qboticslabs/ros_robotics_projects/tree/master/chapter_11_codes/vr_leap_teleopis not complete. Like there is no launch.file that I can use to run the node.

Do you think you could kindly offer me the complete package that I can build directly? Or could you please tell me how I can build the vr_leap_teleop pacakage succefully? I rely on your book but have no clue how to get it running. Cheers.

Btw, I am using ROS indigo in Ubuntu 14.04 on a real Linux machine.

Steven New Zealand

stevensu1838 avatar Apr 24 '18 06:04 stevensu1838

Hi @stevensu1838

The node doesn't need a launch file to run, anyway for you I have added a launch file, you can check the repo again. Also if you are facing the issue in creating your own package, you can create the ready-made package and build it. The package may not show compilation error, because it is only having python script.

If you have issues with the package in this repo, you can comment back with the screenshot of the error.

Regards Lentin Joseph

qboticslabs avatar Apr 24 '18 23:04 qboticslabs

Hi Sir, Thank you so much for your reply, After doing cmake, I did source ~/catkin_ws/devel/setup.bash && rosrun vr_leap_teleop vr_leap_teleop.py to run the vr_leap_teleop node. And I got the errors in the highlighted area in the linked picture. https://drive.google.com/drive/folders/1Z8AGCiLF2Ed1nA2BMKpBdxWeBzO8qMhT?usp=sharing

Also, I've checked with roscd command and it shows the vr_leap_teleop/ node does exist in ROS. Just in case. I copy the errors down here as well.

ysu66@mech1331:~$ source ~/catkin_ws/devel/setup.bash && rosrun vr_leap_teleop vr_leap_teleop.py
[rosrun] Couldn't find executable named vr_leap_teleop.py below /home/ysu66/catkin_ws/src/vr_leap_teleop
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/ysu66/catkin_ws/src/vr_leap_teleop/src/script/vr_leap_teleop.py

stevensu1838 avatar Apr 25 '18 00:04 stevensu1838

Hi @stevensu1838 , you can change the permission of the node using the following command

$ chmod +x vr_leap_teleop.py

This command should be done inside the script folder. Also, I have a added a launch file for you.

Also, make sure that you can switch to vr_leap_teleop using the following command

$ roscd vr_leap_teleop

This ensures that, the workspace is properly sourced and we can access the package as well

qboticslabs avatar Apr 25 '18 00:04 qboticslabs

Hi Sir, Thank you so much. Now I can roslaunch vr_leap_teleop package. Thanks a lot. At this stage, I am trying to teleoperate the turtlebot with leapmotion and I haven't moved on to the VR stuff yet. After launching vr_leap_teleop package, I still cannot teleoperate the turtlebot in Gazebo with leapmotion. Could you please show me how to fix it ?Please find the following details and the linked screen shot about the process.

1. roslaunch turtlebot_gazebo
ysu66@mech1331:~$ roslaunch turtlebot_gazebo turtlebot_world.launch    Gazebo shows up successfully 
ysu66@mech1331:~$ roslaunch turtlebot_teleop keyboard_teleop.launch(another terminal)   I just wanted to test Gazebo by teleoperating with the keyboard and it works well. Then I killed this keyboard teleoperation by hitting Ctrl + C.

2. set up leapmotion controller
By doing the following, I get leapmotion working.
ysu66@mech1331:~$ sudo LeapControlPanel(another terminal)
^Z
[1]+  Stopped                 sudo LeapControlPanel
ysu66@mech1331:~$ bg
[1]+ sudo LeapControlPanel &
ysu66@mech1331:~$ sudo leapd
[Info] WebSocket server started
[Info] Secure WebSocket server started
[Info] Leap Motion Controller detected: LP59556685952
[Info] Firmware is up to date.

3. launch ROS leapmotion driver(another terminal)
By doing the following, it seems launched but no teminals recieving leap data pops up. 
ysu66@mech1331:~$ source ~/catkin_ws/devel/setup.bash && roslaunch leap_motion sensor_sender.launch

4. launch Leap Motion on the Twist node(another terminal)

ysu66@mech1331:~$ source ~/catkin_ws/devel/setup.bash && roslaunch vr_leap_teleop vr_teleop.launch.

Now a terminal recieving leap data shows up. But no wonder how I move my hand above leap motion device, the turtlebot in Gazebo does't move at all. 

The following is the screenshot of the commands: https://drive.google.com/file/d/1fpxS2GmEsX950VbzajUxz92TpWLycbMc/view?usp=sharing

Thanks Steven

stevensu1838 avatar Apr 25 '18 05:04 stevensu1838

Did you find a solution?

at this moment i am at the same step, it wont move my robot.

dennieboy96 avatar Oct 01 '19 12:10 dennieboy96