Skip to content

hardik01shah/ros-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

ros-commands

This repo has all the important ros commands.

Setting up the workspace:

cd <path to catkin_ws>
catkin_make
source devel/setup.bash
roscore

Creating a package:

catkin_create_pkg <package-name> <dependencies>

For e.g.

catkin_create_pkg test rospy nav_msgs sensor_msgs

Running a file:

cd <path to folder containing the script>

Make an executable

chmod +x <script_name>

Edit Cmakelists also and add the script name:

install(PROGRAMS
scripts/filename
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
Run

./<script_name>

or

rosrun <package name> <script name>

Important for debugging:

To inspect what is being published on a topic:

rostopic echo /topicname

To view the rqt_graph

rosrun rqt_graph rqt_graph 

To view the tf_tree

rosrun rqt_tf_tree rqt_tf_tree

To view the statements passed using rospy.loginfo()

rostopic echo /rosout

Gazebo:

rosrun gazebo_ros gazebo

RViZ:

rosrun rviz rviz

For setting up the entire tf_tree for visualization of robot model in RViZ

rosrun robot_state_publisher robot_state_publisher

Turtlebot3:

Installation

sudo apt-get install ros-melodic-turtlebot3-*

Run this command before every turtlebot3 command to set the model. value can be waffle_pi, waffle, burger

export TURTLEBOT3_MODEL=<value>

SLAM Gmapping:

Installation

sudo apt-get install ros-melodic-slam-gmapping

Launch

roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping

Navigation:

Installation

sudo apt-get install ros-melodic-dwa-local-planner

Launch

roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=<path to map file>

For e.g.

roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=/home/hardik/map.yaml

Launch in gazebo:

roslaunch turtlebot3_gazebo turtlebot3_house.launch
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
roslaunch turtlebot3_gazebo turtlebot3_world.launch

Teleop Launch

roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

Save a map created using SLAM:

rosrun map_server map_saver

Rosbridge suite launch:

Installation

sudo apt-get install ros-<rosdistro>-rosbridge-server

Check IP address

hostname -I

Launch

roslaunch rosbridge_server rosbridge_websocket.launch

Husky:

Installation

sudo apt-get install ros-melodic-husky-*

Gazebo Launch

roslaunch husky_gazebo husky_empty_world.launch
roslaunch husky_gazebo husky_playpen.launch

Releases

No releases published

Packages

No packages published