0% found this document useful (0 votes)
19 views

Unit 2 ROS Command & Tool (2)_new

For learning Robot operating system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Unit 2 ROS Command & Tool (2)_new

For learning Robot operating system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Unit 2 ROS Command

& Tool

Date:07/02/2024
Operating System Firmware:
Ros Shell
• command-line interface (CLI) known as the "ROS shell" or simply "ROS
command line" (roscmd).
• This shell allows users to interact with ROS nodes, topics, messages,
services, parameters, and other ROS components.
• Users can use the shell to start and stop nodes, inspect topics, publish
and subscribe to messages, call services, and perform various other
tasks related to controlling and monitoring ROS-based robotic
systems.
Shell is broadly classified into two categories –

• Command Line Shell


• Graphical shell
• Shell can be accessed by
users using a command line
interface.
• A special program called
Terminal in Linux/Ubuntu,
or Command Prompt in
Windows OS is provided to
type in the human-readable
commands such as “rosrun”,
“ls” etc. and then it is being
executed.
• Graphical shells provide means for manipulating programs based on
the graphical user interface (GUI), by allowing for operations such as
opening, closing, moving, and resizing windows, as well as switching
focus between windows.
What is a terminal?
List of ROS Shell Command
• roscore: Starts the ROS master, which provides naming and registration
services to the rest of the ROS system.
• rosrun: Runs a specific ROS node from a ROS package.
• roslaunch: Launches one or more ROS nodes defined in a launch file.
• rosnode: Provides information about ROS nodes, such as listing active
nodes or showing information about a specific node.
• rostopic: Allows users to get information about ROS topics, including listing
topics, displaying messages on a topic, or publishing messages to a topic.
• rosservice: Provides a way to interact with ROS services, including listing
available services, calling a service, or advertising a new service.
• rosparam: Manages ROS parameters, which are key-value pairs that
can be used to store configuration data.
• rosmsg and rossrv: These commands provide information about ROS
message and service types, respectively.
• rosbag: Records and plays back ROS message data, which can be
useful for testing and debugging.
• rosrun rqt_console rqt_console: Launches a graphical tool for viewing
ROS log messages.
• rosrun rqt_graph rqt_graph: Launches a graphical tool for visualizing
the ROS computation graph.
Advantages
• Efficiency
• Flexibility
• Automation
• Integration
• Debugging
• Portability
ROS Catkin:
• ROS Catkin is the build system used in the Robot Operating System
(ROS) for building and managing ROS packages.
ROS Package?
• In the Robot Operating System (ROS), a "ROS package" is a
fundamental unit of software organization.
• It's a directory structure that contains all the necessary files and
configurations to implement a specific functionality or feature within
a ROS system.
• ROS packages are used to organize and distribute software
components for robotic systems.
Characteristics of Package:
• Directory Structure:
• Package Manifest (package.xml): Each ROS package contains a
package manifest file named package.xml. This XML file provides
metadata about the package, including its name, version, description,
dependencies, and other information required for building and using
the package within a ROS system.
• Source Code: ROS packages often contain source code written in
programming languages such as C++, Python, or others, depending on
the requirements of the package. This source code implements the
functionality provided by the package, such as ROS nodes, libraries, or
utility scripts.
• Configuration Files: ROS packages may include configuration files, launch
files, parameter files, and other files needed to configure and run the
package within a ROS system. These files define how the package interacts
with other ROS nodes and components.
• Message and Service Definitions: If the package defines custom message
types or service types, it may include message (.msg) and service (.srv)
definition files in the msg and srv directories, respectively. These files
specify the data structures and interfaces used by the ROS nodes within the
package.
• Dependencies: ROS packages can depend on other ROS packages or system
dependencies. These dependencies are specified in the package.xml file,
and they indicate the other packages or libraries that must be installed or
available for the package to build and run successfully.
ROS Package commands
Exercise
Q. Run a ros node in circular direction using turtlesim simulater.

Step1
1. Open a terminal.
2. Navigate to your ROS workspace's ‘src’directory. (catkin_ws/src)
3. Create a new ROS package using catkin_create_pkg
command.
Step 2: Write the Python Node

Navigate to the src directory of your ROS package


(e.g. catkin_ws/src/my_circular_movement_pkg/src

Open the Python script in a text editor and write the code.
Here's an example code for making a turtle move in a
circular direction:

(Write code )

You might also like