Difference between revisions of "ROS Hello World example"

From youBot wiki
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
<pre>
 
<pre>
 
cd <your catkin workspace>/src
 
cd <your catkin workspace>/src
git clone https://github.com/youbot/youbot_ros_hello_world
+
git clone https://github.com/wnowak/youbot_ros_samples
 
cd ..
 
cd ..
 
catkin_make
 
catkin_make
Line 14: Line 14:
 
=== Usage ===
 
=== Usage ===
  
To run program you have to run a command:
+
To run the program you have to first start the youbot driver, then start the program itself. First run in a terminal:
  
 
<pre>
 
<pre>
 
roslaunch youbot_driver_ros_interface youbot_driver.launch
 
roslaunch youbot_driver_ros_interface youbot_driver.launch
rosrun youbot_ros_hello_world youbot_ros_hello_world
 
 
</pre>
 
</pre>
  
The program will start, moving the base and the arm. The youBot will move approx. 10cm forwards, then approx. 10cm backwards, then approx. 10cm to the left and approx. 10cm to the right. Afterwards it will ”unfold” the arm and ”fold” it again.
+
When this shows the message that the robot is initialized, start in another terminal (while the youbot driver keeps running):
 
+
== Installation using build cmake ==
+
 
+
You first need to checkout the source code of this program from SVN and then compile it.
+
We assume, that you have installed the KUKA youBot API already and you are going to install the application to the "applications" folder in your home directory.
+
Follow these steps to checkout and compile:
+
  
 
<pre>
 
<pre>
cd
+
rosrun youbot_ros_hello_world youbot_ros_hello_world
git clone https://github.com/youbot/youbot_applications.git
+
cd youbot_applications/hello_world_demo
+
mkdir build
+
cd build
+
cmake ..
+
make
+
</pre>
+
 
+
The binary will be generated in the folder ~/applications/hello_world_demo/bin.
+
 
+
=== Usage ===
+
 
+
To start the application use:
+
 
+
<pre>
+
cd bin
+
sudo ./YouBot_HelloWorldDemo
+
 
</pre>
 
</pre>
  
The program will start, moving the base and the arm. The youBot will move approx. 10cm forwards, then approx. 10cm backwards, then approx. 10cm to the left and approx. 10cm to the right. Afterwards it will ”unfold” the arm and ”fold” it again.
+
The program will start, moving the base and the arm. The youBot will move approx. 10cm forwards, then approx. 10cm backwards, then approx. 10cm to the left and approx. 10cm to the right. Afterwards it will ”unfold” the arm and ”fold” it again, and finally open and close the gripper.
  
If you want to write your own application, using this sources and folder structure, do not forget to edit the main CMakeLists.txt file, which resides in the hello_world_demo folder.
 
  
ADD_SUBDIRECTORY(./src/)
+
Go back to [[Software | Software]]

Latest revision as of 16:14, 19 August 2016

The hello_world_demo is an example application to show you how to use the KUKA youBot API and ROS Wrapper for writing your own applications. You can use all the sources in this directory as a template. Controlling both, the KUKA youBot base, the youBot manipulator and gripper is shown in this example.

Installation using catkin_make

You first need to checkout the source code of this program from SVN and then compile it.

cd <your catkin workspace>/src
git clone https://github.com/wnowak/youbot_ros_samples
cd ..
catkin_make

Usage

To run the program you have to first start the youbot driver, then start the program itself. First run in a terminal:

roslaunch youbot_driver_ros_interface youbot_driver.launch

When this shows the message that the robot is initialized, start in another terminal (while the youbot driver keeps running):

rosrun youbot_ros_hello_world youbot_ros_hello_world

The program will start, moving the base and the arm. The youBot will move approx. 10cm forwards, then approx. 10cm backwards, then approx. 10cm to the left and approx. 10cm to the right. Afterwards it will ”unfold” the arm and ”fold” it again, and finally open and close the gripper.


Go back to Software