GithubHelp home page GithubHelp logo

qboticslabs / mastering_ros Goto Github PK

View Code? Open in Web Editor NEW
464.0 31.0 279.0 9.53 MB

This repository contains exercise files of the book "Mastering ROS for Robotics Programming"

Home Page: https://www.packtpub.com/hardware-and-creative/mastering-ros-robotics-programming

CMake 8.46% Python 36.64% C++ 52.62% Shell 0.01% C 0.67% Makefile 1.60%
robotics-programming ros ros-moveit gazebo tutorial amazon sensor robot-framework robotframework robotics-book

mastering_ros's Introduction

Mastering ROS for Robotics Programming

Mastering ROS for Robotics Programming book tutorials source code

book_cover

Buy book

Author

Installation

The code is compatible with ROS Jade and ROS Indigo. The detail installation instruction of each package is mentioned on the book

Tutorials

  • Chapter 1: Introduction to ROS and its Package Management
  • Chapter 2: Working with 3D Robot Modeling in ROS
  • Chapter 3: Simulating Robots Using ROS and Gazebo
  • Chapter 4: Using ROS MoveIt! and Navigation stack
  • Chapter 5: Working with Pluginlib, Nodelets and Gazebo plugins
  • Chapter 6: Writing ROS Controllers and Visualization plugins
  • Chapter 7: Interfacing I/O boards, sensors and actuators to ROS
  • Chapter 8: Programming Vision sensors using ROS, Open-CV and PCL
  • Chapter 9: Building and interfacing a differential drive mobile robot hardware in ROS
  • Chapter 10: Exploring advanced capabilities of ROS-MoveIt!
  • Chapter 11: ROS for Industrial Robots
  • Chapter 12: Troubleshooting and best practices in ROS

ROS Robotics Projects

book_cover

Buy book

Author

Installation

The code is comaptible with ROS Kinetic and ROS Indigo. The detail installation instruction of each packages is mentioned on the book

Tutorials

  • Chapter 1: Getting Started with ROS Robotics Application Development
  • Chapter 2: Face Detection and Tracking Using ROS, OpenCV and Dynamixel Servos
  • Chapter 3: Building a Siri-Like Chatbot in ROS
  • Chapter 4: Controlling Embedded Boards Using ROS
  • Chapter 5: Teleoperate a Robot Using Hand Gestures
  • Chapter 6: Object Detection and Recognition
  • Chapter 7: Deep Learning Using ROS and TensorFlow
  • Chapter 8: ROS on MATLAB and Android
  • Chapter 9: Building an Autonomous Mobile Robot
  • Chapter 10: Creating a Self-driving Car Using ROS!
  • Chapter 11: Teleoperating Robot Using VR Headset and Leap Motion
  • Chapter 12: Controlling Your Robots over the Web

Learning Robotics using Python

Learning Robotics using Python book tutorials source code

book_cover

Buy book

Author

Installation

The code is comaptible with ROS Jade and ROS Indigo. The detail installation instruction of each packages is mentioned on the book

Tutorials

  • Chapter 1: Introduction to Robotics
  • Chapter 2: Mechanical design of a service Robot
  • Chapter 3: Working with Robot Simulation using ROS and Gazebo
  • Chapter 4: Designing Chefbot Hardware
  • Chapter 5: Working with Robotic Actuators and Wheel Encoders
  • Chapter 6: Working with Robotic Sensors
  • Chapter 7: Programming Vision Sensors using Python and ROS
  • Chapter 8: Working with Speech Recognition and Synthesis using Python and ROS
  • Chapter 9: Applying Artificial Intelligence to Chefbot using Python
  • Chapter 10: Integration of Chefbot hardware and interfacing it into ROS, using Python
  • Chapter 11: Designing a GUI for a robot using QT and Python
  • Chapter 12: The calibration and testing of Chefbot

mastering_ros's People

Contributors

lentin avatar qboticslabs avatar stansmooth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mastering_ros's Issues

List of Problems in chapter_3_codes

@qboticslabs

Let me begin with thanks for excellent contribution made by qboticalabs for the beginners. It is a great contribution towards society. I am here highlighting problems issues needs attention.

In this reporting, all the problems are enlisted occurring in chapter_3_codes if it is run under ROS-Kinetic and Ubuntu 16.06.

  1. Problems in diff_wheeled_robot_control roslaunch amcl.launch and the following error occurs.
    --> ERROR: cannot launch node of type map_server/map_server]: map_server

  2. Problems in diff_wheeled_robot_control roslaunch diff_wheeled_gazebo.launch and the following error occurs.
    -->[ERROR] [1507216916.939206001, 0.333000000]: GazeboRosDiffDrive Plugin missing <legacyMode>, defaults to true This setting assumes you have a old package, where the right and left wheel are changed to fix a former code issue To get rid of this error just set <legacyMode> to false if you just created a new package. To fix an old package you have to exchange left wheel by the right wheel. If you do not want to fix this issue in an old package or your z axis points down instead of the ROS standard defined in REP 103 just set <legacyMode> to true.

  3. Problems in diff_wheeled_robot_control roslaunch gmapping.launch and the following error occurs.

           --> `ERROR: cannot launch node of type [gmapping/slam_gmapping]: gmapping`
    
  4. Problems in diff_wheeled_robot_control roslaunch test_world.launch and the following error occurs.

           --> `[ERROR] [1507217340.730735320]: GazeboRosDiffDrive Plugin missing <legacyMode>, defaults to true
    

This setting assumes you have a old package, where the right and left wheel are changed to fix a former code issue.
To get rid of this error just set to false if you just created a new package.
To fix an old package you have to exchange left wheel by the right wheel.
If you do not want to fix this issue in an old package or your z axis points down instead of the ROS standard defined in REP 103 just set to true.`

  1. Problems in diff_wheeled_robot_control roslaunch keyboard_teleop.launch and the following error occurs.

           --> `ERROR: cannot launch node of type [diff_wheeled_robot_control/diff_wheeled_robot_key]: diff_wheeled_robot_control`
    
  2. Problems in seven_dof_arm_gazebo roslaunch grasp_generator_server.launch and the following error occurs.

         --> `ERROR: cannot launch node of type [moveit_simple_grasps/moveit_simple_grasps_server]: moveit_simple_grasps`
    
  3. Problems in seven_dof_arm_gazebo if we run rroslaunch seven_dof_arm_bringup_moveit.launch, roslaunch pick_place.launch and the following error occurs.

         --> `Traceback (most recent call last):   File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main p.start() 
    

File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start self._start_infrastructure() File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure self._load_config() File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config roslaunch_strs=self.roslaunch_strs, verbose=self.verbose) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default loader.load(f, config, verbose=verbose) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 746, in load self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 718, in _load_launch self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 682, in _recurse_load val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call return f(*args, **kwds) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 587, in _include_tag inc_filename = self.resolve_args(tag.attributes['file'].value, context) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 183, in resolve_args return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 370, in resolve_args resolved = _resolve_args(resolved, context, resolve_anon, commands) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 383, in _resolve_args resolved = commands[command](resolved, a, args, context) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 151, in _find source_path_to_packages=source_path_to_packages) File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 197, in _find_executable full_path = _get_executable_path(rp.get_path(args[0]), path) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 203, in get_path raise ResourceNotFound(name, ros_paths=self._ros_paths)

Could someone please address these issues and making this book wonderful and practical for the readers. Thanks a lot.

when I tring to lunch "seven_dof_arm_gazebo seven_dof_arm_gazebo_control.launch" it gave error as "IOError: [Errno 13] Permission denied: '/home/dhanu/.ros/rosdep/sources.cache/index'"

load_cached_sources_list with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '/home/dhanu/.ros/rosdep/sources.cache/index'
spawn_model script started
[seven_dof_arm/controller_spawner-4] process has died [pid 13295, exit code 1, cmd /opt/ros/kinetic/lib/controller_manager/spawner joint_state_controller joint1_position_controller joint2_position_controller joint3_position_controller joint4_position_controller joint5_position_controller joint6_position_controller joint7_position_controller __name:=controller_spawner __log:=/home/dhanu/.ros/log/5d6b44f4-e78d-11e6-8eb3-9c5c8e0e9eb2/seven_dof_arm-controller_spawner-4.log].
log file: /home/dhanu/.ros/log/5d6b44f4-e78d-11e6-8eb3-9c5c8e0e9eb2/seven_dof_arm-controller_spawner-4*.log

Is it possible to simulate the cool500 arm in rviz? I don't have the servos and the robot...

I have kinetic ROS and ubuntu 16.04.
I had some erros, than later I installed all the packages of dynamixel and so, afte catkin_make I could compile the package of cool500 arm from the end of chapter 10.
I would like ate least to see the move of the arm in RVIZ. but I had the following error messages:

[INFO] [1562018491.495060]: dynamixel_port controller_spawner: waiting for controller_manager dxl_manager to startup in global namespace...
[INFO] [1562018491.497615]: meta controller_spawner: waiting for controller_manager dxl_manager to startup in global namespace...
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/dynamixel_controllers/controller_manager.py", line 266, in
manager = ControllerManager()
File "/opt/ros/kinetic/lib/dynamixel_controllers/controller_manager.py", line 107, in init
serial_proxy.connect()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/dynamixel_driver/dynamixel_serial_proxy.py", line 99, in connect
self.dxl_io = dynamixel_io.DynamixelIO(self.port_name, self.baud_rate, self.readback_echo)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/dynamixel_driver/dynamixel_io.py", line 67, in init
self.ser = serial.Serial(port, baudrate, timeout=0.015)
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 180, in init
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 294, in open
raise SerialException(msg.errno, "could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
================================================================================REQUIRED process [dynamixel_manager-1] has died!
process has died [pid 1666, exit code 1, cmd /opt/ros/kinetic/lib/dynamixel_controllers/controller_manager.py __name:=dynamixel_manager __log:=/home/marcus/.ros/log/6463563a-9c48-11e9-b9e2-c82158f9534e/dynamixel_manager-1.log].
log file: /home/marcus/.ros/log/6463563a-9c48-11e9-b9e2-c82158f9534e/dynamixel_manager-1.log

Initiating shutdown!
*

[joint_state_aggregator-4] killing on exit
[controller_spawner_meta-3] killing on exit
[controller_spawner-2] killing on exit
[dynamixel_manager-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I do not have the dynanixel servos and not the arm, but should I see the arm in RVIZ...
obs: I ALSO DO NOT FOUND THE "demo.launch" in moveit config directory
where could I find? Or must I setup in moveit from beggining as in previous lessons?

Chapter4: Unable to load camera object in Gazebo

Hi qboticslab,

I am using ROS Melodic in Ubuntu 18.04 virtual machine. I am facing an issue while launching Gazebo simulator with rgbd_camera. I did everything that is mentioned in the book but getting two errors:

[ERROR] [1559059238.827069066, 0.160000000]: Tried to advertise a service that is already advertised in this node [/rgbd_camera/set_camera_info]

[ERROR] [1559059238.860400635, 0.160000000]: Tried to advertise a service that is already advertised in this node [/rgbd_camera/set_parameters]

I am unable to debug this issue. I tried to check rosservices list and found rgbd_camera/set_parameters and rgbd_camera/set_camera_info are listed as services.

Please see an attached screenshot which shows the mentioned errors.

Thanks
camera_error

Interfacing the MoveIt! config package to Gazebo and run my own IK code

In the book, CH4, section Interfacing the MoveIt! config package to Gazebo, it creates the connection between moveit, ros_control, gazebo.

I can start motion planning in rviz like in demo mode. But the weird thing is that the start state of motion planning is always stuck in initial position, which means the arm always plans from the initial straight position, though I had update the new start state to the last goal state, in order to make motion planning consistent and gazebo update simultaneously.

What's more, I try to run my own forward + inverse kinematics code to complete the plan and execution job. But the arm just completes the first motion I code( forward kinematics) in riviz, and it crashes.

Moveit_simple_grasping

Hi,
I am trying to run the chapter 10 demo on ROS indigo.
I have followed all of the steps you outline but I am getting problems with Moveit_simple_grasps not being able to find members from the moveit_visual_tools package. I have tried doing an ubuntu-debian install and from source of moveit_visual_tools but there seems to be some dependencies missing (setMuted(false) and loadEEMarker being examples).

Any help with this would be appreciated.

Segmentaion Fault Chapter 8 : pcl_filter

Hey, I am getting a segmentation fault when I run pcl_filter node

hal@hal:~/catkin_ws$ rosrun pcl_ros_tutorial pcl_filter 
Segmentation fault (core dumped)

pcl_publisher is running also I can see the point cloud in rviz. Anything I am missing ?

Nothing happens when run pick_and_place.py

Hi, I'm a beginner to ros.
I tried the guidence in chapter7 and nothing happens. I have catkin_make the moveit_simple_grapes successfully. Now I'm crazy beacuse of this issues.
When I typed the following :
roslaunch seven_dof_arm_config demo.launch demo.launch -> work fine
roslaunch seven_dof_arm_gazebo grasp_generator_server.launch -> work fine
rosrun seven_dof_arm_gazebo pick_and_place.py -> work but have some trouble.
Nothing happens in rviz, and it shows
Pick up goal failed!: Timeout reached
[WARN] [WallTime: 1558935438.075925] Pick up failed! Retrying ...
[ERROR] [WallTime: 1558935444.419281] Pick up goal failed!: Timeout reached
[WARN] [WallTime: 1558935444.421875] Pick up failed! Retrying
The picture maybe the cause.
@78RCSUGX0$C~GL%_P14G{J
I run these code in VM.
ubuntu14.04
ros-indigo
gazebo 7

catkin error 'gazebo-ros-controll not found' on indigo plus gazebo7

I want to use indigo + gazebo7

I install gazebo7 and then install gazebo7-ros-pkgs via debian as this instruction

I download code from github (tutorial code from book, mastering ros for robotics programming), and then catkin, it throws build error as follows:

CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by
  "gazebo_ros_control" with any of the following names:

    gazebo_ros_controlConfig.cmake
    gazebo_ros_control-config.cmake



 Add the installation prefix of "gazebo_ros_control" to CMAKE_PREFIX_PATH or
  set "gazebo_ros_control_DIR" to a directory containing one of the above
  files.  If "gazebo_ros_control" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  seven_dof_arm_gazebo/CMakeLists.txt:7 (find_package)


    -- Could not find the required component 'gazebo_ros_control'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
    CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):

  Could not find a package configuration file provided by

      "gazebo_ros_control" with any of the following names:
    
        gazebo_ros_controlConfig.cmake
        gazebo_ros_control-config.cmake

  Add the installation prefix of "gazebo_ros_control" to CMAKE_PREFIX_PATH or
  set "gazebo_ros_control_DIR" to a directory containing one of the above
  files.  If "gazebo_ros_control" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  seven_dof_arm_gazebo/CMakeLists.txt:7 (find_package)

It seems like I have not installed gazebo-ros-control package, though I think it is supposed to have been installed already by
previous install procedure:

sudo apt-get install ros-indigo-gazebo7-ros-pkgs

I check the packages by:

rospack list | grep gazebo_

whose result is :

    gazebo_msgs /opt/ros/indigo/share/gazebo_msgs
    gazebo_plugins /opt/ros/indigo/share/gazebo_plugins
    gazebo_ros /opt/ros/indigo/share/gazebo_ros
    gazebo_tutorials /home/shawn/catkin_ws/src/gazebo_ros_demos/custom_plugin_tutorial

It turns out gazebo-ros-control package haven't been installed! Why?

According to instruction of gazebo official, it is said that except for ros-indigo-gazebo7-ros-pkgs, all other packages related to gazebo MUST be built from source.

Does it mean I have to build gazebo-ros-control from source?

Is it version-specific? Where can I find the right version on github?

Is this the right link?, if so, how can I git clone this package on this page?

Chapter 3 codes: tf does not exist

When I'm trying to visualize the robot state and laser data on Rviz, I get an error in RViz that Fixed frame [map] does not exist. When i run rosrun rqt rqt i see tf being published. I dont know what to do.

Gmapping and base_footprint error

Hi everyone,

I am new to ROS and have been learning from Mastering ROS for Robotics Programming. I have run into an issue in Chapter 4 where gmapping and AMCL are used to build a map of Willow Garage world and navigate autonomously. I am using a dual boot machine running Windows 10 and Ubuntu 14.04 on separate HDDs.

When I run:
roslaunch diff_wheeled_robot_gazebo diff_wheeled_gazebo_full.launch

The robot launches in Gazebo in an empty world instead of Willow Garage and the terminal displays the following warnings:

[ WARN] [1502832331.629880560]: The 'state_publisher' executable is deprecated. Please use 'robot_state_publisher' instead [ WARN] [1502832331.632663525]: The root link base_footprint has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

Next, when I run:
roslaunch diff_wheeled_robot_gazebo gmapping.launch

The terminal displays the following output including an error.

imad@imad-Aspire-E5-575G:~$ roslaunch diff_wheeled_robot_gazebo gmapping.launch
... logging to /home/imad/.ros/log/44052ba2-8200-11e7-a9e0-74dfbf917593/roslaunch-imad-Aspire-E5-575G-10008.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://imad-Aspire-E5-575G:44666/
SUMMARY

PARAMETERS

    /move_base/DWAPlannerROS/acc_lim_theta: 2.0
    /move_base/DWAPlannerROS/acc_lim_x: 1.0
    /move_base/DWAPlannerROS/acc_lim_y: 0.0
    /move_base/DWAPlannerROS/forward_point_distance: 0.325
    /move_base/DWAPlannerROS/global_frame_id: odom
    /move_base/DWAPlannerROS/goal_distance_bias: 24.0
    /move_base/DWAPlannerROS/max_rot_vel: 5.0
    /move_base/DWAPlannerROS/max_scaling_factor: 0.2
    /move_base/DWAPlannerROS/max_trans_vel: 0.5
    /move_base/DWAPlannerROS/max_vel_x: 0.5
    /move_base/DWAPlannerROS/max_vel_y: 0.0
    /move_base/DWAPlannerROS/min_rot_vel: 0.4
    /move_base/DWAPlannerROS/min_trans_vel: 0.1
    /move_base/DWAPlannerROS/min_vel_x: 0.0
    /move_base/DWAPlannerROS/min_vel_y: 0.0
    /move_base/DWAPlannerROS/occdist_scale: 0.5
    /move_base/DWAPlannerROS/oscillation_reset_dist: 0.05
    /move_base/DWAPlannerROS/path_distance_bias: 64.0
    /move_base/DWAPlannerROS/publish_cost_grid_pc: True
    /move_base/DWAPlannerROS/publish_traj_pc: True
    /move_base/DWAPlannerROS/rot_stopped_vel: 0.4
    /move_base/DWAPlannerROS/scaling_speed: 0.25
    /move_base/DWAPlannerROS/sim_time: 1.0
    /move_base/DWAPlannerROS/stop_time_buffer: 0.2
    /move_base/DWAPlannerROS/trans_stopped_vel: 0.1
    /move_base/DWAPlannerROS/vtheta_samples: 20
    /move_base/DWAPlannerROS/vx_samples: 6
    /move_base/DWAPlannerROS/vy_samples: 1
    /move_base/DWAPlannerROS/xy_goal_tolerance: 0.15
    /move_base/DWAPlannerROS/yaw_goal_tolerance: 0.3
    /move_base/TrajectoryPlannerROS/acc_lim_theta: 1.0
    /move_base/TrajectoryPlannerROS/acc_lim_x: 0.5
    /move_base/TrajectoryPlannerROS/acc_lim_y: 0.0
    /move_base/TrajectoryPlannerROS/dwa: True
    /move_base/TrajectoryPlannerROS/gdist_scale: 0.8
    /move_base/TrajectoryPlannerROS/heading_lookahead: 0.325
    /move_base/TrajectoryPlannerROS/holonomic_robot: False
    /move_base/TrajectoryPlannerROS/max_vel_theta: 1.0
    /move_base/TrajectoryPlannerROS/max_vel_x: 0.3
    /move_base/TrajectoryPlannerROS/max_vel_y: 0.0
    /move_base/TrajectoryPlannerROS/meter_scoring: True
    /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.6
    /move_base/TrajectoryPlannerROS/min_vel_theta: -1.0
    /move_base/TrajectoryPlannerROS/min_vel_x: 0.1
    /move_base/TrajectoryPlannerROS/min_vel_y: 0.0
    /move_base/TrajectoryPlannerROS/occdist_scale: 0.01
    /move_base/TrajectoryPlannerROS/oscillation_reset_dist: 0.05
    /move_base/TrajectoryPlannerROS/pdist_scale: 0.6
    /move_base/TrajectoryPlannerROS/sim_time: 3.0
    /move_base/TrajectoryPlannerROS/vtheta_samples: 20
    /move_base/TrajectoryPlannerROS/vx_samples: 6
    /move_base/TrajectoryPlannerROS/vy_samples: 1
    /move_base/TrajectoryPlannerROS/xy_goal_tolerance: 0.15
    /move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 0.3
    /move_base/base_local_planner: dwa_local_planner...
    /move_base/controller_frequency: 5.0
    /move_base/controller_patience: 3.0
    /move_base/global_costmap/bump/clearing: False
    /move_base/global_costmap/bump/data_type: PointCloud2
    /move_base/global_costmap/bump/marking: True
    /move_base/global_costmap/bump/max_obstacle_height: 0.15
    /move_base/global_costmap/bump/min_obstacle_height: 0.0
    /move_base/global_costmap/bump/topic: mobile_base/senso...
    /move_base/global_costmap/cost_scaling_factor: 5
    /move_base/global_costmap/global_frame: /map
    /move_base/global_costmap/inflation_radius: 0.5
    /move_base/global_costmap/map_type: costmap
    /move_base/global_costmap/max_obstacle_height: 0.6
    /move_base/global_costmap/observation_sources: scan bump
    /move_base/global_costmap/obstacle_range: 2.5
    /move_base/global_costmap/origin_z: 0.0
    /move_base/global_costmap/publish_frequency: 0.5
    /move_base/global_costmap/publish_voxel_map: False
    /move_base/global_costmap/raytrace_range: 3.0
    /move_base/global_costmap/robot_base_frame: /base_footprint
    /move_base/global_costmap/robot_radius: 0.4509
    /move_base/global_costmap/scan/clearing: True
    /move_base/global_costmap/scan/data_type: LaserScan
    /move_base/global_costmap/scan/marking: True
    /move_base/global_costmap/scan/max_obstacle_height: 3
    /move_base/global_costmap/scan/min_obstacle_height: 0.0
    /move_base/global_costmap/scan/topic: scan
    /move_base/global_costmap/static_map: True
    /move_base/global_costmap/transform_tolerance: 0.5
    /move_base/global_costmap/update_frequency: 1.0
    /move_base/global_costmap/z_resolution: 0.2
    /move_base/global_costmap/z_voxels: 2
    /move_base/local_costmap/bump/clearing: False
    /move_base/local_costmap/bump/data_type: PointCloud2
    /move_base/local_costmap/bump/marking: True
    /move_base/local_costmap/bump/max_obstacle_height: 0.15
    /move_base/local_costmap/bump/min_obstacle_height: 0.0
    /move_base/local_costmap/bump/topic: mobile_base/senso...
    /move_base/local_costmap/cost_scaling_factor: 5
    /move_base/local_costmap/global_frame: odom
    /move_base/local_costmap/height: 4.0
    /move_base/local_costmap/inflation_radius: 0.5
    /move_base/local_costmap/map_type: costmap
    /move_base/local_costmap/max_obstacle_height: 0.6
    /move_base/local_costmap/observation_sources: scan bump
    /move_base/local_costmap/obstacle_range: 2.5
    /move_base/local_costmap/origin_z: 0.0
    /move_base/local_costmap/publish_frequency: 2.0
    /move_base/local_costmap/publish_voxel_map: False
    /move_base/local_costmap/raytrace_range: 3.0
    /move_base/local_costmap/resolution: 0.05
    /move_base/local_costmap/robot_base_frame: /base_footprint
    /move_base/local_costmap/robot_radius: 0.4509
    /move_base/local_costmap/rolling_window: True
    /move_base/local_costmap/scan/clearing: True
    /move_base/local_costmap/scan/data_type: LaserScan
    /move_base/local_costmap/scan/marking: True
    /move_base/local_costmap/scan/max_obstacle_height: 3
    /move_base/local_costmap/scan/min_obstacle_height: 0.0
    /move_base/local_costmap/scan/topic: scan
    /move_base/local_costmap/static_map: False
    /move_base/local_costmap/transform_tolerance: 0.5
    /move_base/local_costmap/update_frequency: 5.0
    /move_base/local_costmap/width: 4.0
    /move_base/local_costmap/z_resolution: 0.2
    /move_base/local_costmap/z_voxels: 2
    /move_base/oscillation_distance: 0.2
    /move_base/oscillation_timeout: 10.0
    /move_base/planner_frequency: 1.0
    /move_base/planner_patience: 5.0
    /move_base/shutdown_costmaps: False
    /rosdistro: indigo
    /rosversion: 1.11.21
    /slam_gmapping/angularUpdate: 0.436
    /slam_gmapping/astep: 0.05
    /slam_gmapping/base_frame: base_footprint
    /slam_gmapping/delta: 0.05
    /slam_gmapping/iterations: 5
    /slam_gmapping/kernelSize: 1
    /slam_gmapping/lasamplerange: 0.005
    /slam_gmapping/lasamplestep: 0.005
    /slam_gmapping/linearUpdate: 0.5
    /slam_gmapping/llsamplerange: 0.01
    /slam_gmapping/llsamplestep: 0.01
    /slam_gmapping/lsigma: 0.075
    /slam_gmapping/lskip: 0
    /slam_gmapping/lstep: 0.05
    /slam_gmapping/map_update_interval: 5.0
    /slam_gmapping/maxRange: 8.0
    /slam_gmapping/maxUrange: 6.0
    /slam_gmapping/minimumScore: 100
    /slam_gmapping/odom_frame: odom
    /slam_gmapping/ogain: 3.0
    /slam_gmapping/particles: 80
    /slam_gmapping/resampleThreshold: 0.5
    /slam_gmapping/sigma: 0.05
    /slam_gmapping/srr: 0.01
    /slam_gmapping/srt: 0.02
    /slam_gmapping/str: 0.01
    /slam_gmapping/stt: 0.02
    /slam_gmapping/temporalUpdate: -1.0
    /slam_gmapping/xmax: 1.0
    /slam_gmapping/xmin: -1.0
    /slam_gmapping/ymax: 1.0
    /slam_gmapping/ymin: -1.0

NODES
/
move_base (move_base/move_base)
slam_gmapping (gmapping/slam_gmapping)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[slam_gmapping-1]: started with pid [10026]
process[move_base-2]: started with pid [10027]
[ WARN] [1502833436.250359091, 1084.378000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: . canTransform returned after 1084.38 timeout was 0.1.
[ WARN] [1502833441.391352686, 1089.464000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_footprint' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.103 timeout was 0.1.
[ WARN] [1502833446.596302597, 1094.560000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: Could not find a connection between 'map' and 'base_footprint' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.104 timeout was 0.1.
[ WARN] [1502833451.529031298, 1099.367000000]: MessageFilter [target=odom ]: Dropped 100.00% of messages so far. Please turn the [ros.gmapping.message_notifier] rosconsole logger to DEBUG for more information.`

I have double and triple checked all the packages built so far to ensure they are the same as what's in the code for the chapters. However, something seems to be amiss. I also updated the navigation package to make sure nothing is missing from it. Has anybody had a similar issue? How do I fix this?

catkin_make gets error

Hi everyone,
I tried to catkin_make the Chapter 1 demo but got this error:

make: *** No rule to make target `mastering_ros_demo_package'.  Stop.
Invoking "make mastering_ros_demo_package -j8 -l8" failed

Does anyone know what's wrong?

Unable to parse XACRO file

I used moveit assistant to load seven_dof_arm.xacro, but it error "Unable to parse XACRO file".
Ubuntu: 14.04
ROS: Indigo

too many redundant codes

Hi,
If you clone all the codes and put them in the same catkin workspace, It will have errors cased by the redundancy, especially in chapter 2,3 ,4 and 10. So I am just wondering if there are some better ways to handle the redundancy except for compile them one by one. Or maybe you can delete the redundant code and make them more compact. Thx!

[Chapter 2] - RViz transform error

Hello,

Following the book, on chapter 2, page 69.
Running the command
$ roslaunch mastering_ros_robot_description_pkg view_demo.launch

RViz starts like the image below
rsz_screenshot_from_2016-09-02_204851

Would be this a RViz configuration file problem?

Thanks

demo_action_server.cpp

When running example code for actionlib client / server, the example from the book works as shown if the same arguments are passed, but if you change the client arguments to prevent preemption, the server issues a warning:

'Your executeCallback did not set the goal to a terminal status. This is a bug in your ActionServer implementation. Fix your code!

[Chapter 3] Cannot find the 'mastering_ros_robot_description_pkg' library while 'catkin_make' the workspace

**### Test Environment: Ubuntu 14.04 with Indigo

Error msg is shown below:


root@daniel-VirtualBox:~/catkin_ws# catkin_make
Base path: /home/daniel/catkin_ws
Source space: /home/daniel/catkin_ws/src
Build space: /home/daniel/catkin_ws/build
Devel space: /home/daniel/catkin_ws/devel
Install space: /home/daniel/catkin_ws/install

Running command: "make cmake_check_build_system" in "/home/daniel/catkin_ws/build"

-- Using CATKIN_DEVEL_PREFIX: /home/daniel/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/daniel/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/daniel/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/daniel/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 4 packages in topological order:
-- ~~ - beginner_tutoriials
-- ~~ - mastering_ros_demo_pkg
-- ~~ - mastering_ros_robot_description_pkg
-- ~~ - seven_dof_arm_gazebo
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutoriials'
-- ==> add_subdirectory(beginner_tutoriials)
-- Using these message generators: gencpp;genlisp;genpy
-- beginner_tutoriials: 1 messages, 1 services
-- +++ processing catkin package: 'mastering_ros_demo_pkg'
-- ==> add_subdirectory(mastering_ros_demo_pkg)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- Generating .msg files for action mastering_ros_demo_pkg/Demo_action /home/daniel/catkin_ws/src/mastering_ros_demo_pkg/action/Demo_action.action
-- mastering_ros_demo_pkg: 8 messages, 1 services
-- +++ processing catkin package: 'mastering_ros_robot_description_pkg'
-- ==> add_subdirectory(mastering_ros_robot_description_pkg)
-- Using these message generators: gencpp;genlisp;genpy
-- +++ processing catkin package: 'seven_dof_arm_gazebo'
-- ==> add_subdirectory(seven_dof_arm_gazebo)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /home/daniel/catkin_ws/devel/share/mastering_ros_robot_description_pkg/cmake/mastering_ros_robot_description_pkgConfig.cmake:141 (message):
Project 'seven_dof_arm_gazebo' tried to find library
'mastering_ros_robot_description_pkg'. The library is neither a target nor
built/installed properly. Did you compile project
'mastering_ros_robot_description_pkg'? Did you find_package() it before the
subdirectory containing its code is included?
Call Stack (most recent call first):
/opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
seven_dof_arm_gazebo/CMakeLists.txt:7 (find_package)


AND the CMakelists.txt is as below:

cmake_minimum_required(VERSION 2.8.3)
project(seven_dof_arm_gazebo)
...
find_package(catkin REQUIRED COMPONENTS <----line 7
gazebo_msgs
gazebo_plugins
gazebo_ros
gazebo_ros_control
mastering_ros_robot_description_pkg
)

...

Chapter 10 Pick and place action in Gazebo and real Robot is not working

[ INFO] [1503578128.869441377, 159.493000000]: Loading robot model 'seven_dof_arm'...
[ INFO] [1503578128.869527831, 159.493000000]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1503578129.175303152, 159.707000000]: Loading robot model 'seven_dof_arm'...
[ INFO] [1503578129.175358182, 159.707000000]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1503578129.182875417, 159.716000000]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
[ INFO] [1503578132.037467166, 162.185000000]: TrajectoryExecution will use old service capability.
[ INFO] [1503578132.037544704, 162.185000000]: Ready to take MoveGroup commands for group arm.
[ INFO] [1503578132.154141457, 162.284000000]: TrajectoryExecution will use old service capability.
[ INFO] [1503578132.154268683, 162.284000000]: Ready to take MoveGroup commands for group gripper.
[ERROR] [WallTime: 1503578133.005558] [162.997000] Grasp goal failed!: This goal was canceled because another goal was recieved by the simple action server
Traceback (most recent call last):
File "/home/root1/Documents/ROS/Workspaces/Practise/src/mastering_ros/seven_dof_arm_gazebo/scripts/pick_and_place.py", line 393, in
main()
File "/home/root1/Documents/ROS/Workspaces/Practise/src/mastering_ros/seven_dof_arm_gazebo/scripts/pick_and_place.py", line 385, in main
p = Pick_Place()
File "/home/root1/Documents/ROS/Workspaces/Practise/src/mastering_ros/seven_dof_arm_gazebo/scripts/pick_and_place.py", line 101, in init
while not self._pickup(self._arm_group, self._grasp_object_name, self._grasp_object_width):
File "/home/root1/Documents/ROS/Workspaces/Practise/src/mastering_ros/seven_dof_arm_gazebo/scripts/pick_and_place.py", line 306, in _pickup
goal = self._create_pickup_goal(group, target, grasps)
File "/home/root1/Documents/ROS/Workspaces/Practise/src/mastering_ros/seven_dof_arm_gazebo/scripts/pick_and_place.py", line 256, in _create_pickup_goal
goal.possible_grasps.extend(grasps)
TypeError: 'NoneType' object is not iterable
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::lock_error >'
what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

ROS Command Typo Error in Page 358

Hi Everyone

I am sorry to say that, there is a typo error in Page 358, And corrected commands are given below

$ roslaunch seven_dof_arm_config demo.launch

$ roslaunch moveit_simple_grasps grasp_generator_server.launch

Simple start

Hello,
Thank You for Your product and Big Work. I try to use it and i have the following question:
When I started the subscriber and then the publisher, the subscriber got only 6 packages instead of 10 . Can You help me to solve this case?

subscriber:

rosrun mastering_ros_demo_pkg demo_topic_subscriber 

[ INFO] [1562774891.789805397]: Recieved  [3]
[ INFO] [1562774891.889308020]: Recieved  [4]
[ INFO] [1562774891.989637723]: Recieved  [5]
[ INFO] [1562774892.089623938]: Recieved  [6]
[ INFO] [1562774892.189616142]: Recieved  [7]
[ INFO] [1562774892.289592149]: Recieved  [8]

publisher:

rosrun mastering_ros_demo_pkg demo_topic_publisher

[ INFO] [1562774891.488517798]: 0
[ INFO] [1562774891.588267295]: 1
[ INFO] [1562774891.688207416]: 2
[ INFO] [1562774891.788217121]: 3
[ INFO] [1562774891.888220210]: 4
[ INFO] [1562774891.988260331]: 5
[ INFO] [1562774892.088259463]: 6
[ INFO] [1562774892.188257449]: 7
[ INFO] [1562774892.288261684]: 8
[ INFO] [1562774892.388366544]: 9

roscore:

$ roscore
... logging to /home/pi/.ros/log/cdd1ea56-a32c-11e9-bf3f-b827eb408aa0/roslaunch-raspberrypi-2641.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://raspberrypi:41275/
ros_comm version 1.12.14


SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES

auto-starting new master
process[master]: started with pid [2652]
ROS_MASTER_URI=http://raspberrypi:11311/

setting /run_id to cdd1ea56-a32c-11e9-bf3f-b827eb408aa0
process[rosout-1]: started with pid [2665]
started core service [/rosout]

system:

uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

why commandline argument syntax in publisher node

why commandline argument in publisher node syntax ,since we have already given the data to be published in code

#include "ros/ros.h"
#include "std_msgs/String.h"
#include

int main(int argc,char **argv) -----------why commansline argument syntax is here,since not parsing any data
{
ros::init(argc,argv,"first_node");
ros::NodeHandle n;
ros::Publisher pub=n.advertise<std_msgs::String>("first_topic",10);
ros::Rate loop_rate(10);
int count;

while (ros::ok())
{
    std_msgs::String msg;
    std::string strrr;
    msg.data strrr="hi";----------here already i have the data to be published
    ROS_INFO("%s",msg.data.c_str());
    pub.publish(msg);
    ++count;
}
return 0;

}

libusb not found

Hello Everyone,

I am trying to use this this very particular chapter. When I compile it, I am getting this error constantly.

CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:578 (message): None of the required 'libusb' found
I have tried reading few articles online but none of them resolved this problem. Your kind suggestions would be highly appreciated. Thank you.

catkin_make error: Multiple packages found with the same name

I clone the repository of qboticslabs/mastering_ros
Afterward, I tried to catkin_make, but

error is as following:

Multiple packages found with the same name

please let me know the problem!

wkyoun@wkyoun-XPS-13-9343:~/catkin_ws/src$ catkin_make

Base path: /home/wkyoun/catkin_ws
Source space: /home/wkyoun/catkin_ws/src
Build space: /home/wkyoun/catkin_ws/build
Devel space: /home/wkyoun/catkin_ws/devel
Install space: /home/wkyoun/catkin_ws/install
Multiple packages found with the same name "chefbot_bringup":
- mastering_ros/chapter_9_codes/chefbot/chefbot/chefbot_bringup
- mastering_ros/chapter_9_codes/chefbot/chefbot_bringup
Multiple packages found with the same name "chefbot_description":
- mastering_ros/chapter_9_codes/chefbot/chefbot/chefbot_description
- mastering_ros/chapter_9_codes/chefbot/chefbot_description
Multiple packages found with the same name "chefbot_gazebo":
- mastering_ros/chapter_9_codes/chefbot/chefbot/chefbot_simulator/chefbot_gazebo
- mastering_ros/chapter_9_codes/chefbot/chefbot_simulator/chefbot_gazebo
Multiple packages found with the same name "diff_wheeled_robot_control":
- mastering_ros/chapter_3_codes/diff_wheeled_robot_control
- mastering_ros/chapter_4_codes/diff_wheeled_robot_control
Multiple packages found with the same name "diff_wheeled_robot_gazebo":
- mastering_ros/chapter_3_codes/diff_wheeled_robot_gazebo
- mastering_ros/chapter_4_codes/diff_wheeled_robot_gazebo
Multiple packages found with the same name "seven_dof_arm_config":
- mastering_ros/chapter_10_codes/seven_dof_arm_config
- mastering_ros/chapter_4_codes/seven_dof_arm_config
Multiple packages found with the same name "seven_dof_arm_gazebo":
- mastering_ros/chapter_10_codes/seven_dof_arm_gazebo
- mastering_ros/chapter_3_codes/seven_dof_arm_gazebo
- mastering_ros/chapter_4_codes/seven_dof_arm_gazebo
Multiple packages found with the same name "seven_dof_arm_test":
- mastering_ros/chapter_10_codes/seven_dof_arm_test
- mastering_ros/chapter_4_codes/seven_dof_arm_test

moveit_simple_grasps

@qboticslabs
I am trying to run the command line "roslaunch seven_dof_arm_gazebo grasp_generator_server.launch",
I got a problem

[ERROR] [1465740328.774843123]: Grasp configuration parameter pregrasp_time_from_start missing from rosparam server. Did you load your end effector's configuration yaml file? Searching in namespace: /moveit_simple_grasps_server/right
[moveit_simple_grasps_server-2] process has died [pid 32558, exit code -11, cmd /home/hutlab/catkin_ws/devel/lib/moveit_simple_grasps/moveit_simple_grasps_server __name:=moveit_simple_grasps_server __log:=/home/hutlab/.ros/log/bc53a772-0493-11e7-b63f-c81f6631823d/moveit_simple_grasps_server-2.log].

Problem of connecting gazebo and moveit

Hi
I have a trouble about the code in chapter 4(P138)
When I tried to run the code that makes gazebo and moveit run at the sametime and pressed "execute" button in motionplanning, but the robot in gazebo did not work.
Moreover, motionplanning in moveit showed "failed".

The error message in the terminal showed
"[ WARN] [1510766932.987760476, 51.584000000]: Failed to validate trajectory: couldn't receive full current joint state within 1s
"
Then, I guess sending command from moveit to gazebo has something wrong, but I cannot understand what was the problem.

Chapter 2 codes : Creating XACRO and URDF files

Hello,
I have tried to create my own URDF file from SolidWorks using SW2URDF exporter but I didn't get a similar URDF file as of yours. The components missing in the generated URDF is "Transmissions for ROS control" and further. So is there something I am doing wrong?
Also, I wanted to create a .xacro file so is there a tool to create or I have to code it myself?

Thanks in advance. I am new to this so kindly forgive my errors.

Chapter 3. Adding a 3D camera to a robot arm(ur5)

HI Sir, how are you doing ? I guess you're super busy with teaching ROS. Can I please ask you a question about your book Mastering ROS? I am following chapter 3 and trying to add a 3D camera on a robot arm. However, I am using UR5 insteading of the 7 dof arm you created in your lovely book. However, the xacro code of UR5 is much different from your 7 dof arm.
I followed you this section and copied the <xacro:include filename="$(find mastering_ros_robot_description_pkg)/urdf/sensors/xtion_pro_live.urdf.xacro"/>
into my UR5 file: ur5.urdf.xacro

image
but I don't get the camera in gazebo, I have the UR5 lying on the ground, though. I didn't copied sensor files to ur_description file and modified the path in the ur5.urdf.xacro code. Can you please kindly do me a favour? I think it takes you 1o minutes to add a camera to ur5 but it's taken me one week already. Thank you so much for your kindness. The following is my ur5.urdf.xacro:

<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">

  <xacro:include filename="$(find ur_description)/urdf/ur.transmission.xacro" />
  <xacro:include filename="$(find ur_description)/urdf/ur.gazebo.xacro" />
  <xacro:include filename="$(find ur_description)/urdf/sensors/xtion_pro_live.urdf.xacro"/>
  <!-- Inertia parameters -->
  <xacro:property name="base_mass" value="4.0" />  <!-- This mass might be incorrect -->
  <xacro:property name="shoulder_mass" value="3.7000" />
  <xacro:property name="upper_arm_mass" value="8.3930" />
  <xacro:property name="forearm_mass" value="2.2750" />
  <xacro:property name="wrist_1_mass" value="1.2190" />
  <xacro:property name="wrist_2_mass" value="1.2190" />
  <xacro:property name="wrist_3_mass" value="0.1879" />

  <xacro:property name="shoulder_cog" value="0.0 0.00193 -0.02561" />
  <xacro:property name="upper_arm_cog" value="0.0 -0.024201 0.2125" />
  <xacro:property name="forearm_cog" value="0.0 0.0265 0.11993" />
  <xacro:property name="wrist_1_cog" value="0.0 0.110949 0.01634" />
  <xacro:property name="wrist_2_cog" value="0.0 0.0018 0.11099" />
  <xacro:property name="wrist_3_cog" value="0.0 0.001159 0.0" />

  <!-- Kinematic model -->
  <!-- Properties from urcontrol.conf -->
  <!--
    DH for UR5:
    a = [0.00000, -0.42500, -0.39225,  0.00000,  0.00000,  0.0000]
    d = [0.089159,  0.00000,  0.00000,  0.10915,  0.09465,  0.0823]
    alpha = [ 1.570796327, 0, 0, 1.570796327, -1.570796327, 0 ]
    q_home_offset = [0, -1.570796327, 0, -1.570796327, 0, 0]
    joint_direction = [-1, -1, 1, 1, 1, 1]
    mass = [3.7000, 8.3930, 2.2750, 1.2190, 1.2190, 0.1879]
    center_of_mass = [ [0, -0.02561, 0.00193], [0.2125, 0, 0.11336], [0.11993, 0.0, 0.0265], [0, -0.0018, 0.01634], [0, 0.0018,0.01634], [0, 0, -0.001159] ]
  -->
  <xacro:property name="ur5_d1" value="0.089159" />
  <xacro:property name="ur5_a2" value="-0.42500" />
  <xacro:property name="ur5_a3" value="-0.39225" />
  <xacro:property name="ur5_d4" value="0.10915" />
  <xacro:property name="ur5_d5" value="0.09465" />
  <xacro:property name="ur5_d6" value="0.0823" />

  <!-- Arbitrary offsets for shoulder/elbow joints -->
  <xacro:property name="shoulder_offset" value="0.13585" />  <!-- measured from model -->
  <xacro:property name="elbow_offset" value="-0.1197" /> <!-- measured from model -->

  <!-- link lengths used in model -->
  <xacro:property name="shoulder_height" value="${ur5_d1}" />
  <xacro:property name="upper_arm_length" value="${-ur5_a2}" />
  <xacro:property name="forearm_length" value="${-ur5_a3}" />
  <xacro:property name="wrist_1_length" value="${ur5_d4 - elbow_offset - shoulder_offset}" />
  <xacro:property name="wrist_2_length" value="${ur5_d5}" />
  <xacro:property name="wrist_3_length" value="${ur5_d6}" />
  <!--property name="shoulder_height" value="0.089159" /-->
  <!--property name="shoulder_offset" value="0.13585" /-->  <!-- shoulder_offset - elbow_offset + wrist_1_length = 0.10915 -->
  <!--property name="upper_arm_length" value="0.42500" /-->
  <!--property name="elbow_offset" value="0.1197" /-->       <!-- CAD measured -->
  <!--property name="forearm_length" value="0.39225" /-->
  <!--property name="wrist_1_length" value="0.093" /-->     <!-- CAD measured -->
  <!--property name="wrist_2_length" value="0.09465" /-->   <!-- In CAD this distance is 0.930, but in the spec it is 0.09465 -->
  <!--property name="wrist_3_length" value="0.0823" /-->

  <xacro:property name="shoulder_radius" value="0.060" />   <!-- manually measured -->
  <xacro:property name="upper_arm_radius" value="0.054" />  <!-- manually measured -->
  <xacro:property name="elbow_radius" value="0.060" />      <!-- manually measured -->
  <xacro:property name="forearm_radius" value="0.040" />    <!-- manually measured -->
  <xacro:property name="wrist_radius" value="0.045" />      <!-- manually measured -->

  <xacro:macro name="cylinder_inertial" params="radius length mass *origin">
    <inertial>
      <mass value="${mass}" />
      <xacro:insert_block name="origin" />
      <inertia ixx="${0.0833333 * mass * (3 * radius * radius + length * length)}" ixy="0.0" ixz="0.0"
        iyy="${0.0833333 * mass * (3 * radius * radius + length * length)}" iyz="0.0"
        izz="${0.5 * mass * radius * radius}" />
    </inertial>
  </xacro:macro>


  <xacro:macro name="ur5_robot" params="prefix joint_limited
     shoulder_pan_lower_limit:=${-pi}    shoulder_pan_upper_limit:=${pi}
     shoulder_lift_lower_limit:=${-pi}    shoulder_lift_upper_limit:=${pi}
     elbow_joint_lower_limit:=${-pi}    elbow_joint_upper_limit:=${pi}
     wrist_1_lower_limit:=${-pi}    wrist_1_upper_limit:=${pi}
     wrist_2_lower_limit:=${-pi}    wrist_2_upper_limit:=${pi}
     wrist_3_lower_limit:=${-pi}    wrist_3_upper_limit:=${pi}">

    <link name="${prefix}base_link" >
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/base.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/base.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.06" length="0.05" mass="${base_mass}">
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}shoulder_pan_joint" type="revolute">
      <parent link="${prefix}base_link" />
      <child link = "${prefix}shoulder_link" />
      <origin xyz="0.0 0.0 ${shoulder_height}" rpy="0.0 0.0 0.0" />
      <axis xyz="0 0 1" />
      <xacro:unless value="${joint_limited}">
        <limit lower="${-2.0 * pi}" upper="${2.0 * pi}" effort="150.0" velocity="3.15"/>
      </xacro:unless>
      <xacro:if value="${joint_limited}">
        <limit lower="${shoulder_pan_lower_limit}" upper="${shoulder_pan_upper_limit}" effort="150.0" velocity="3.15"/>
      </xacro:if>
      <dynamics damping="0.0" friction="0.0"/>
    </joint>

    <link name="${prefix}shoulder_link">
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/shoulder.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/shoulder.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.06" length="0.15" mass="${shoulder_mass}">
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}shoulder_lift_joint" type="revolute">
      <parent link="${prefix}shoulder_link" />
      <child link = "${prefix}upper_arm_link" />
      <origin xyz="0.0 ${shoulder_offset} 0.0" rpy="0.0 ${pi / 2.0} 0.0" />
      <axis xyz="0 1 0" />
      <xacro:unless value="${joint_limited}">
        <limit lower="${-2.0 * pi}" upper="${2.0 * pi}" effort="150.0" velocity="3.15"/>
      </xacro:unless>
      <xacro:if value="${joint_limited}">
        <limit lower="${shoulder_lift_lower_limit}" upper="${shoulder_lift_upper_limit}" effort="150.0" velocity="3.15"/>
      </xacro:if>
      <dynamics damping="0.0" friction="0.0"/>
    </joint>

    <link name="${prefix}upper_arm_link">
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/upperarm.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/upperarm.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.06" length="0.56" mass="${upper_arm_mass}">
        <origin xyz="0.0 0.0 0.28" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}elbow_joint" type="revolute">
      <parent link="${prefix}upper_arm_link" />
      <child link = "${prefix}forearm_link" />
      <origin xyz="0.0 ${elbow_offset} ${upper_arm_length}" rpy="0.0 0.0 0.0" />
      <axis xyz="0 1 0" />
      <xacro:unless value="${joint_limited}">
        <limit lower="${-pi}" upper="${pi}" effort="150.0" velocity="3.15"/>
      </xacro:unless>
      <xacro:if value="${joint_limited}">
        <limit lower="${elbow_joint_lower_limit}" upper="${elbow_joint_upper_limit}" effort="150.0" velocity="3.15"/>
      </xacro:if>
      <dynamics damping="0.0" friction="0.0"/>
    </joint>

    <link name="${prefix}forearm_link">
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/forearm.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/forearm.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.06" length="0.5" mass="${forearm_mass}">
        <origin xyz="0.0 0.0 0.25" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}wrist_1_joint" type="revolute">
      <parent link="${prefix}forearm_link" />
      <child link = "${prefix}wrist_1_link" />
      <origin xyz="0.0 0.0 ${forearm_length}" rpy="0.0 ${pi / 2.0} 0.0" />
      <axis xyz="0 1 0" />
      <xacro:unless value="${joint_limited}">
        <limit lower="${-2.0 * pi}" upper="${2.0 * pi}" effort="28.0" velocity="3.2"/>
      </xacro:unless>
      <xacro:if value="${joint_limited}">
        <limit lower="${wrist_1_lower_limit}" upper="${wrist_1_upper_limit}" effort="28.0" velocity="3.2"/>
      </xacro:if>
      <dynamics damping="0.0" friction="0.0"/>
    </joint>

    <link name="${prefix}wrist_1_link">
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/wrist1.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/wrist1.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.6" length="0.12" mass="${wrist_1_mass}">
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}wrist_2_joint" type="revolute">
      <parent link="${prefix}wrist_1_link" />
      <child link = "${prefix}wrist_2_link" />
      <origin xyz="0.0 ${wrist_1_length} 0.0" rpy="0.0 0.0 0.0" />
      <axis xyz="0 0 1" />
      <xacro:unless value="${joint_limited}">
        <limit lower="${-2.0 * pi}" upper="${2.0 * pi}" effort="28.0" velocity="3.2"/>
      </xacro:unless>
      <xacro:if value="${joint_limited}">
        <limit lower="${wrist_2_lower_limit}" upper="${wrist_2_upper_limit}" effort="28.0" velocity="3.2"/>
      </xacro:if>
      <dynamics damping="0.0" friction="0.0"/>
    </joint>

    <link name="${prefix}wrist_2_link">
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/wrist2.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/wrist2.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.6" length="0.12" mass="${wrist_2_mass}">
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}wrist_3_joint" type="revolute">
      <parent link="${prefix}wrist_2_link" />
      <child link = "${prefix}wrist_3_link" />
      <origin xyz="0.0 0.0 ${wrist_2_length}" rpy="0.0 0.0 0.0" />
      <axis xyz="0 1 0" />
      <xacro:unless value="${joint_limited}">
        <limit lower="${-2.0 * pi}" upper="${2.0 * pi}" effort="28.0" velocity="3.2"/>
      </xacro:unless>
      <xacro:if value="${joint_limited}">
        <limit lower="${wrist_3_lower_limit}" upper="${wrist_3_upper_limit}" effort="28.0" velocity="3.2"/>
      </xacro:if>
      <dynamics damping="0.0" friction="0.0"/>
    </joint>

    <link name="${prefix}wrist_3_link">
      <visual>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/visual/wrist3.dae" />
        </geometry>
        <material name="LightGrey">
          <color rgba="0.7 0.7 0.7 1.0"/>
        </material>
      </visual>
      <collision>
        <geometry>
          <mesh filename="package://ur_description/meshes/ur5/collision/wrist3.stl" />
        </geometry>
      </collision>
      <xacro:cylinder_inertial radius="0.6" length="0.12" mass="${wrist_3_mass}">
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
      </xacro:cylinder_inertial>
    </link>

    <joint name="${prefix}ee_fixed_joint" type="fixed">
      <parent link="${prefix}wrist_3_link" />
      <child link = "${prefix}ee_link" />
      <origin xyz="0.0 ${wrist_3_length} 0.0" rpy="0.0 0.0 ${pi/2.0}" />
    </joint>

    <link name="${prefix}ee_link">
      <collision>
        <geometry>
          <box size="0.01 0.01 0.01"/>
        </geometry>
        <origin rpy="0 0 0" xyz="-0.01 0 0"/>
      </collision>
    </link>

    <xacro:ur_arm_transmission prefix="${prefix}" />
    <xacro:ur_arm_gazebo prefix="${prefix}" />

    <!-- ROS base_link to UR 'Base' Coordinates transform -->
    <link name="${prefix}base"/>
    <joint name="${prefix}base_link-base_fixed_joint" type="fixed">
      <!-- NOTE: this rotation is only needed as long as base_link itself is
                 not corrected wrt the real robot (ie: rotated over 180
                 degrees)
      -->
      <origin xyz="0 0 0" rpy="0 0 ${-pi}"/>
      <parent link="${prefix}base_link"/>
      <child link="${prefix}base"/>
    </joint>

    <!-- Frame coincident with all-zeros TCP on UR controller -->
    <link name="${prefix}tool0"/>
    <joint name="${prefix}wrist_3_link-tool0_fixed_joint" type="fixed">
      <origin xyz="0 ${wrist_3_length} 0" rpy="${pi/-2.0} 0 0"/>
      <parent link="${prefix}wrist_3_link"/>
      <child link="${prefix}tool0"/>
    </joint>

  </xacro:macro>
  <!-- Define RGB-D sensor -->
  <property name="deg_to_rad" value="0.01745329251994329577"/>
  <xacro:xtion_pro_live name="rgbd_camera" parent="base">
    <origin xyz="0.1 0 1" rpy="0 ${75.0 * deg_to_rad} 0"/>
    <origin xyz="0 0 0" rpy="${-90.0 * deg_to_rad} 0 ${-90.0 * deg_to_rad}"/>
  </xacro:xtion_pro_live>

</robot>

xacro.py is deprecated; please use xacro instead

Hi Again,

I am getting this problem. When I try to compile this chapter.

CMake Error at /home/khan/catkin_ws/devel/share/gazebo_plugins/cmake/gazebo_pluginsConfig.cmake:141 (message): Project 'seven_dof_arm_gazebo' tried to find library '-lpthread'.

Your kind suggestions would be highly appreciated and save lots of time. Thanks.

unknown macro name: xacro:base XacroException(u'unknown macro name: xacro:base',)

I have been trying to run follow this book but I am facing some problems particularly in Chapter 2 and 3 and specifically in the file view_arm.launch. It is worth mentioning that this error is also reported in ROS website as well (link)

Whenever I run this file, I get the following error

unknown macro name: xacro:base
XacroException(u'unknown macro name: xacro:base',)
when processing file: /home/khan/catkin_ws/src/mastering_ros_robot_description_pkg/urdf/seven_dof_arm.xacro
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/share/xacro/xacro.py /home/khan/catkin_ws/src/mastering_ros_robot_description_pkg/urdf/seven_dof_arm.xacro] returned with code [2]. 

Param xml is <param command="$(find xacro)/xacro.py $(find mastering_ros_robot_description_pkg)/urdf/seven_dof_arm.xacro" name="robot_description"/>
The traceback for the exception was written to the log file

I have been trying to resolve this problem in any way I can but it is not working.

I am also seeing this warning along with the above mentioned error,

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
inconsistent namespace redefinitions for xmlns:xacro:
 old: http://www.ros.org/wiki/xacro
 new: http://ros.org/wiki/xacro (/home/khan/catkin_ws/src/mastering_ros_robot_description_pkg/urdf/sensors/xtion_pro_live.urdf.xacro)
deprecated: xacro tags should be prepended with 'xacro' xml namespace.

Please, help me out how can I resolve this. Thank you.

moveit_simple_grasps

@qboticslabs
I am trying to run the command line "roslaunch seven_dof_arm_gazebo grasp_generator_server.launch",
I got a problem

[ERROR] [1465740328.774843123]: Grasp configuration parameter pregrasp_time_from_start missing from rosparam server. Did you load your end effector's configuration yaml file? Searching in namespace: /moveit_simple_grasps_server/right
[moveit_simple_grasps_server-2] process has died [pid 32558, exit code -11, cmd /home/hutlab/catkin_ws/devel/lib/moveit_simple_grasps/moveit_simple_grasps_server __name:=moveit_simple_grasps_server __log:=/home/hutlab/.ros/log/bc53a772-0493-11e7-b63f-c81f6631823d/moveit_simple_grasps_server-2.log].

I also use the moveit_simple_grasps_1.zip. but it could not solve the problem.
I am running this on Ubuntu 14.04.6, Ros indigo. Hoping to get your reply.

the model do not move to the goal in the moveit ,the procedure to interface MoveIt! to Gazebo

HI! When I follow the step in chapter4:Interfacing the MoveIt! configuration package to Gazebo
I run the moveit and gazebo successful,then when i set the new goal and excuting in the moveit,the model success move to the new goal in gazebo,but did not follow the trajectory and move to the new goal in moveit.
when i set the second goal,the model in the gazebo will go back to the original state then go to the second goal.
How can i solve this problem or how should i do ?
the_model

Couldn't execute in moveit and gazebo simultaneously

[ERROR] [1488953201.954575053, 64.624000000]: Unable to identify any set of controllers that can actuate the specified joints: [ elbow_pitch_joint elbow_roll_joint gripper_roll_joint shoulder_pan_joint shoulder_pitch_joint wrist_pitch_joint wrist_roll_joint ]
[ERROR] [1488953201.954612200, 64.624000000]: Known controllers and their joints:

[ERROR] [1488953201.954637760, 64.624000000]: Apparently trajectory initialization failed

@qboticslabs
I removed the first joint_state_controller from the seven_dof_arm_gazebo_control.launch
screenshot from 2017-03-08 11-40-48

I tried installing all the controllers but it doesn't solve the problem

No p gain specified for pid

Hello there, I have followed the Chapter 3 on ROS Hydro, when I roslaunch seven_dof_arm_gazebo seven_dof_arm_world.launch and roslaunch seven_dof_arm_gazebo seven_dof_arm_gazebo_control.launch and get below error. Actually, the first launch had throwed the pid gain error.
screenshot from 2016-05-16 08 50 40

another question is: I found the rrbot control.yaml is using the effort_controllers/JointPositionController and your seven_dof_arm use position_controllers/JointPositionController what is the difference and which is better?

Any help with this would be appreciated. Thanks in advance!

ROS joint_state_controller fail to start

Hello all,
I am having a problem where although I have managed to load joint_state_controller and velocity controller for the four joints of my robot, while spawning them i get:

[INFO] [1583148364.122978, 0.000000]: Loading controller: joint_state_controller
[INFO] [1583148364.137343, 27.471000]: Loading controller: FRJ_velocity_controller
[INFO] [1583148364.224540, 27.544000]: Loading controller: FLJ_velocity_controller
[INFO] [1583148364.282939, 27.590000]: Loading controller: BLJ_velocity_controller
[INFO] [1583148364.347087, 27.639000]: Loading controller: BRJ_velocity_controller
[INFO] [1583148364.423555, 27.701000]: Controller Spawner: Loaded controllers: joint_state_controller, FRJ_velocity_controller, FLJ_velocity_controller, BLJ_velocity_controller, BRJ_velocity_controller
[ERROR] [1583148364.426532, 27.703000]: Failed to start controllers: joint_state_controller, FRJ_velocity_controller, FLJ_velocity_controller, BLJ_velocity_controller, BRJ_velocity_controller

My robot_control launch:

<launch>

   <param name="robot_description" textfile="$(find robot)/urdf/robot.urdf" />
   <arg name="gui" default="False" />
   <param name="use_gui" value="$(arg gui)"/>
   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" ></node>
   <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />


<!-- Show in Rviz-->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find robot)/urdf.rviz"/>


  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find robot_control)/config/robot_control.yaml" command="load"/>

  <!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen" ns="/robot">
    <remap from="/joint_states" to="/robot/joint_states" />
  </node>

<!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/robot" args="joint_state_controller FRJ_velocity_controller FLJ_velocity_controller BLJ_velocity_controller BRJ_velocity_controller"/>

</launch>

My robot_control.yaml :

robot:  
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 20  

  # # Position Controllers ---------------------------------------
  # FLJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: FLJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}
  # FRJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: FRJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}

  # BLJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: BLJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}

  # BRJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: BRJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}


   #Velocity Controllers ---------------------------------------
  FRJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: FRJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

  FLJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: FRJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

  BRJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: BRJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

  BLJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: BLJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

URDF Model:


<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from robot.xacro                    | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!--This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner ([email protected]) 
     Commit Version: 1.5.1-0-g916b5db  Build Version: 1.5.7152.31018
     For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
  <link name="dummy">
  </link>
  <link name="base_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.00390777224516517 -0.032446267219719 0.184169550820421"/>
      <mass value="4.20121630268732"/>
      <inertia ixx="0.0149000386129946" ixy="-4.66831001352174E-09" ixz="5.23920338795194E-08" iyy="0.0234359493013497" iyz="0.000771538751024883" izz="0.0286744535302635"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/base_link.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.529411764705882 0.549019607843137 0.549019607843137 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/base_link.STL"/>
      </geometry>
    </collision>
  </link>
  <link name="FL">
    <inertial>
      <origin rpy="0 0 0" xyz="-5.55111512312578E-17 9.10729824887824E-18 -6.93889390390723E-18"/>
      <mass value="0.0615219544751675"/>
      <inertia ixx="5.54433425808419E-05" ixy="-1.45453466603006E-20" ixz="-1.00225538664655E-21" iyy="3.00921775305435E-05" iyz="2.309188417276E-21" izz="3.00921775305435E-05"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/FL.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.298039215686275 0.298039215686275 0.298039215686275 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/FL.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="dummy_joint" type="fixed">
    <parent link="dummy"/>
    <child link="base_link"/>
  </joint>
  <joint name="FLJ" type="continuous">
    <origin rpy="1.5707963267949 0 0" xyz="-0.162088045105054 0.0440194465480433 -0.0035605397876617"/>
    <parent link="base_link"/>
    <child link="FL"/>
    <axis xyz="-1 0 0"/>
  </joint>
  <link name="FR">
    <inertial>
      <origin rpy="0 0 0" xyz="2.77555756156289E-17 -5.3776427755281E-17 3.46944695195361E-17"/>
      <mass value="0.0615219544751675"/>
      <inertia ixx="5.54433425808419E-05" ixy="-1.73616162087809E-20" ixz="-8.97406720914896E-21" iyy="3.00921775305435E-05" iyz="-2.24902265994014E-21" izz="3.00921775305435E-05"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/FR.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.298039215686275 0.298039215686275 0.298039215686275 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/FR.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="FRJ" type="continuous">
    <origin rpy="1.5707963267949 0 0" xyz="0.169947769597777 0.0440194465480434 -0.00356053978766185"/>
    <parent link="base_link"/>
    <child link="FR"/>
    <axis xyz="-1 0 0"/>
  </joint>
  <link name="BL">
    <inertial>
      <origin rpy="0 0 0" xyz="-5.55111512312578E-17 7.85396053748499E-16 -1.38777878078145E-17"/>
      <mass value="0.0615219544751675"/>
      <inertia ixx="5.54433425808419E-05" ixy="-5.54431358512462E-21" ixz="2.27097066282367E-22" iyy="3.00921775305435E-05" iyz="2.73146067339844E-21" izz="3.00921775305435E-05"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/BL.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.298039215686275 0.298039215686275 0.298039215686275 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/BL.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="BLJ" type="continuous">
    <origin rpy="1.5707963267949 0 0" xyz="-0.162088045105054 -0.0759805534519569 -0.00356053978766179"/>
    <parent link="base_link"/>
    <child link="BL"/>
    <axis xyz="-1 0 0"/>
  </joint>
  <link name="BR">
    <inertial>
      <origin rpy="0 0 0" xyz="-8.32667268468867E-17 7.03430369508595E-16 2.77555756156289E-17"/>
      <mass value="0.0615219544751675"/>
      <inertia ixx="5.54433425808419E-05" ixy="-7.26178700863739E-21" ixz="-6.24920580783796E-21" iyy="3.00921775305435E-05" iyz="-3.51228039755728E-21" izz="3.00921775305435E-05"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/BR.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.298039215686275 0.298039215686275 0.298039215686275 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/BR.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="BRJ" type="continuous">
    <origin rpy="1.5708 0 0" xyz="0.16991 -0.075981 -0.0035605"/>
    <parent link="base_link"/>
    <child link="BR"/>
    <axis xyz="-1 0 0"/>
  </joint>
  <link name="TB">
    <inertial>
      <origin rpy="0 0 0" xyz="-7.8063E-18 1.3878E-17 0.001"/>
      <mass value="0.36807"/>
      <inertia ixx="0.00019523" ixy="7.0972E-20" ixz="-4.0656E-22" iyy="0.0026688" iyz="4.5169E-23" izz="0.0028638"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/TB.STL"/>
      </geometry>
      <material name="">
        <color rgba="0.52941 0.54902 0.54902 1"/>
      </material>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://robot/meshes/TB.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="TBJ" type="fixed">
    <origin rpy="0 0 0" xyz="0.003912 -0.086602 0.46844"/>
    <parent link="base_link"/>
    <child link="TB"/>
    <axis xyz="0 0 0"/>
  </joint>
  <!--             LIDAR                     -->
  <gazebo reference="hokuyo_link">
    <sensor name="head_hokuyo_sensor" type="ray">
      <pose> 0 0 0 0 0 0 </pose>
      <visualize>true</visualize>
      <update_rate>40</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>720</samples>
            <resolution>1</resolution>
            <min_angle>-1.57079</min_angle>
            <max_angle>1.57079</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.1</min>
          <max>30</max>
          <resolution>0.1</resolution>
        </range>
      </ray>
      <plugin filename="libgazebo_ros_laser.so" name="gazebo_ros_head_hokuyo_controller">
        <topicName>/scan</topicName>
        <frameName>hokuyo_link</frameName>
      </plugin>
    </sensor>
  </gazebo>
  <joint name="TB_Lidar" type="fixed">
    <axis xyz="0 1 0"/>
    <parent link="TB"/>
    <child link="hokuyo_link"/>
    <origin rpy="0 0 1.57079633" xyz="0 0 0.005"/>
  </joint>
  <!-- Hokuyo Laser -->
  <link name="hokuyo_link">
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.01 0.01 0.01"/>
      </geometry>
    </collision>
  </link>
  <!--                 Gazebo Ros Control Plugin                   -->
  <gazebo>
    <plugin filename="libgazebo_ros_control.so" name="gazebo_ros_control">
      <robotNamespace>/robot</robotNamespace>
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
      <legacyModeNS>true</legacyModeNS>
    </plugin>
  </gazebo>
  <!--                 Gazebo Transmission                        -->
  <transmission name="FLT">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="motor1">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="FLJ">
      <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
  </transmission>
  <transmission name="FRT">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="motor2">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="FRJ">
      <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
  </transmission>
  <transmission name="BLT">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="motor3">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="BLJ">
      <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
  </transmission>
  <transmission name="BRT">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="motor4">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="BRJ">
      <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
  </transmission>
  <!--                Differential Drive           
  <gazebo>
    <plugin name="differential_drive_controller" filename = "libgazebo_ros_diff_drive.so">
      <leftJoint>FLJ</leftJoint>
      <legacyMode>false</legacyMode>
      <rightJoint>FRJ</rightJoint>
      <robotBaseFrame>base_link</robotBaseFrame>
      <wheelSeperation>0.25</wheelSeperation>
      <wheelDiameter>0.07</wheelDiameter>
      <publishWheelJointState>true</publishWheelJointState>
    </plugin>
   </gazebo>
  -->
</robot>

Note that if I replace velocity with position controllers, I am able to load joint_state_controller as well as postion controllers for my 4 joints after first loading Gazebo simulation.

Any help appreciated.

Problem of Capter6 code

Hi. When I tried to run chapter 6 code (roslaunch my_controller_pkg my_controller.launch), following error message appeared.
Why is this? I cannot solve this problem.

[ERROR] [1509151282.659039134, 11.464000000]: Could not load class my_controller_pkg/MyControllerPlugin: Could not find library corresponding to plugin my_controller_pkg/MyControllerPlugin. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
[ERROR] [1509151282.659179317, 11.464000000]: Could not load controller 'my_controller_name' because controller type 'my_controller_pkg/MyControllerPlugin' does not exist

My simulation environment is
Ubuntu 14LTS
ROS indigo

[chapter 3, Adding the ROS teleop node] roslaunch diff_wheeled_robot_control keyboard_teleop.launch

I tried to do as chapter 3, Adding the ROS teleop node indicates
(page.111)

wkyoun@wkyoun-XPS-13-9343:~/catkin_ws$ roslaunch diff_wheeled_robot_control keyboard_teleop.launch

However, it shows error as following:

ERROR: cannot launch node of type [diff_wheeled_robot_control/diff_wheeled_robot_key]: can't locate node [diff_wheeled_robot_key] in package [diff_wheeled_robot_control]

It seems to me that diff_wheeled_robot_key(made by python language) is not include in the package.

... logging to /home/wkyoun/.ros/log/601e2e90-c273-11e5-b9dd-c48e8ff3cd6f/roslaunch-wkyoun-    XPS-13-9343-3813.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://192.168.0.4:41147/

SUMMARY
========

PARAMETERS
 * /diff_wheeled_robot_key/scale_angular: 1.5
 * /diff_wheeled_robot_key/scale_linear: 0.5
 * /rosdistro: indigo
 * /rosversion: 1.11.16

NODES
  /
    diff_wheeled_robot_key (diff_wheeled_robot_control/diff_wheeled_robot_key)

ROS_MASTER_URI=http://192.168.0.4:11311

core service [/rosout] found
ERROR: cannot launch node of type [diff_wheeled_robot_control/diff_wheeled_robot_key]: can't     locate node [diff_wheeled_robot_key] in package [diff_wheeled_robot_control]
No processes to monitor
shutting down processing monitor...
... shutting down processing monitor complete

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.