Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorials:intermediate:pepper_shopping [2020/05/13 14:47] – added an example of lisp code gkazhoya | tutorials:intermediate:pepper_shopping [2020/08/17 22:42] – derrick | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Pepper robot shopping assistant (tutorial in construction) ====== | ====== Pepper robot shopping assistant (tutorial in construction) ====== | ||
- | ===== This is an example section title ===== | + | ===== Setting Up The Workspace |
- | ==== This is then a subsection | + | |
- | | + | This process assumes you have already installed CRAM on your laptop. If not, please visit the installation section. |
+ | If you are using the image version of CRAM, please follow the next section. | ||
+ | |||
+ | ==== VM Set Up ==== | ||
+ | |||
+ | Open the terminal by just typing ctrl+alt+t and then type and execute the following command: | ||
+ | |||
+ | < | ||
+ | $ sudo apt update && sudo apt upgrade | ||
+ | </ | ||
+ | |||
+ | Let’s update ROS and CRAM components. In the terminal type and execute the following commands: | ||
+ | |||
+ | < | ||
+ | $ cd ~/ | ||
+ | $ sudo apt install ros-kinetic-joint-state-publisher-gui | ||
+ | $ sudo apt-get install ros-kinetic-pepper-meshes | ||
+ | </ | ||
+ | |||
+ | **Please note that during this process, a window will pop up, and you must accept the license. Press tab key to select 0K then Yes.** | ||
+ | |||
+ | Install ros-control and roslisp_common package | ||
+ | |||
+ | < | ||
+ | $ sudo apt-get install ros-kinetic-ros-control ros-kinetic-ros-controllers | ||
+ | $ sudo apt install ros-melodic-roslisp-common | ||
+ | </ | ||
+ | |||
+ | At this point, we need an older version of CRAM. We a specific branch of the CRAM architecture. Therefore, if you have some work done in the current version of CRAM, please make a copy and place it in a different directory for safekeeping or commit your current branch. | ||
+ | |||
+ | Run the following in your terminal. | ||
+ | |||
+ | < | ||
+ | $ cd ~/ | ||
+ | $ git checkout 3f5b268504cb5226709daa7a5d52364c2b05a93d | ||
+ | $ git branch | ||
+ | </ | ||
+ | |||
+ | Use the last command to confirm that you are using a branch named **3f5b268**. | ||
+ | |||
+ | ==== Native Set Up ==== | ||
+ | |||
+ | If you did a native installation of ROS and CRAM, you would most likely install all the necessary components. However, you have to go through the setup process for the VM to be sure everything | ||
+ | |||
+ | Now let's begin. | ||
+ | |||
+ | First, we need to set up our Robot and Shelf models to upload them to the ROS parameter server. Through that, we can visualize these models in RViz and the Bullet world. | ||
+ | |||
+ | Let's begin by creating | ||
+ | |||
+ | < | ||
+ | $ cd ~/ | ||
+ | $ catkin_create_pkg pepper_description | ||
+ | </ | ||
+ | |||
+ | The terminal should be looking like the sample below. | ||
+ | |||
+ | < | ||
+ | Created file pepper_description/ | ||
+ | Created file pepper_description/ | ||
+ | Successfully created files in / | ||
+ | </ | ||
+ | |||
+ | Next, we are going to adjust the values in the // | ||
+ | |||
+ | <code XML> | ||
+ | <?xml version=" | ||
+ | <package format=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
| | ||
- | <code lisp> | + | |
- | (and this-is (some lisp code with lisp highlighting)) | + | |
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | </ | ||
</ | </ | ||
- | | + | Next, we edit the // |
+ | |||
+ | < | ||
+ | find_package(catkin REQUIRED COMPONENTS | ||
+ | urdf | ||
+ | controller_manager | ||
+ | joint_state_controller | ||
+ | robot_state_publisher | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | Rename the file "// | ||
+ | |||
+ | Next, open this file: "// | ||
+ | |||
+ | Comment out the following code by putting semi-colon in front of them. It should be on line 40 - 43. | ||
+ | |||
+ | < | ||
+ | ; (desig: | ||
+ | ; 3 robot-current-pose-tf-generator | ||
+ | ; "We should move the robot only if we really need to move. Try the | ||
+ | ; current robot pose as a first solution." | ||
+ | |||
+ | </ | ||
+ | |||
+ | Now we can compile. Run the code below. | ||
+ | |||
+ | < | ||
+ | $ cd .. && catkin_make | ||
+ | </ | ||
+ | |||
+ | ==== Uploading Models to the Parameter Server ==== | ||
+ | |||
+ | After successfully building the package, we need to add the models we will be uploading to the ROS parameter server. Change directory to the pepper_description package, and let's create three folders, namely //launch//, //meshes//, and //urdf//. | ||
+ | |||
+ | Download [[https:// | ||
+ | |||
+ | Now let’s explain the code in the // | ||
+ | |||
+ | < | ||
+ | <include file=" | ||
+ | </ | ||
+ | |||
+ | This line uploads the occupancy map for navigation. It is the environment or free space for the robot to move around. | ||
+ | |||
+ | < | ||
+ | <param name=" | ||
+ | <param name=" | ||
+ | </ | ||
+ | |||
+ | These two lines are the representation of the Pepper robot and shelves in the URDF. Take note of the name parameter. We will need it for Rviz visualization. | ||
+ | |||
+ | < | ||
+ | <node name=" | ||
+ | <node name=" | ||
+ | <remap from=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | The next line is a ROS node to publish the robot and the shelf joint state values to make them available to other nodes. | ||
+ | |||
+ | |||
+ | < | ||
+ | <node pkg=" | ||
+ | <node pkg=" | ||
+ | <param name=" | ||
+ | <remap from=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | This line is also a ROS node to publish the robot state values of the robot and the shelves. | ||
+ | |||
+ | < | ||
+ | <node pkg=" | ||
+ | <node pkg=" | ||
+ | </ | ||
+ | |||
+ | The last two lines are nodes to publish transform frames with respect to the map. | ||
+ | |||
+ | Save and compile your workspace. | ||
+ | |||
+ | Now let's upload the models to the ROS parameter server. Run the code below. | ||
+ | |||
+ | < | ||
+ | $ roslaunch pepper_description upload.launch | ||
+ | </ | ||
+ | |||
+ | Open another terminal and open RViz. | ||
+ | |||
+ | < | ||
+ | $ rviz | ||
+ | </ | ||
+ | |||
+ | You should see a window like the one below. | ||
- | * And this is a bullet list | ||
- | Below is a horizontal rule: | ||
- | ---------------------------------- | ||
- | And this is '' |