If neccesary:
sudo apt-get update
sudo apt-get upgrade
Then:
cd ~/catkin_ws/src/
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git -b noetic-devel
| import os | |
| from launch import LaunchDescription | |
| from launch.actions import DeclareLaunchArgument, ExecuteProcess, IncludeLaunchDescription | |
| from launch.substitutions import Command, LaunchConfiguration | |
| from launch.launch_description_sources import PythonLaunchDescriptionSource | |
| from launch_ros.actions import Node | |
| from ament_index_python.packages import get_package_share_directory | |
| def generate_launch_description(): |
If neccesary:
sudo apt-get update
sudo apt-get upgrade
Then:
cd ~/catkin_ws/src/
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git -b noetic-devel
| import rclpy | |
| from sensor_msgs.msg import LaserScan | |
| from rclpy.qos import ReliabilityPolicy, QoSProfile | |
| def scan_callback(msg): | |
| global g_node | |
| g_node.get_logger().info('Number of rays: "%d"' % len(msg.ranges)) | |
| g_node.get_logger().info('Angle of first ray: "%.2f"' % msg.angle_min) | |
| g_node.get_logger().info('Angle of last ray: "%.2f"' % msg.angle_max) | |
| g_node.get_logger().info('Total angular area of coverage: "%.2f"' % (msg.angle_max-msg.angle_min)) |
| cmake_minimum_required(VERSION 3.8) | |
| project(my_package) | |
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
| add_compile_options(-Wall -Wextra -Wpedantic) | |
| endif() | |
| # find dependencies | |
| find_package(ament_cmake REQUIRED) | |
| # uncomment the following section in order to fill in |
| #!/usr/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| import os | |
| from ament_index_python.packages import get_package_prefix | |
| from ament_index_python.packages import get_package_share_directory | |
| from launch import LaunchDescription | |
| from launch.actions import DeclareLaunchArgument | |
| from launch.actions import IncludeLaunchDescription | |
| from launch.conditions import IfCondition |
| """Launch Gazebo server and client with command line arguments.""" | |
| """Spawn robot from URDF file.""" | |
| import os | |
| from ament_index_python.packages import get_package_share_directory | |
| from launch import LaunchDescription | |
| from launch.actions import ExecuteProcess | |
| from launch.substitutions import LaunchConfiguration | |
| def generate_launch_description(): |
| #!/usr/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| import os | |
| from ament_index_python.packages import get_package_share_directory | |
| from launch import LaunchDescription | |
| from launch.actions import DeclareLaunchArgument | |
| from launch.actions import IncludeLaunchDescription | |
| from launch.launch_description_sources import PythonLaunchDescriptionSource |
| """Launch Gazebo server and client via include and launch the gazebo.launch.py file.""" | |
| import os | |
| from launch import LaunchDescription | |
| from launch.actions import IncludeLaunchDescription | |
| from launch.launch_description_sources import PythonLaunchDescriptionSource | |
| from ament_index_python.packages import get_package_share_directory | |
| def generate_launch_description(): |
| """Launch Gazebo server and client with command line arguments.""" | |
| from launch import LaunchDescription | |
| from launch.actions import ExecuteProcess | |
| def generate_launch_description(): | |
| return LaunchDescription([ |
| #!/usr/bin/env python | |
| """ | |
| Rviz point cloud visualization marker example | |
| Author: Roberto Zegers R. | |
| Copyright: Copyright (c) 2021, Roberto Zegers R. | |
| License: BSD-3-Clause | |
| Date: March 2021 | |
| """ |