Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:advanced:bullet_world_robot [2015/09/11 19:59] – [Loading the world] gkazhoya | tutorials:advanced:bullet_world_robot [2015/09/17 15:54] (current) – [Boxy Prolog description] gkazhoya | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Setting up the Bullet world with a new robot ====== | ====== Setting up the Bullet world with a new robot ====== | ||
| - | This tutorial will walk you though creating your own repo / metapackage from scratch that will use CRAM and Bullet world with your own robots. In this tutorial we will use the Boxy robot as an example. | + | This tutorial will walk you though creating your own repo / metapackage from scratch that will use CRAM and Bullet world with your own robots. In this tutorial we will use the [[http:// |
| The starting point of this tutorial is an installation of CRAM including projection with PR2. If you followed the installation manual, you should have all the necessary packages already. | The starting point of this tutorial is an installation of CRAM including projection with PR2. If you followed the installation manual, you should have all the necessary packages already. | ||
| Line 9: | Line 9: | ||
| The first thing that we actually need is the robot, more precisely, its URDF description. | The first thing that we actually need is the robot, more precisely, its URDF description. | ||
| - | For Boxy it is located in a repo on Github, so let's clone it into our ROS workspace: | + | For the quadrotor |
| <code bash> | <code bash> | ||
| + | sudo apt-get install ros-YOUR-ROS-DISTRO-hector-quadrotor-description | ||
| + | rospack profile | ||
| + | # or | ||
| cd ROS_WORKSPACE_FOR_LISP_CODE | cd ROS_WORKSPACE_FOR_LISP_CODE | ||
| cd src | cd src | ||
| - | git clone https:// | + | git clone https:// |
| cd .. | cd .. | ||
| catkin_make | catkin_make | ||
| </ | </ | ||
| - | CRAM takes the URDF descriptions of the robots from the ROS parameter server, i.e., you will need to upload the URDFs of your robots as a ROS parameter. For Boxy there is a launch file doing that, you will find it here: | + | CRAM takes the URDF descriptions of the robots from the ROS parameter server, i.e., you will need to upload the URDFs of your robots as a ROS parameter. For our robot there is a launch file doing that, you will find it here: |
| <code bash> | <code bash> | ||
| - | roscd iai_boxy_description/launch/ && ls -l | + | roscd hector_quadrotor_description/launch/ && ls -l |
| </ | </ | ||
| - | It's called '' | + | It's called '' |
| <code xml> | <code xml> | ||
| < | < | ||
| - | | + | |
| - | <arg name="urdf-path" | + | <param name="use_gui" |
| - | + | ||
| - | <param | + | <node name=" |
| - | name="robot_description" | + | |
| - | | + | |
| </ | </ | ||
| </ | </ | ||
| - | As we will need to know the names of the TF frames | + | It includes a robot state publisher to publish the TF, we will need it to know the names of the TF frames |
| + | It also starts Rviz: | ||
| <code bash> | <code bash> | ||
| - | roslaunch | + | roslaunch |
| </ | </ | ||
| (It also starts a GUI to play with the joint angles but let's ignore that.) | (It also starts a GUI to play with the joint angles but let's ignore that.) | ||
| - | Let's check if the URDF's on the parameter server using RViz: | + | Let's check if the URDF's on the parameter server using RViz. For that, in RViz click: |
| <code bash> | <code bash> | ||
| - | rosrun rviz rviz | + | Add -> RobotModel |
| - | Add -> Robot Model -> Robot description: robot description | + | |
| Add -> TF | Add -> TF | ||
| </ | </ | ||
| - | To be able to see the TF frames choose '' | + | To be able to see the TF frames choose '' |
| {{ : | {{ : | ||
| - | |||
| ===== Directory / file setup ===== | ===== Directory / file setup ===== | ||
| - | Now let's setup a directory structure for our own packages: a directory (repo) and the metapackage inside: in the '' | + | Now let's setup a directory structure for our own packages: a directory (repo) and the metapackage inside: in the '' |
| <code bash> | <code bash> | ||
| - | mkdir cram_boxy | + | mkdir cram_quadrotor |
| - | catkin_create_pkg | + | catkin_create_pkg |
| </ | </ | ||
| Line 73: | Line 75: | ||
| <code cmake> | <code cmake> | ||
| cmake_minimum_required(VERSION 2.8.3) | cmake_minimum_required(VERSION 2.8.3) | ||
| - | project(cram_boxy) | + | project(cram_quadrotor) |
| find_package(catkin REQUIRED) | find_package(catkin REQUIRED) | ||
| catkin_metapackage() | catkin_metapackage() | ||
| </ | </ | ||
| - | The first ROS package we will create will be the Prolog description of our robot. We will call it '' | + | The first ROS package we will create will be the Prolog description of our robot. We will call it '' |
| - | Go back to the root of your '' | + | Go back to the root of your '' |
| <code bash> | <code bash> | ||
| cd .. | cd .. | ||
| - | catkin_create_pkg | + | catkin_create_pkg |
| </ | </ | ||
| - | Now let's create the corresponding ASDF file called '' | + | Now let's create the corresponding ASDF file called '' |
| <code lisp> | <code lisp> | ||
| ;;; You might want to add a license header first | ;;; You might want to add a license header first | ||
| - | (defsystem cram-boxy-knowledge | + | (defsystem cram-quadrotor-knowledge |
| :author "Your Name" | :author "Your Name" | ||
| :license " | :license " | ||
| Line 100: | Line 102: | ||
| :components | :components | ||
| ((:file " | ((:file " | ||
| - | | + | |
| </ | </ | ||
| - | Now create the corresponding '' | + | Now create the corresponding '' |
| <code lisp> | <code lisp> | ||
| Line 110: | Line 112: | ||
| (in-package :cl-user) | (in-package :cl-user) | ||
| - | (defpackage cram-boxy-knowledge | + | (defpackage cram-quadrotor-knowledge |
| (:use #: | (:use #: | ||
| #: | #: | ||
| Line 116: | Line 118: | ||
| </ | </ | ||
| - | Also, an empty '' | + | Also, an empty '' |
| - | Now, let's compile our new packages and load them through the REPL: | + | Now, let's compile our new packages |
| <code lisp> | <code lisp> | ||
| - | BTR> , | + | CL-USER> , |
| ros-load-system | ros-load-system | ||
| - | cram_boxy_knowledge | + | cram_quadrotor_knowledge |
| - | cram-boxy-knowledge | + | cram-quadrotor-knowledge |
| </ | </ | ||
| Line 132: | Line 134: | ||
| Now, let's describe our robot in Prolog, such that we could do some reasoning with it. | Now, let's describe our robot in Prolog, such that we could do some reasoning with it. | ||
| - | We fill in the file '' | + | We fill in the file '' |
| As can be seen from the TF tree, our robot has 3 camera frames, 1 depth and 1 RGB frame from a Kinect camera, and an RGB frame from a Kinect2 camera. | As can be seen from the TF tree, our robot has 3 camera frames, 1 depth and 1 RGB frame from a Kinect camera, and an RGB frame from a Kinect2 camera. | ||
| Line 273: | Line 275: | ||
| {{ : | {{ : | ||
| - | |||

