Commit 0a576b21 authored by CANNERE Xavier's avatar CANNERE Xavier
Browse files

7.1.1

parent 41b1daa4
......@@ -15,4 +15,5 @@ Welcome to my ROS2 Tutorial!
./topic4/t4.rst
./topic5/t5.rst
./topic6/t6.rst
./topic7/t7.rst
ROS2 : 1/? Create a visual follower
===================================
ROS2 : Create a visual follower
===============================
We'll learn how launch ROS1 nodes with ROS2 nodes. In this example we'll see a follower robot with a camera (same concept as the sensorfollower but he will detect target with the color) in ROS2 with a node that allows object recognition.
......@@ -83,7 +83,7 @@ Make sure your code looks like this::
{
public:
Visual()
: Node("visu")
: Node("visual")
{
}
......@@ -160,7 +160,7 @@ After that you can put on comment the *RCLCPP* lines, there were here to test th
{
public:
Visual()
: Node("visu")
: Node("visual")
{
auto sensor_qos = rclcpp::QoS(rclcpp::SensorDataQoS());
img_ = this->create_subscription<sensor_msgs::msg::Image>(
......@@ -366,7 +366,7 @@ Your main files should look like this::
{
public:
Visual()
: Node("visu")
: Node("visual")
{
auto sensor_qos = rclcpp::QoS(rclcpp::SensorDataQoS());
img_ = this->create_subscription<sensor_msgs::msg::Image>(
......@@ -464,7 +464,7 @@ You should have this code::
{
public:
Visual()
: Node("visu")
: Node("visual")
{
this->declare_parameter<std::uint8_t>("blue", 180);
this->declare_parameter<std::uint8_t>("green", 100);
......@@ -593,7 +593,7 @@ You should have this final code::
{
public:
Visual()
: Node("visu")
: Node("visual")
{
this->declare_parameter<std::uint8_t>("blue", 180);
this->declare_parameter<std::uint8_t>("green", 100);
......
Use a bridge between ROS1 & ROS2
================================
Step 1 :
--------
Start your node, then type on a new terminal::
. /opt/ros/noetic/setup.bash
roscore
That source ros1 and open the roscore which is necessary to use ros1
And in an other new terminal::
. /opt/ros/noetic/setup.bash
ros2 run ros1_bridge dynamic_bridge --bridge-all-topics
That launch the node which will do the bridge between ros1 and ros2
.. warning::
In every new terminal you launch you have to source ros1 (``. /opt/ros/noetic/setup.bash``)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment