FANUC America and the Manufacturing Skill Standards Council (MSSC) Agree to Co-market the Stackability of Their Certifications to Meet the Shortage of Skilled Industrial Robotics and Automation Operators
Grip or slip: Robots need a human sense of touch
Exploring ROS2 with a wheeled robot – #4 – Obstacle avoidance

By Marco Arruda
In this post you’ll learn how to program a robot to avoid obstacles using ROS2 and C++. Up to the end of the post, the Dolly robot moves autonomously in a scene with many obstacles, simulated using Gazebo 11.
You’ll learn:
- How to publish AND subscribe topics in the same ROS2 Node
- How to avoid obstacles
- How to implement your own algorithm in ROS2 and C++
1 – Setup environment – Launch simulation
Before anything else, make sure you have the rosject from the previous post, you can copy it from here.
Launch the simulation in one webshell and in a different tab, checkout the topics we have available. You must get something similar to the image below:

2 – Create the node
In order to have our obstacle avoidance algorithm, let’s create a new executable in the file ~/ros2_ws/src/my_package/obstacle_avoidance.cpp:
#include "geometry_msgs/msg/twist.hpp" // Twist #include "rclcpp/rclcpp.hpp" // ROS Core Libraries #include "sensor_msgs/msg/laser_scan.hpp" // Laser Scan using std::placeholders::_1; class ObstacleAvoidance : public rclcpp::Node { public: ObstacleAvoidance() : Node("ObstacleAvoidance") { auto default_qos = rclcpp::QoS(rclcpp::SystemDefaultsQoS()); subscription_ = this->create_subscription( "laser_scan", default_qos, std::bind(&ObstacleAvoidance::topic_callback, this, _1)); publisher_ = this->create_publisher("cmd_vel", 10); } private: void topic_callback(const sensor_msgs::msg::LaserScan::SharedPtr _msg) { // 200 readings, from right to left, from -57 to 57 degress // calculate new velocity cmd float min = 10; for (int i = 0; i < 200; i++) { float current = _msg->ranges[i]; if (current < min) { min = current; } } auto message = this->calculateVelMsg(min); publisher_->publish(message); } geometry_msgs::msg::Twist calculateVelMsg(float distance) { auto msg = geometry_msgs::msg::Twist(); // logic RCLCPP_INFO(this->get_logger(), "Distance is: '%f'", distance); if (distance < 1) { // turn around msg.linear.x = 0; msg.angular.z = 0.3; } else { // go straight ahead msg.linear.x = 0.3; msg.angular.z = 0; } return msg; } rclcpp::Publisher::SharedPtr publisher_; rclcpp::Subscription::SharedPtr subscription_; }; int main(int argc, char *argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared()); rclcpp::shutdown(); return 0; }
In the main function we have:
- Initialize node rclcpp::init
- Keep it running rclcpp::spin
Inside the class constructor:
- Subcribe to the laser scan messages: subscription_
- Publish to the robot diff driver: publisher_
The obstacle avoidance intelligence goes inside the method calculateVelMsg. This is where decisions are made based on the laser readings. Notice that is depends purely on the minimum distance read from the message.
If you want to customize it, for example, consider only the readings in front of the robot, or even check if it is better to turn left or right, this is the place you need to work on! Remember to adjust the parameters, because the way it is, only the minimum value comes to this method.
3 – Compile the node
This executable depends on both geometry_msgs and sensor_msgs, that we have added in the two previous posts of this series. Make sure you have them at the beginning of the ~/ros2_ws/src/my_package/CMakeLists.txt file:
# find dependencies find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(geometry_msgs REQUIRED) find_package(sensor_msgs REQUIRED)
And finally, add the executable and install it:
# obstacle avoidance add_executable(obstacle_avoidance src/obstacle_avoidance.cpp) ament_target_dependencies(obstacle_avoidance rclcpp sensor_msgs geometry_msgs) ... install(TARGETS reading_laser moving_robot obstacle_avoidance DESTINATION lib/${PROJECT_NAME}/ )
Compile the package:
colcon build --symlink-install --packages-select my_package
4 – Run the node
In order to run, use the following command:
ros2 run my_package obstacle_avoidance
It will not work for this robot! Why is that? We are subscribing and publishing to generic topics: cmd_vel and laser_scan.
We need a launch file to remap these topics, let’s create one at ~/ros2_ws/src/my_package/launch/obstacle_avoidance.launch.py:
from launch import LaunchDescription from launch_ros.actions import Node def generate_launch_description(): obstacle_avoidance = Node( package='my_package', executable='obstacle_avoidance', output='screen', remappings=[ ('laser_scan', '/dolly/laser_scan'), ('cmd_vel', '/dolly/cmd_vel'), ] ) return LaunchDescription([obstacle_avoidance])
Recompile the package, source the workspace once more and launch it:
colcon build --symlink-install --packages-select my_package
source ~/ros2_ws/install/setup.bash
ros2 launch my_package obstacle_avoidance.launch.py

Related courses & extra links:
The post Exploring ROS2 with a wheeled robot – #4 – Obstacle Avoidance appeared first on The Construct.
Stanford engineers build bird bots that can perch and grab objects
Team builds first living robots that can reproduce

AI-designed (C-shaped) organisms push loose stem cells (white) into piles as they move through their environment. Credit: Douglas Blackiston and Sam Kriegman
By Joshua Brown, University of Vermont Communications
To persist, life must reproduce. Over billions of years, organisms have evolved many ways of replicating, from budding plants to sexual animals to invading viruses.
Now scientists at the University of Vermont, Tufts University, and the Wyss Institute for Biologically Inspired Engineering at Harvard University have discovered an entirely new form of biological reproduction—and applied their discovery to create the first-ever, self-replicating living robots.
The same team that built the first living robots (“Xenobots,” assembled from frog cells—reported in 2020) has discovered that these computer-designed and hand-assembled organisms can swim out into their tiny dish, find single cells, gather hundreds of them together, and assemble “baby” Xenobots inside their Pac-Man-shaped “mouth”—that, a few days later, become new Xenobots that look and move just like themselves.
And then these new Xenobots can go out, find cells, and build copies of themselves. Again and again.
“With the right design—they will spontaneously self-replicate,” says Joshua Bongard, Ph.D., a computer scientist and robotics expert at the University of Vermont who co-led the new research.
The results of the new research were published in the Proceedings of the National Academy of Sciences.
Into the Unknown
In a Xenopus laevis frog, these embryonic cells would develop into skin. “They would be sitting on the outside of a tadpole, keeping out pathogens and redistributing mucus,” says Michael Levin, Ph.D., a professor of biology and director of the Allen Discovery Center at Tufts University and co-leader of the new research. “But we’re putting them into a novel context. We’re giving them a chance to reimagine their multicellularity.” Levin is also an Associate Faculty member at the Wyss Institute.

As Pac-man-shaped Xenobot “parents” move around their environment, they collect loose stem cells in their “mouths” that, over time, aggregate to create “offspring” Xenobots that develop to look just like their creators. Credit: Doug Blackiston and Sam Kriegman
And what they imagine is something far different than skin. “People have thought for quite a long time that we’ve worked out all the ways that life can reproduce or replicate. But this is something that’s never been observed before,” says co-author Douglas Blackiston, Ph.D., the senior scientist at Tufts University and the Wyss Institute who assembled the Xenobot “parents” and developed the biological portion of the new study.
“This is profound,” says Levin. “These cells have the genome of a frog, but, freed from becoming tadpoles, they use their collective intelligence, a plasticity, to do something astounding.” In earlier experiments, the scientists were amazed that Xenobots could be designed to achieve simple tasks. Now they are stunned that these biological objects—a computer-designed collection of cells—will spontaneously replicate. “We have the full, unaltered frog genome,” says Levin, “but it gave no hint that these cells can work together on this new task,” of gathering and then compressing separated cells into working self-copies.
“These are frog cells replicating in a way that is very different from how frogs do it. No animal or plant known to science replicates in this way,” says Sam Kriegman, Ph.D., the lead author on the new study, who completed his Ph.D. in Bongard’s lab at UVM and is now a post-doctoral researcher at Tuft’s Allen Center and Harvard University’s Wyss Institute for Biologically Inspired Engineering.
On its own, the Xenobot parent, made of some 3,000 cells, forms a sphere. “These can make children but then the system normally dies out after that. It’s very hard, actually, to get the system to keep reproducing,” says Kriegman. But with an artificial intelligence program working on the Deep Green supercomputer cluster at UVM’s Vermont Advanced Computing Core, an evolutionary algorithm was able to test billions of body shapes in simulation—triangles, squares, pyramids, starfish—to find ones that allowed the cells to be more effective at the motion-based “kinematic” replication reported in the new research.
“We asked the supercomputer at UVM to figure out how to adjust the shape of the initial parents, and the AI came up with some strange designs after months of chugging away, including one that resembled Pac-Man,” says Kriegman. “It’s very non-intuitive. It looks very simple, but it’s not something a human engineer would come up with. Why one tiny mouth? Why not five? We sent the results to Doug and he built these Pac-Man-shaped parent Xenobots. Then those parents built children, who built grandchildren, who built great-grandchildren, who built great-great-grandchildren.” In other words, the right design greatly extended the number of generations.
Kinematic replication is well-known at the level of molecules—but it has never been observed before at the scale of whole cells or organisms.

An AI-designed “parent” organism (C shape; red) beside stem cells that have been compressed into a ball (“offspring”; green). Credit: Douglas Blackiston and Sam Kriegman
“We’ve discovered that there is this previously unknown space within organisms, or living systems, and it’s a vast space,” says Bongard. “How do we then go about exploring that space? We found Xenobots that walk. We found Xenobots that swim. And now, in this study, we’ve found Xenobots that kinematically replicate. What else is out there?”
Or, as the scientists write in the Proceedings of the National Academy of Sciences study: “life harbors surprising behaviors just below the surface, waiting to be uncovered.”
Responding to Risk
Some people may find this exhilarating. Others may react with concern, or even terror, to the notion of a self-replicating biotechnology. For the team of scientists, the goal is deeper understanding.
“We are working to understand this property: replication. The world and technologies are rapidly changing. It’s important, for society as a whole, that we study and understand how this works,” says Bongard. These millimeter-sized living machines, entirely contained in a laboratory, easily extinguished, and vetted by federal, state and institutional ethics experts, “are not what keep me awake at night. What presents risk is the next pandemic; accelerating ecosystem damage from pollution; intensifying threats from climate change,” says UVM’s Bongard. “This is an ideal system in which to study self-replicating systems. We have a moral imperative to understand the conditions under which we can control it, direct it, douse it, exaggerate it.”
Bongard points to the COVID epidemic and the hunt for a vaccine. “The speed at which we can produce solutions matters deeply. If we can develop technologies, learning from Xenobots, where we can quickly tell the AI: ‘We need a biological tool that does X and Y and suppresses Z,’ —that could be very beneficial. Today, that takes an exceedingly long time.” The team aims to accelerate how quickly people can go from identifying a problem to generating solutions—”like deploying living machines to pull microplastics out of waterways or build new medicines,” Bongard says.
“We need to create technological solutions that grow at the same rate as the challenges we face,” Bongard says.
And the team sees promise in the research for advancements toward regenerative medicine. “If we knew how to tell collections of cells to do what we wanted them to do, ultimately, that’s regenerative medicine—that’s the solution to traumatic injury, birth defects, cancer, and aging,” says Levin. “All of these different problems are here because we don’t know how to predict and control what groups of cells are going to build. Xenobots are a new platform for teaching us.”
The scientists behind the Xenobots participated in a live panel discussion on December 1, 2021 to discuss the latest developments in their research. Credit: Wyss Institute at Harvard University
Real2sim2real: A self-supervised learning technique applied to planar robot casting
Robots on Their Own – Fully Automatic Picking of Unknown Products From Bulk Material
Light-powered soft robots could suck up oil spills
Physical texture of robots influences judgments of their personality
COVID-19 mobile robot could detect and tackle social distancing breaches
Engineers create perching bird-like robot
Why AMRs Are Being Adopted On Factory Floors
Exploring ROS2 using wheeled Robot – #3 – Moving the robot
By Marco Arruda
In this post you’ll learn how to publish to a ROS2 topic using ROS2 C++. Up to the end of the video, we are moving the robot Dolly robot, simulated using Gazebo 11.
You’ll learn:
- How to create a node with ROS2 and C++
- How to public to a topic with ROS2 and C++
1 – Setup environment – Launch simulation
Before anything else, make sure you have the rosject from the previous post, you can copy it from here.
Launch the simulation in one webshell and in a different tab, checkout the topics we have available. You must get something similar to the image below:

2 – Create a topic publisher
Create a new file to container the publisher node: moving_robot.cpp and paste the following content:
#include <chrono> #include <functional> #include <memory> #include "rclcpp/rclcpp.hpp" #include "geometry_msgs/msg/twist.hpp" using namespace std::chrono_literals; /* This example creates a subclass of Node and uses std::bind() to register a * member function as a callback from the timer. */ class MovingRobot : public rclcpp::Node { public: MovingRobot() : Node("moving_robot"), count_(0) { publisher_ = this->create_publisher("/dolly/cmd_vel", 10); timer_ = this->create_wall_timer( 500ms, std::bind(&MovingRobot::timer_callback, this)); } private: void timer_callback() { auto message = geometry_msgs::msg::Twist(); message.linear.x = 0.5; message.angular.z = 0.3; RCLCPP_INFO(this->get_logger(), "Publishing: '%f.2' and %f.2", message.linear.x, message.angular.z); publisher_->publish(message); } rclcpp::TimerBase::SharedPtr timer_; rclcpp::Publisher::SharedPtr publisher_; size_t count_; }; int main(int argc, char *argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared()); rclcpp::shutdown(); return 0; }QoS (Quality of Service)
Similar to the subscriber it is created a class that inherits Node. A publisher_ is setup and also a callback, although this time is not a callback that receives messages, but a timer_callback called in a frequency defined by the timer_ variable. This callback is used to publish messages to the robot.
The create_publisher method needs two arguments:
- topic name
- QoS (Quality of Service) – This is the policy of data saved in the queue. You can make use of different middlewares or even use some provided by default. We are just setting up a queue of 10. By default, it keeps the last 10 messages sent to the topic.
The message published must be created using the class imported:
message = geometry_msgs::msg::Twist();
We ensure the callback methods on the subscribers side will always recognize the message. This is the way it has to be published by using the publisher method publish.
3 – Compile and run the node
In order to compile we need to adjust some things in the ~/ros2_ws/src/my_package/CMakeLists.txt. So add the following to the file:
- Add the geometry_msgs dependency
- Append the executable moving_robot
- Add install instruction for moving_robot
find_package(geometry_msgs REQUIRED) ... # moving robot add_executable(moving_robot src/moving_robot.cpp) ament_target_dependencies(moving_robot rclcpp geometry_msgs) ... install(TARGETS moving_robot reading_laser DESTINATION lib/${PROJECT_NAME}/ )
We can run the node like below:
source ~/ros2_ws/install/setup.bash
ros2 run my_package

Related courses & extra links:
The post Exploring ROS2 using wheeled Robot – #3 – Moving the Robot
appeared first on The Construct.
Exploring ROS2 using wheeled Robot – #3 – Moving the robot
By Marco Arruda
In this post you’ll learn how to publish to a ROS2 topic using ROS2 C++. Up to the end of the video, we are moving the robot Dolly robot, simulated using Gazebo 11.
You’ll learn:
- How to create a node with ROS2 and C++
- How to public to a topic with ROS2 and C++
1 – Setup environment – Launch simulation
Before anything else, make sure you have the rosject from the previous post, you can copy it from here.
Launch the simulation in one webshell and in a different tab, checkout the topics we have available. You must get something similar to the image below:

2 – Create a topic publisher
Create a new file to container the publisher node: moving_robot.cpp and paste the following content:
#include <chrono> #include <functional> #include <memory> #include "rclcpp/rclcpp.hpp" #include "geometry_msgs/msg/twist.hpp" using namespace std::chrono_literals; /* This example creates a subclass of Node and uses std::bind() to register a * member function as a callback from the timer. */ class MovingRobot : public rclcpp::Node { public: MovingRobot() : Node("moving_robot"), count_(0) { publisher_ = this->create_publisher("/dolly/cmd_vel", 10); timer_ = this->create_wall_timer( 500ms, std::bind(&MovingRobot::timer_callback, this)); } private: void timer_callback() { auto message = geometry_msgs::msg::Twist(); message.linear.x = 0.5; message.angular.z = 0.3; RCLCPP_INFO(this->get_logger(), "Publishing: '%f.2' and %f.2", message.linear.x, message.angular.z); publisher_->publish(message); } rclcpp::TimerBase::SharedPtr timer_; rclcpp::Publisher::SharedPtr publisher_; size_t count_; }; int main(int argc, char *argv[]) { rclcpp::init(argc, argv); rclcpp::spin(std::make_shared()); rclcpp::shutdown(); return 0; }QoS (Quality of Service)
Similar to the subscriber it is created a class that inherits Node. A publisher_ is setup and also a callback, although this time is not a callback that receives messages, but a timer_callback called in a frequency defined by the timer_ variable. This callback is used to publish messages to the robot.
The create_publisher method needs two arguments:
- topic name
- QoS (Quality of Service) – This is the policy of data saved in the queue. You can make use of different middlewares or even use some provided by default. We are just setting up a queue of 10. By default, it keeps the last 10 messages sent to the topic.
The message published must be created using the class imported:
message = geometry_msgs::msg::Twist();
We ensure the callback methods on the subscribers side will always recognize the message. This is the way it has to be published by using the publisher method publish.
3 – Compile and run the node
In order to compile we need to adjust some things in the ~/ros2_ws/src/my_package/CMakeLists.txt. So add the following to the file:
- Add the geometry_msgs dependency
- Append the executable moving_robot
- Add install instruction for moving_robot
find_package(geometry_msgs REQUIRED) ... # moving robot add_executable(moving_robot src/moving_robot.cpp) ament_target_dependencies(moving_robot rclcpp geometry_msgs) ... install(TARGETS moving_robot reading_laser DESTINATION lib/${PROJECT_NAME}/ )
We can run the node like below:
source ~/ros2_ws/install/setup.bash
ros2 run my_package

Related courses & extra links:
The post Exploring ROS2 using wheeled Robot – #3 – Moving the Robot
appeared first on The Construct.