From jderobot
Jump to: navigation, search

Project Description[edit]

The goal of the project is to create the required infrastructure for a JdeRobot exercise on Amazon Robotics warehouse scenario.

Following is an introductory video on how Amazon Warehouse Robots work.


  • Arsalan Akhter (arsalanakhter.wpi AT gmail DOT com)
  • Alberto Martin Florido (almartinflorido AT gmail DOT com)
  • José María Cañas Plaza (jmplaza AT gsyc DOT es)


The code can be found at as well as PR#1266 at JdeRobot github.

Future Work[edit]

The robot controller being used to make the robot follow a path can still be improved. As shown in the Week-12 video, it'd be nice to have a better/faster controller to traverse a path in the amazon-warehouse world.

Also, it'd be nice to have multiple robots going around in the arena.

Challenges and Learnings[edit]

Creating a robot controller took the most time in the whole project, and it the biggest learning for me in the project. My initial approach was to develop a controller in the global frame of referrence. However, the issue was resolved by first converting the goal coordinates in the local frame of reference of the the robot.

In addition to that, creating Gazebo world files and plugins was another learning experience.

Week - 12[edit]

Controller Working. The robot reaches it final location at time 3:20 in the following video. Rest of the video is redundant.

The error in the robot movement can be decreased by decreasing the look-ahead distance in the code. Higher Look-ahead distance means greater speed with compromise on accuracy, and vice versa.\

The code can be found here.

Robot Pick and Drop Pallet[edit]

Following video demonstrates the robot Picking up a pallet in the pickup area and then dropping it in the pallet drop area (8X video speed).

In this demonstration, a new button called GoToPoint was added. This button, when used with the button Play Code, makes the robot directly go the point selected by double clicking a point in the map in the GUI. It uses the controller developed in the previous video, to go to a point.

Since the only way the robot can go from one point to another in the exercise is through the planner provided by OMPL, (or through teleop widget). The OMPL planner, however, doesn't plan up to the precision of going under a pallet, due to the low resolution of the image on which it plans. However, the developed controller can be used to go under the table. The GoToPoint button is hence used for this purpose.

Week - 11[edit]

Issue in controller

code here.

This output was during keeping velocity positive all the time.

The issue that comes up is that the error is positive, which gets multiplied by positive velocity, resulting in more positive velocity, which in turn increases the error even more.

I tried to handle this case by checking if the velocity > 0 while the error is still increasing, and then converting the velocity to negative, but that again resulted in the oscillatory behavior as shown in the above video.

Week - 10[edit]

Pointer in GUI moving with Robot in Gazebo

Obstacles grown to have a safe distance of the path from the robot.

Issue with Robot controller[edit]

The controller works fine with positive velocities. The issue is with negative velocities.

The code can be found here.

The issue arises when the robot goes past its desired point, and needs to be given a negative velocity to make it return to its desired point. How I am currently doing it (code here!) is:

  • convert the desired xy-coordinates into polar coordinates.
  • If the abs(distance_diff) is greater than 0.05, and distance_diff < 0, (i.e., it's negative) I give a negative velocity so that it could come back to the desired point, decreasing the distance_diff.

The issue arises when distance_diff is already negative, and giving it more negative velocity increases distance_diff. This case can arise as shown in the above picture (and video). The robot cannot determine that despite the negative velocity, it needs to have a positive velocity to decrease distance_diff.

Week - 9[edit]

Updated code at [github]

(Update: Video with failing Obstacle Avoidance)

Following videos show the movement of the robot, in each quadrant.

In this implementation, we first compute the path using OMPL. I then apply a Gaussian filter to smoothen the trajectory a bit. (I used scipy for the Gaussian filter.). I then apply a 2nd differential on the trajectory to filter out excess points, and only keep those which have some change of direction in them.

I then apply pure_pursuit algorithm as a tracking algorithm to track the given trajectory from OMPL. For each resulting point, we first rotate the robot to correct its heading, and then apply the translational velocity. We keep on doing it untill all the points are processed and the robot reached the last location.

Week - 8[edit]

Following video shows the current behavior .

Following is the code that I have right now:

The algorithm I am attempting is as follows.

1. Take the points from OMPL. Apply 2nd Differential to decrease no. of points and select only those with major change, then apply pure_pursuit algorithm. (This is happening correctly)

2. Rotate the robot to point towards the next location. Angular velocity = 0.2*yaw_diff. Line 285

3. When rotation is done, move the robot with forward velocity 0.5*state.v, where state.v is given by pure_pursuit. Line 309

4. If the robot crosses the desired location (That is, the heading between curr_point and target point is > pi/2 or < 3pi/2), it should try to come back to desired point with a negative velocity Line 321

5. Goto Step 2 again and repeat

Week - 7[edit]

The following video shows the Lift/Drop button added to the GUI, which sends a joint_force command on the topic /amazon_warehouse_robot/joint_cmd

Week - 6[edit]

This week, following tasks were done:

  • Updated Hanqing Xie's code to use with amazon_warehouse. There is one issue in getting a custom map working, which is in progress.
  • Updated the Gazebo World to color separate Pickup/Delivery areas and a Robot Resting/Charging area.
  • Added two robots in amazon_warehouse. There is still some issue with the laser scans. Other things are taken care of through robot namespaces.

Following video shows the Hanqing's widget being used .

And Following are the pictures of newer with two robots.

Following are the topics for the two robots.

Figure: New Amazon-warehouse world and two robots

Week - 5[edit]

This week, following tasks were done:

  • Updated the Gazebo World to include separate Pickup/Delivery areas and a Robot Resting/Charging area.
  • Created a simple Button GUI to lift/drop the top plate of the robot.
  • Created the map of the environment.
  • Went through Hanqing Xie's code. Working on getting OMPL setup on my computer. (In Progress)

Following video shows the Lift/Drop behavior using GUI button.

And Following are the pictures of newer

Figure: New Amazon-warehouse world and it's map.

Week - 4[edit]

Following are the tasks done this week:

  • Created a keyboard teleop for the robot as well as its top lift joint.
  • Created a ROS package to send \odom and \joint_cmd for the robot.
  • Created basic Warehouse Gazebo world.
  • Figured out issues in the physics. Especially when the robot has to pick up the pallet, the pallet slips. Solved it.

Following video shows the robot as run from the ROS package.

Keyboard Teleop for Robot and Joint[edit]

I modified the teleop_twist_keyboard ROS package to send differential drive as well as joint commands to the robot. The package can be used to teleop the robot and pickup pallets at the same time.

Control Robot from a ROS Package[edit]

The package basically gets the current position of the robot, and starts incrementally sending velocity commands on \odom topic in an open-loop fashion. This was done to demonstrate that

1) The Gazebo Plugin is working fine. It updates the joint force automatically now using the OnUpdate() function.

2) The \odom topic can be used alongwith /tf to get the current robot position and send velocity commands to the robot.

3) The above package also controls the top lift joint. So pallets can now be picked and placed while the robot is moving around.

4) The package can further be enhanced to add feedback control to the robot. This will be required in future for the smooth operation of the robot.

Created basic Warehouse Gazebo world[edit]

This included creating populations of the pallets in Gazebo. This also included creating a gazebo model for the walls that would surround the warehouse.

Issues in Physics[edit]

Issues in physics, such as picking the pallet and then slipping out of it, came up, as shown below:

This was resolved by adding Inf friction to the colliding surfaces. I also added a guard rack under the lowest surface of the pallet, so that when the robot gets under pallet then it wouldn't come out while the lift is up. Currently I am not using it though.


  • #1212. Gazebo Warehouse World, Robot Model, and Joint Plugin
  • #1, #2, #3, #4, #5, #6, Basic teleop, Amazon robot teleop, and Amazon robot odom demo.

Week - 3[edit]

Following video shows the robot as teleoperated using keyboard. This is used to test the movement of the robot.

I added the gazebo ros differential drive plugin in the robot model, and then used a keyborad teleop package to run the robot.

Created Issues and Pull requests for the code. Removed an INSTALL issue of the plugin.

To run the demo, after installing, we use the following commands:

$ cd /opt/jderobot/share/jderobot/launch
$ roslaunch amazon-warehouse.launch

In another terminal, following command uses the screw plugin to lift the robot.

$ rostopic pub -r 10 amazon_warehouse_robot/joint_cmd std_msgs/Float32 -- 500

Week - 2:[edit]

Following videos show the behavior of the plugin I developed, firstly with a robot with a screw joint, and then with a prismatic joint.

Discussion on the Plugin[edit]

The plugin uses Gazebo's Joint->SetForce(_index,_effort) to apply force momentarily on the joint. The plugin works with both a screw joint and a prismatic joint. However, as evident from the videos above, the screw joint seems to be a better option since the prismatic joint seems to have a jerky motion associated with it, due to the lower update rate of the message sent by ROS. The plugin should work with both ROS and also as an independent Gazebo plugin. However, one improvement that I am looking into right now is the OnUpdate() function in Gazebo, in which the required force could hypothetically be applied on every update instance of Gazebo.

To send effort values through terminal to the robot already running in Gazebo, we send the following command (on topic amazon_warehouse_robot/joint_cmd)

$ rostopic pub -r 10 amazon_warehouse_robot/joint_cmd std_msgs/Float32 -- 500

I also added a test script to send effort values to Gazebo without ROS middle-ware.

Tasks and Learning Materials[edit]

Related Issues / Pull Requests[edit]

  • My own pull request #1161 for JdeRobot, which includes a robot model in Gazebo, as well as this gazebo Plugin.
  • Jose Maria started an Issue #1162, suggesting that this work can be combined with work of Pablo Mareno.
  • Pablo opened PR #1163 and #1164.

Week - 1:[edit]

Created a new robot model in Gazebo, called amazon_robot, which looks like a basic amazon warehouse robot.

Learn about what is a screw joint in Gazebo, and how can it be added to the robot. Also explored <material> tag and how can it be used to change color of the robot for example.

Following code defines the screw joint.

<joint type="screw" name="top_screw_lift_hinge">
   <pose>0 0 0.2 0 0 0</pose>
     <xyz>0 0 -1</xyz>

I use -1 in z-axis to make the screw joint go upwards when positive force is applied to joint. To contribute to JdeRobot, I followed the tutorial: Submitted the pull request for the robot. Currently, it looks like this:

Pre-GSoC Week:[edit]

This week, the idea is to just explore JdeRobot’s Software and Academy, and may be even start the project. I spent some time getting comfortable with the JdeRobot Environment.

I had a bird’s eye view of the Academy. Tried to run the Autopark exercise in Academy.

One thing to keep in mind (if one is a newbie) is to first run the Gazebo world, and then run the Academy Exercise. For example, to run the AutoPark Exercise, we run the following:

$ gazebo
$ python2 autopark_conf.yml

gazebo worlds are present at: JdeRobot/src/drivers/gazeboserver/worlds

I also spent some time trying to understand gazebo, and how can we add a new robot model to Gazebo. Following sites were helpful: