Teaching Assistant: Roi Yehoshua

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

© 2011 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
CPSC 441 TUTORIAL – JANUARY 16, 2012 TA: MARYAM ELAHI INTRODUCTION TO C.
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Java Integrated Development Environments: ECLIPSE Part1 Installation.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Multi-Robot Systems with ROS Lesson 1
What is ROS? Robot Operating System
Teaching Assistant: Roi Yehoshua
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Lattice Technology New Product Feature Highlights July 2010 Product Release.
Teaching Assistant: Roi Yehoshua
Ling Chen ( From Shanghai University 1.
Teaching Assistant: Roi Yehoshua
Synopsys Custom Designer Tutorial for a chip integration using the University of Utah Standard Cell Libraries In ON Semiconductor 0.5u C5 CMOS Version.
1 Chapter 12: Form Builder Objects and Flexible Code.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Porting a large scale enterprise application from Tcl/Tk 8.4 to 8.5 Prashant Thakre, Tushar Gupta {prashant_thakre, Gaurav Bansal.
July Doxygen A Code Documentation System Doxygen generates documentation directly from the structure and comments in the code –Browsable HTML documentation.
Teaching Assistant: Roi Yehoshua
Teaching Assistant: Roi Yehoshua
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
CS241 Systems Programming Discussion Section Week 2 Original slides by: Stephen Kloder.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Lecturer: Roi Yehoshua
Lecturer: Roi Yehoshua
Node.js Modules Header Mastering Node.js, Part 2 Eric W. Greene
Lecturer: Roi Yehoshua
Lecturer: Roi Yehoshua
Lecturer: Roi Yehoshua
What is ROS? ROS is an open-source robot operating system
Multi-Robot Systems with ROS Lesson 2
- The Robot Operating System
Lab 1 Introduction to C++.
Quick Introduction to ROS
Robotics and Perception
Robotic Perception and Action
Robotic Perception and Action
Robotic Perception and Action
Working with Libraries
Robot Operating System (ROS): An Introduction
SPL – PS1 Introduction to C++.
Presentation transcript:

Teaching Assistant: Roi Yehoshua

ROS navigation stack with multiple robots Using rviz Sending goals to robots (C)2014 Roi Yehoshua

The navigation stack handles moving a robot from one position to another position safely (without crashing or getting lost) It takes in information from odometry and the sensors, and a goal pose and outputs safe velocity commands (C)2014 Roi Yehoshua

map_server - offers map data as a ROS Service gmapping - provides laser-based SLAM (Simultaneous Localization and Mapping) amcl - a probabilistic localization system global_planner - implementation of a fast global planner for navigation local_planner - implementations of the Trajectory Rollout and Dynamic Window approaches to local robot navigation move_base - links together the global and local planner to accomplish the navigation task (C)2014 Roi Yehoshua

There are three main hardware requirements: – The navigation stack can only handle a differential drive and holonomic wheeled robots. – A planar laser must be mounted on the mobile base of the robot to create the map and localization – Its performance will be best on robots that are nearly square or circular (C)2014 Roi Yehoshua

Download the navigation tutorials from git – This will create a navigation_stack package In the launch directory of the package you will find move_base_multi_robot.launch This is an example launch file for running the navigation stack with multiple robots in stage (C)2014 Roi Yehoshua $ cd ~/ros/stacks $ git clone $ cd ~/ros/stacks $ git clone

(C)2014 Roi Yehoshua – Remove the first argument in the stage_ros node to make stage’s window visible Nodes that are common to all robots:

(C)2014 Roi Yehoshua Nodes for controlling robot 0:

(C)2014 Roi Yehoshua

(C)2014 Roi Yehoshua Nodes for controlling robot 1:

(C)2014 Roi Yehoshua

To run this launch file type: (C)2014 Roi Yehoshua $ roslaunch navigation_stage move_base_multi_robot.launch

(C)2014 Roi Yehoshua

rviz is a ROS 3D visualization tool that lets you see the world from a robot's perspective rviz can help you work with the navigation stack, including: – Displaying all the visualization information that the navigation stack provides, such as the global and local plans and the costmaps – Sending goals to the navigation stack – Setting the initial pose of the robot for a localization system like amcl (C)2014 Roi Yehoshua

By default the origin of the map is different in Stage and rviz In Stage the origin is by default at the center of the map while in rviz it is at the lower-left corner The map’s origin in Stage can be changed by adjusting the floorplan pose in its world file rviz reads the map from the /map topic that is published by map_server Its origin can be changed in the map’s yaml file (C)2014 Roi Yehoshua

Change the map’s pose in Stage world file so the map’s origin will be adjusted to its origin in rviz Also change the robots’ positions accordingly (C)2014 Roi Yehoshua # load an environment bitmap floorplan ( name "willow" bitmap "../maps/willow-full.pgm" size [ ] #pose [ ] pose [ ] ) # throw in a robot #pr2( pose [ ] name "pr2_0" color "blue") #pr2( pose [ ] name "pr2_1" color "green") #block( pose [ ] color "red") pr2( pose [ ] name "pr2_0" color "blue") pr2( pose [ ] name "pr2_1" color "green") block( pose [ ] color "red") # load an environment bitmap floorplan ( name "willow" bitmap "../maps/willow-full.pgm" size [ ] #pose [ ] pose [ ] ) # throw in a robot #pr2( pose [ ] name "pr2_0" color "blue") #pr2( pose [ ] name "pr2_1" color "green") #block( pose [ ] color "red") pr2( pose [ ] name "pr2_0" color "blue") pr2( pose [ ] name "pr2_1" color "green") block( pose [ ] color "red")

(C)2014 Roi Yehoshua

To see the robot’s footprint in rviz change the robot footprint topic to: /robot_N/move_base_node/local_costmap/footprint_ layer/footprint_stamped In our case, the robots have a pentagon-shape – Defined in move_base_config/costmap_common_params.yaml (C)2014 Roi Yehoshua

Add the TF display to watch the TF tree (C)2014 Roi Yehoshua

The 2D nav goal button allows you to send a goal to the navigation by setting a desired pose for the robot to achieve By default the goal is published on the topic /move_base_simple/goal However, when having multiple robots, the topic is /robot_N/move_base_simple/goal To change the topic name, first enable the Tool Properties panel via the Panels menu (C)2014 Roi Yehoshua

Change the 2D Nav Goal topic to /robot_0/move_base_simple/goal Click on the 2D Nav Goal button (or press G) and select the map and the goal for the first robot You can select the x and y position and the end orientation for the robot (C)2014 Roi Yehoshua

To avoid the robots from colliding into each other, change the following definition in willow- pr2-multi.world: (C)2014 Roi Yehoshua define pr2 position ( size [ ] origin [ ] gui_nose 1 drive "omni” topurg(pose [ ]) ) define pr2 position ( size [ ] origin [ ] gui_nose 1 drive "omni” topurg(pose [ ]) )

We will now create a node that will make a given robot to move to a specific location on the map First create a package called navigation_multi that depends on roscpp, rospy, tf, action_lib and move_base_msgs Build the package by calling catkin_make Open the package in Eclipse and add a new source file called print_location.cpp (C)2014 Roi Yehoshua $ cd ~/catkin_ws/src $ catkin_create_pkg navigation_multi roscpp rospy tf actionlib move_base_msgs $ cd ~/catkin_ws/src $ catkin_create_pkg navigation_multi roscpp rospy tf actionlib move_base_msgs

Copy the following directories and files from the navigation_stage package to your package: – Copy the entire directory move_base_config – From the launch directory copy move_base_multi_robot.launch – From stage_config/maps copy willow-full.pgm – From stage_config/worlds copy willow-pr2- multi.world – From the root directory copy multi_robot.rviz (C)2014 Roi Yehoshua

move_base_config files: (C)2014 Roi Yehoshua

Fix move_base.xml to use the correct package: (C)2014 Roi Yehoshua

Fix the package name also in the launch file: (C)2014 Roi Yehoshua

Test that all the configuration is correct by running the launch file: (C)2014 Roi Yehoshua $ roslaunch navigation_multi navigation_multi.launch

Open the project file in Eclipse Under the src subdirectory, create a new file called send_goal.cpp (C)2014 Roi Yehoshua

Open the package in Eclipse and add a new source file called send_goal.cpp Copy the following code into it (C)2014 Roi Yehoshua

#include typedef actionlib::SimpleActionClient MoveBaseClient; using namespace std; int main(int argc, char** argv) { if (argc < 2) { ROS_ERROR("You must specify leader robot id."); return -1; } char *robot_id = argv[1]; ros::init(argc, argv, "send_goals"); ros::NodeHandle nh; // Define the goal double goal_x = 7.45; double goal_y = 18.5; double goal_theta = 0; #include typedef actionlib::SimpleActionClient MoveBaseClient; using namespace std; int main(int argc, char** argv) { if (argc < 2) { ROS_ERROR("You must specify leader robot id."); return -1; } char *robot_id = argv[1]; ros::init(argc, argv, "send_goals"); ros::NodeHandle nh; // Define the goal double goal_x = 7.45; double goal_y = 18.5; double goal_theta = 0;

(C)2014 Roi Yehoshua // Create the string "robot_X/move_base" string move_base_str = "/robot_"; move_base_str += robot_id; move_base_str += "/move_base"; // create the action client MoveBaseClient ac(move_base_str, true); // Wait for the action server to become available ROS_INFO("Waiting for the move_base action server"); ac.waitForServer(ros::Duration(5)); ROS_INFO("Connected to move base server"); // Send a goal to move_base move_base_msgs::MoveBaseGoal goal; goal.target_pose.header.frame_id = "map"; goal.target_pose.header.stamp = ros::Time::now(); goal.target_pose.pose.position.x = goal_x; goal.target_pose.pose.position.y = goal_y; // Create the string "robot_X/move_base" string move_base_str = "/robot_"; move_base_str += robot_id; move_base_str += "/move_base"; // create the action client MoveBaseClient ac(move_base_str, true); // Wait for the action server to become available ROS_INFO("Waiting for the move_base action server"); ac.waitForServer(ros::Duration(5)); ROS_INFO("Connected to move base server"); // Send a goal to move_base move_base_msgs::MoveBaseGoal goal; goal.target_pose.header.frame_id = "map"; goal.target_pose.header.stamp = ros::Time::now(); goal.target_pose.pose.position.x = goal_x; goal.target_pose.pose.position.y = goal_y;

(C)2014 Roi Yehoshua // Convert the Euler angle to quaternion double radians = goal_theta * (M_PI/180); tf::Quaternion quaternion; quaternion = tf::createQuaternionFromYaw(radians); geometry_msgs::Quaternion qMsg; tf::quaternionTFToMsg(quaternion, qMsg); goal.target_pose.pose.orientation = qMsg; ROS_INFO("Sending goal to robot no. %s: x = %f, y = %f, theta = %f", robot_id, goal_x, goal_y, goal_theta); ac.sendGoal(goal); // Wait for the action to return ac.waitForResult(); if (ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED) ROS_INFO("You have reached the goal!"); else ROS_INFO("The base failed for some reason"); return 0; } // Convert the Euler angle to quaternion double radians = goal_theta * (M_PI/180); tf::Quaternion quaternion; quaternion = tf::createQuaternionFromYaw(radians); geometry_msgs::Quaternion qMsg; tf::quaternionTFToMsg(quaternion, qMsg); goal.target_pose.pose.orientation = qMsg; ROS_INFO("Sending goal to robot no. %s: x = %f, y = %f, theta = %f", robot_id, goal_x, goal_y, goal_theta); ac.sendGoal(goal); // Wait for the action to return ac.waitForResult(); if (ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED) ROS_INFO("You have reached the goal!"); else ROS_INFO("The base failed for some reason"); return 0; }

Change the following lines in CMakeLists.txt: Then call catkin_make For example, to send a goal to robot no.1 type: (C)2014 Roi Yehoshua cmake_minimum_required(VERSION 2.8.3) project(tf_multi) … ## Declare a cpp executable add_executable(send_goal src/send_goal.cpp) … ## Specify libraries to link a library or executable target against target_link_libraries(send_goal ${catkin_LIBRARIES}) cmake_minimum_required(VERSION 2.8.3) project(tf_multi) … ## Declare a cpp executable add_executable(send_goal src/send_goal.cpp) … ## Specify libraries to link a library or executable target against target_link_libraries(send_goal ${catkin_LIBRARIES}) $ rosrun navigation_multi send_goal 1

(C)2014 Roi Yehoshua

Initial position:

(C)2014 Roi Yehoshua In the middle of the path:

(C)2014 Roi Yehoshua Final position:

Now let us make the desired pose of the robot configurable in a launch file, so we can send different goals to the robots from the terminal You can define parameters for a node by using the tag in the ROS launch file Create the following send_goals.launch file (C)2014 Roi Yehoshua

Now roslaunch send_goal.launch: (C)2014 Roi Yehoshua

Graph of nodes running in the system: (C)2014 Roi Yehoshua

Implement a simple line formation control for a team of robots More details can be found at: 689/assignment1/Assignment1.html 689/assignment1/Assignment1.html (C)2014 Roi Yehoshua