A ROS2 Remote Warehouse Real Robot Lab For Industrial Training

A ROS2 Remote Warehouse Real Robot Lab For Industrial Training

Practice, practice, practice!

That is the motto behind all The Construct courses for learning how to program robots with ROS.

Since the very beginning, The Construct has focused on providing opportunities for practice with simulated robots instead of relying on basic video lessons.

Now we have taken an additional step by providing practice with real robots. How can you practice with real robots if you don’t have them? Connect remotely to our online real robot labs.

To provide this experience, we have created, in collaboration with Robotnik, the Remote Warehouse Robot Lab, where you can remotely connect and practice ROS1 and ROS2 with industrial collaborative robots.

You don’t have to install anything. We provide you with a full ROS1 and ROS2 environment on the web browser, so you can fully practice with ROS from any computer, including Mac, Windows or Linux. Access to the real robots is also managed through the browser, so you don’t waste time with ugly configuration issues.

Be on the edge of programming industrial collaborative robots.

Our goal is to keep you learning the latest technologies for programming collaborative robots with the most open and advanced frameworks and techniques.

For that goal we provide you with the Remote Warehouse Robot Lab, where you can practice with two types of industrial robots:

1. RB-1 mobile base by Robotnik

remote robot lab

This is a mobile base robot able to move shelves from one location to another. With this robot, students can practice:

a. How to make a robot autonomously navigate

real_robot_navigation

b. How to move shelves from one place to another

c. How to recognize environments, tags, people, or objects.

robot_auto_charge

2. UR3e robotic arm

This is a collaborative robotic arm with a gripper and a 3D sensor for perception. With this robot, students can practice:

a. How to move a robotic arm

ur_robotic_arm

b. How to grasp and release elements from a surface

pick_and_place

c. How to detect the objects to grasp through perception

Perception_to_grasp_object

How to use the Remote Warehouse Robot Lab

You can book a session with any of the robots. The RB-1 mobile base robot is available 20/7 (4 hours are required to recharge the mobile base throughout the day), and the UR3e robotic arm is available 24/7. You can find the schedule for each one of the robots inside The Construct’s lateral panel, under the Real Robot Lab option.

real_robot_lab_agenda

You will reach the page that allows you to make the booking

How to book a session

The process to access the robot is very simple:

1. Start the booking process

Log in to The Construct. Select the Real Robot Lab option on the left menu, and click on the Book Now button.

2. Select a robot

We offer a variety of robots in different remote labs. For example, in this Remote Warehouse Robot Lab, you can book the RB-1 mobile base robot or the UR3 robotic arm.

3. Select the ROS Distro to use

remote_select_ros_distro

4. Select the day and time

Select a day and time that the robot is available (slot in green color). Remember that times are shown in your local time.

remote_select_day

5. Confirm

Check that your booking is correct, and then confirm.

remote_confirm

You are done! You can work with the real robot on the day and time booked.

How to practice with the simulation before connecting to the real robot

A complete simulation of the real environment is provided. We strongly encourage you to test your code on the simulation before going to the real robot. Practice with a simulation allows you to quickly identify potential programming errors and not waste your time with the real robots.

The simulated robot lab is quite realistic and corresponds to the actual setup of the real robot lab. We have even included the shelves that the mobile base robot can carry.

remote_warehous_robot_lab_simulation RB-1 BASE Robot Simulation

 

How to connect to the real robots

5-minutes before your booked time, you will get a notification indicating you should be prepared to connect to the real robot.

1. Launch a rosject

Connecting to a robot only makes sense within the context of a ROS project. This means you want to connect to the robot because you have a ROS project that you want to test on it.

That is why, before connecting to the robot, you need to open a rosject (a ROS project within The Construct). Select the rosject you want to test from your list of rosjects and press the run button.

2. Press the connect button

Once the rosject is open, go to the bottom bar to see the icon to connect to the robot.

connect_to_real_robot

Press that icon and then press the Connect to Robot button. After a few seconds, you will have a view of the cameras located in our lab pointing to the robot working area. The cameras allow you to see what is happening in the lab when you execute your program. When the cameras appear, this means you are now connected to the real robot and anything you execute will be executed in the robot itself.

(secret tip 😉: you can use the web-joystick to control the robot, but you can also connect a gamepad to your computer and control the robot remotely. 😉

3. Launch your programs

Once you are connected, you can work as if you were inside the computer of the robot.

Opening a terminal allows you to launch your ROS programs and control the robot. You can use Rviz or any other tools to control and visualize the status of the robot.

running_my_programs

Practice with ROS1 or ROS2 setup

Practice with the robots can be done in any setup with ROS1 or ROS2.

The robots run ROS1 drivers natively, but The Construct’s platform allows students to launch the needed ros1_bridge and action_bridge required to manage everything in ROS2 (bridges provided and properly configured). Everything from basic ROS2 commands to complex Nav2 or MoveIt2 skills works correctly in this environment and allows you to practice complex ROS2 programs.

You can learn more about how those bridges work and how to use them in this online course: ROS2 Industrial Workshop.

Online Workshops

Apart from our regular students, we use the Remote Warehouse Robot Lab within the online workshops that we deliver. During the workshops, we teach on-camera to the students using Zoom. Students can connect to the lab from their own locations (any country worldwide) and practice with the robots.

For example, we use this procedure with the Get ROS2 Ready for Industrial Robots online workshop that we deliver every last week of the month. In this workshop, students dedicate  30 hours to learning how to program with ROS2 and connect to our real robot lab from their remote locations to practice them.

Who Should Access the Remote Warehouse Robot Lab?

  1. The remote warehouse robot lab is aimed at engineers who want to be up to date on the latest ROS skills.
  2. It is also useful for researchers that need to learn ROS skills fast.
  3. Finally,  the remote warehouse robot lab is useful for company leaders who need to have an overall understanding of the latest technologies for robotics in order to decide whether to use them or not.

You can create your own online remote robot lab!

The technology that we developed to create our own remote lab allows anybody to create their own remote lab with a few simple clicks. So, if you are interested in creating your own lab and making it accessible to a set of students or the whole world, contact us. It is a very simple and quick procedure and you can be delivering your robots to the world within an hour!

Check this video to have an idea of how to create your own remote robot lab.

 

Want to equip your team with ROS skills fast by practicing in our Warehouse Robot Lab?

Upgrade to the Enterprise license now!

85. ROS2 Control with Bence Magyar

85. ROS2 Control with Bence Magyar

Today we are going to learn about the current status of ROS2 Control, you know, the packages that allow us to control joints using ROS topics.

But before going into that, let me remind you about our ROS online academy. Yes, at the Construct we have created an online academy named The Robot Ignite Academy which contains a ROS learning path for beginners. The path is composed by:

Some other robotics theory courses included are:

Of course all our courses are based on practice with simulated robots! (theory+practice)

Now let me introduce you Bence Magyar. Bence and I we worked together at Pal Robotics. Now he works as Lead software engineer for FiveAI. But the main reason he is here with us today is because he is the main maintainer of the ROS control packages.

Welcome to the podcast Bence!

Related Links

Subscribe to the podcast using any of the following methods

Or watch the video interview

 

ROS2 Tutorials #8: How to communicate between ROS1 & ROS2 with ros1_bridge

ROS2 Tutorials #8: How to communicate between ROS1 & ROS2 with ros1_bridge

In this post, you will learn how to communicate between ROS1 & ROS2 with ros1_bridge. You will see how to set up the ros1_bridge package in order to send ROS2 commands to control a TurtleBot2 simulation running in ROS1 Melodic.

Step 1: Grab a copy of the Project (ROSject) on ROSDS

Click here to get your copy of the project used in this post.

Step 2: Launch the TurtleBot2 simulation from the Simulations menu

Launch a TB2 Simulation

Now you should see a Simulation window pop up with the TurtleBot2 simulation.

TurtleBot2 Simulation

Step 2: Source the workspace for ROS1 Melodic

Pick a Shell (terminal tool) from the Tools menu and run the following command:

user:~$ source /opt/ros/melodic/setup.bash
user:~$

Step 3: Source the workspace for ROS2 Dashing

In the same Shell used in Step 2, run the following command:

user:~$ source /opt/ros/dashing/local_setup.bash
ROS_DISTRO was set to 'melodic' before. Please make sure that theenvironment does not mix paths from different distributions.
user:~$

Step 3: Ensure ROS_MASTER_URI is pointing in the right direction:

Still on the same shell, run the following:

user:~$ echo $ROS_MASTER_URI
http://master:11311
user:~$ export ROS_MASTER_URI=http://master:11311
user:~$

Step 4: Communicate between ROS1 & ROS2 with ros1_bridge: start the ros_bridge

Now, start the ros1_bridge and put this terminal on one side – we’re done with it for now.

user:~$ ros2 run ros1_bridge dynamic_bridge
Created 2 to 1 bridge for service /gazebo/clear_body_wrenches
Created 2 to 1 bridge for service /gazebo/clear_joint_forces
Created 2 to 1 bridge for service /gazebo/delete_light
Created 2 to 1 bridge for service /gazebo/delete_model
Created 2 to 1 bridge for service /gazebo/get_joint_properties
Created 2 to 1 bridge for service /gazebo/get_light_properties
Created 2 to 1 bridge for service /gazebo/get_link_properties
...

Step 5: Control the ROS1 TurtleBot2 Simulation from ROS2

Fire up another Shell from the Tools menu and publish to /cmd_vel.

user:~$ source /opt/ros/dashing/local_setup.bash
ROS_DISTRO was set to 'melodic' before. Please make sure that the environment does not mix paths from different distributions.
user:~$ ros2 topic pub /cmd_vel geometry_msgs/Twist "linear:
  x: 0.5
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.0"
publisher: beginning loop
publishing #1: geometry_msgs.msg.Twist(linear=geometry_msgs.msg.Vector3(x=0.5, y=0.0, z=0.0), angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=0.0))

In the shell where you’re running the ros1_bridge, you should see messages similar to the following:

created 1to2 bridge for topic '/rosout' with ROS 1 type 'rosgraph_msgs/Log' and ROS 2 type 'rcl_interfaces/msg/Log'
created 2to1 bridge for topic '/cmd_vel' with ROS 2 type 'geometry_msgs/msg/Twist' and ROS 1 type ''
created 2to1 bridge for topic '/rosout' with ROS 2 type 'rcl_interfaces/msg/Log' and ROS 1 type 'rosgraph_msgs/Log'
[INFO] [ros_bridge]: Passing message from ROS 2 geometry_msgs/msg/Twist to ROS 1 geometry_msgs/Twist (showing msg only once per type)

And, of course, you should see that your robot started to move!

And that was it 😉 . We just controlled a simulation started in ROS1 with ROS2, using the ros1_bridge.

Extra: Video

Prefer to watch a video demonstrating the steps above? We have one for you below! PS: the video uses another simulation, a Parrot Drone, but the concepts are the same.

Related Resources

Feedback

Did you like this post? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.

If you want to learn about other ROS or ROS2 topics, please let us know in the comments area and we will do a video or post about it 🙂

Post edited by Bayode Aderinola

#ROS2 #ROS #ROS2tutorials #Robot

ROS2 Tutorials #5: How to create a ROS2 Package for Python

ROS2 Tutorials #5: How to create a ROS2 Package for Python

About

In this post, you will learn how to create a simple ROS2 package for Python. You don’t need a ROS2 installation for this as we will use the ROS Development Studio (ROSDS), an online platform that provides access to ROS (1 or 2) computers and other powerful ROS tools within a browser!

PS: If you have ROS2 installed locally on your machine, you can skip Step 1.

Step 1: Create a Project (ROSject) on ROSDS

Head to http://rosds.online and create a project with a similar configuration as the one shown below. You can change the details as you like, but please ensure you select “Ubuntu 18.04 + ROS2 Crystal” under “Configuration”.

Once done with that, open your ROSject. This might take a few moments, please be patient.

Step 2: Source the ROS2 workspace

Once the ROSject is open, head to the Tools menu and pick the Shell tool (if on your local PC just fire up a terminal) and run the following command to source the workspace:

user:~$ source /opt/ros/crystal/setup.bash
ROS_DISTRO was set to 'melodic' before. Please make sure that the environment does not mix paths from different distributions.
user:~$

If you get that ROS_DISTRO warning, just ignore it.

Step 3: Create a ROS2 Python package in your ROS2 workspace

The syntax for creating a ROS2 Python package is ros2 pkg create <package_name>.

In the same terminal as in Step 2, change to your ROS2 workspace src directory and create a package there:

user:~$ cd ros2_ws/src
user:~/ros2_ws/src$ ros2 pkg create ros2_demo_py
going to create a new package
package name: ros2_demo_py
destination directory: /home/user/ros2_ws/src
package format: 2
version: 0.0.0
description: TODO: Package description
maintainer: ['user <user@todo.todo>']
licenses: ['TODO: License declaration']
build type: ament_cmake
dependencies: []
creating folder ./ros2_demo_py
creating ./ros2_demo_py/package.xml
creating source and include folder
creating folder ./ros2_demo_py/src
creating folder ./ros2_demo_py/include/ros2_demo_py
creating ./ros2_demo_py/CMakeLists.txt
user:~/ros2_ws/src$

Step 4: Delete CMakeLists.txt , create setup.py and setup.cfg and edit package.xml

Unlike ROS1, ROS2 Python packages don’t use CMakeList.txt, but a new setup.py file. Let’s create one here. In the Shell:

user:~/ros2_ws/src$ cd ros2_demo_py/
user:~/ros2_ws/src/ros2_demo_py$ rm CMakeLists.txt
user:~/ros2_ws/src/ros2_demo_py$ touch setup.py
user:~/ros2_ws/src/ros2_demo_py$ touch setup.cfg
user:~/ros2_ws/src/ros2_demo_py$

Fire up the IDE, locate the setup.py file and paste in the following code:

from setuptools import setup

package_name = 'ros2_demo_py'

setup(
    name=package_name,
    version='0.7.0',
    packages=[package_name],
    install_requires=['setuptools'],
    zip_safe=True,
    author='You',
    author_email='you@youremail.com',
    maintainer='YourFirstname Lastname',
    maintainer_email='your@youremail.com',
    keywords=['ROS'],
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Topic :: Software Development',
    ],
    description='A simple ROS2 Python package',
    license='Apache License, Version 2.0',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            'demo = ros2_demo_py.demo:main'
        ],
    },
)

Locate the setup.cfg file and paste in the following code:

[develop]
script-dir=$base/lib/ros2_demo_py
[install]
install-scripts=$base/lib/ros2_demo_py

Locate package.xml and replace the contents with this snippet:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
  <name>ros2_demo_py</name>
  <version>0.7.3</version>
  <description>A simple ROS2 Python package</description>

  <maintainer email="sloretz@openrobotics.org">Shane Loretz</maintainer>
  <license>Apache License 2.0</license>

  <exec_depend>rclpy</exec_depend>
  <exec_depend>std_msgs</exec_depend>

  <!-- These test dependencies are optional
  Their purpose is to make sure that the code passes the linters -->
  <test_depend>ament_copyright</test_depend>
  <test_depend>ament_flake8</test_depend>
  <test_depend>ament_pep257</test_depend>
  <test_depend>python3-pytest</test_depend>

  <export>
    <build_type>ament_python</build_type>
  </export>
</package>

Step 5: Create the Python code

In the Shell, run the following commands:

user:~/ros2_ws/src/ros2_demo_py$ mkdir ros2_demo_py && cd ros2_demo_py
user:~/ros2_ws/src/ros2_demo_py/ros2_demo_py$ touch demo.py
user:~/ros2_ws/src/ros2_demo_py/ros2_demo_py$ touch __init__.py
user:~/ros2_ws/src/ros2_demo_py/ros2_demo_py$

We created the __init__.py file so that the ros2_demo_py folder could be recognized as a python module directory.

Locate the demo.py file, open it in the IDE and paste in the following code:

# Copyright 2016 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import rclpy
from rclpy.node import Node

from std_msgs.msg import String


class MinimalPublisher(Node):

    def __init__(self):
        super().__init__('minimal_publisher')
        self.publisher_ = self.create_publisher(String, 'topic')
        timer_period = 0.5  # seconds
        self.timer = self.create_timer(timer_period, self.timer_callback)
        self.i = 0

    def timer_callback(self):
        msg = String()
        msg.data = 'Hello World: %d' % self.i
        self.publisher_.publish(msg)
        self.get_logger().info('Publishing: "%s"' % msg.data)
        self.i += 1


def main(args=None):
    rclpy.init(args=args)

    minimal_publisher = MinimalPublisher()

    rclpy.spin(minimal_publisher)

    # Destroy the node explicitly
    # (optional - otherwise it will be done automatically
    # when the garbage collector destroys the node object)
    minimal_publisher.destroy_node()
    rclpy.shutdown()


if __name__ == '__main__':
    main()

Step 6: Compile the package and source the workspace

We have created all the files needed. Now let’s compile.

user:~/ros2_ws/src/ros2_demo_py/ros2_demo_py$ cd /home/user/ros2_ws/
user:~/ros2_ws$ colcon build --symlink-install

Starting >>> ros2_demo_py
Finished <<< ros2_demo_py [0.78s]

Summary: 1 package finished [0.90s]
user:~/ros2_ws$ source install/setup.bash # source the workspace
user:~/ros2_ws$

Step 7: Test-run the package

Here comes the moment of truth…will it run?

user:~/ros2_ws$ ros2 run ros2_demo_py demo
[INFO] [minimal_publisher]: Publishing: "Hello World: 0"
[INFO] [minimal_publisher]: Publishing: "Hello World: 1"
[INFO] [minimal_publisher]: Publishing: "Hello World: 2"
[INFO] [minimal_publisher]: Publishing: "Hello World: 3"
[INFO] [minimal_publisher]: Publishing: "Hello World: 4"
...

Great, it ran! We’re done here!!

Extra 1: ROSject link

Get the ROSject containing all code used in the post in the following link: http://www.rosject.io/l/bd0cfbd/

Extra 2: Video

Prefer to watch a video demonstrating the steps above? We have one for you below!

Related Resources

Feedback

Did you like this post? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.

If you want to learn about other ROS topics, please let us know in the comments area and we will do a video or post about it ?

 

Code edited by Bayode Aderinola

ROS2 Tutorials #4: How to create a ROS2 Package for C++ [NEW]

ROS2 Tutorials #4: How to create a ROS2 Package for C++ [NEW]

About

In this post, you will learn how to create a simple ROS2 package for C++. You don’t need a ROS2 installation for this, as we will use the ROS Development Studio (ROSDS), an online platform that provides access to ROS (1 or 2) computers and other powerful ROS tools within a browser!

PS: If you have ROS2 installed locally on your machine, you can skip Step 1.

Step 1: Create a Project (ROSject) on ROSDS

Head to http://rosds.online and create a project with a similar configuration as the one shown below. You can change the details as you like, but please ensure you select “Ubuntu 18.04 + ROS2 Crystal” under “Configuration”.

Once done with that, open your ROSject. This might take a few moments, please be patient.

Step 2: Source the ROS2 workspace

Once the ROSject is open, head to the Tools menu and pick the Shell tool (if on your local PC just fire up a terminal) and run the following command to source the workspace:

user:~$ source /opt/ros/crystal/setup.bash
ROS_DISTRO was set to 'melodic' before. Please make sure that the environment does not mix paths from different distributions.
user:~$

If you get that ROS_DISTRO warning, just ignore it.

Step 3: Create a ROS2 package in your ROS2 workspace

The syntax for creating a ROS2 package is ros2 pkg create <package_name> --build-type <build_type> --dependencies <dependencies_separated_by_single_space>.

In the same terminal as in Step 2, change to your ROS2 workspace src directory and create a package there:

user:~$ cd ros2_ws/src
user:~/ros2_ws/src$ ros2 pkg create ros2_cpp_pkg --build-type ament_cmake --dependencies rclcpp
going to create a new package
package name: ros2_cpp_pkg
destination directory: /home/user/ros2_ws/src
package format: 2
version: 0.0.0
description: TODO: Package description
maintainer: ['user <user@todo.todo>']
licenses: ['TODO: License declaration']
build type: ament_cmake
dependencies: ['rclcpp']
creating folder ./ros2_cpp_pkg
creating ./ros2_cpp_pkg/package.xml
creating source and include folder
creating folder ./ros2_cpp_pkg/src
creating folder ./ros2_cpp_pkg/include/ros2_cpp_pkg
creating ./ros2_cpp_pkg/CMakeLists.txt
user:~/ros2_ws/src$

Step 4: Create C++ code inside the package

Create a file named ros2_cpp_code.cpp inside the new package:

user:~/ros2_ws/src$ cd ros2_cpp_pkg/src
user:~/ros2_ws/src/ros2_cpp_pkg/src$ touch ros2_cpp_code.cpp
user:~/ros2_ws/src/ros2_cpp_pkg/src$

Pick the IDE from the Tools menu, locate the C++ file and paste in the following code:

#include "rclcpp/rclcpp.hpp"

int main(int argc, char *argv[]) {
  rclcpp::init(argc, argv);
  auto node = rclcpp::Node::make_shared("ObiWan");

  RCLCPP_INFO(node->get_logger(),
              "Help me Obi-Wan Kenobi, you're my only hope");

  rclcpp::shutdown();
  return 0;
}

In the IDE, open up the CMakeLists.txt and paste the following line at the bottom of the file. We are doing this to ensure the C++ file will be properly detected and compiled.

add_executable(cpp_code src/ros2_cpp_code.cpp)
ament_target_dependencies(cpp_code rclcpp)

install(TARGETS
    cpp_code
    DESTINATION lib/${PROJECT_NAME}
)

Step 5: Compile and test-run the package

Now your package is ready to compile…so compile it and source the workspace!

user:~/ros2_ws/src/ros2_cpp_pkg/src$ cd /home/user/ros2_ws
user:~/ros2_ws$ colcon build --symlink-install
Starting >>> ros2_cpp_pkg

Finished <<< ros2_cpp_pkg [21.9s]

Summary: 1 package finished [22.0s]
user:~/ros2_ws$ source install/setup.bash # source the workspace
ROS_DISTRO was set to 'crystal' before. Please make sure that the environment does not mix paths from different distributions. ROS_DISTRO was set to 'melodic' before. Please make sure that the environment does not mix paths from different distributions.
user:~/ros2_ws$

Great. Now test-run it.  You should have the string mentioned in the C++ code printed to the terminal output:

user:~/ros2_ws$ ros2 run ros2_cpp_pkg cpp_code
[INFO] [ObiWan]: Help me Obi-Wan Kenobi, you're my only hope
user:~/ros2_ws$

Done!

Extra 1: ROSject link

Get the ROSject containing all code used in the post in the following link: http://www.rosject.io/l/bce4ffd/!

Extra 2: Video

Prefer to watch a video demonstrating the steps above? We have one for you below!

Related Resources

Feedback

Did you like this post? Do you have questions about what is explained? Whatever the case, please leave a comment on the comments section below, so we can interact and learn from each other.

If you want to learn about other ROS topics, please let us know in the comments area and we will do a video or post about it 🙂

Pin It on Pinterest