Giter VIP home page Giter VIP logo

ros-hacks's Introduction

ROS

ROS Hacks Repo

Overview

The repository is designed to make ROS developer's life easier. After the installation usefull aliases and functions will be added to the terminal. Everything was tested on Ubuntu 18.04.2 with ROS Melodic & ROS2 Dashing.

Installation

Make sure that tmux and python-catkin-tools is installed:

sudo apt install tmux python-catkin-tools

Clone the repo into some folder, for example:

git clone https://github.com/yossioo/ROS-Hacks.git ~/.ROS-Hacks

or if you like SSH😉:

git clone [email protected]:yossioo/ROS-Hacks.git ~/.ROS-Hacks

Navigate to the directory and execute the setup.sh script.

cd ~/.ROS-Hacks;  bash setup.sh

The ~/.inputrc file is saved to ~/.inputrc.bak prior to being overwritten.

Defaults for ROS versions are: Melodic for ROS1, and Dashing for ROS2. Adjust in aliases.sh if needed.

Terminal shortcuts

The shortcuts can be run in a new terminal after the installation. Note: re-sourcing ~/.bashrc isn't enough.

Complete list of the shortcuts can be seen in inputrc file. Few of them are presented below:

Shortcut Executed command Description
F3 select_ws Displays ROS workspace selection dialog.
Shift-F3 prompt_new_ws Displays new ROS workspace creation dialog.
F5 source ~/.bashrc You know what it does :)
F9 rebuild_curr_ws Re-builds the currently selected workspace and sources it.
Shift-F12 set-quick-command Saves currently typed-in command for quick-launch1.
F12 exec-quick-command Executes the saved command in detached tmux session.
... .... .......

1 The function is primarily targeted for quick launching and killing of Gazebo worlds using various roslaunch commands. A quick execution commands are saved for each workspace separately.

Example of usage of Quick Command: Type in terminal roslaunch gazebo_ros empty_world.launch, hit Shift-F12. The command will be saved for currently sourced workspace. Hit F12 to execute the command in background tmux session. The Gazebo client GUI will show up. Hit Ctrl-F12 to stop the session, killing Gazebo along with all ROS nodes (currently only on ROS1).

Aliases

Complete list of the aliases can be seen in aliases.sh file. Few of them are presented below:

Alias Expanded command Description
sc source_ws $(cat $WS_FILE) Sources the currently selected workspace.
o sudo chown -R $USER:$USER Allows easy ownership change for selected files.
x chmod +x Adds execution permissions for desired files.
... .... .......

Functions

Quick Launch

Function Description
set-quick-command Saves the command for further use.
get-quick-command Loads the command.
print-quick-command Displays the command.
exec-quick-command Executes the command in background tmux session.
kill-tmux-quick-command Ends the execution of the tmux session, along with Gazebo and ALL ROS nodes.
... ....

ROS Workspace

A simple UI for ROS workspace creation and selection is defined in several functions.

Function Description
select_ws Shows dialog for WS selections
prompt_new_ws Shows dialog for new ROS workspace creation (ROS1/ROS2).
rebuild_curr_ws Rebuilds ROS workspace (ROS1 - catkin/ROS2 - colcon).
... ....

Miscellaneous

Function Description
RM Sets ROS_MASTER_URI variable, optionally in local network.
rt Executes rostopic with grep for desired argument.
fixJB Updates JetBrains' shortcuts for CLion and PyCharm to be launched within ROS workspace.
unROS Cleans all ROS-related environment variables.
... ....

Removal

Clear ~/.bashrc file from the added lines. Delete the repo. Voilà!

ros-hacks's People

Contributors

yossioo avatar yossio-bwr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.