Skip to content

RoboND Refresh mini-project to explain pub-sub architecture in ROS

License

Notifications You must be signed in to change notification settings

sunsided/RoboND-simple_arm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Udacity - Robotics NanoDegree Program

RoboND-simple_arm

A mini-project to better explain pub-sub architecture in ROS.

Simulation interface

How to Launch the simulation?

Create a catkin_ws, feel free to skip if you already have one!

cd /home/workspace/
mkdir -p /home/workspace/catkin_ws/src/
cd catkin_ws/src/
catkin_init_workspace
cd ..

Clone the package in catkin_ws/src/

cd /home/workspace/catkin_ws/src/
git clone https://github.com/udacity/RoboND-simple_arm.git simple_arm

Build the simple_arm package

cd /home/workspace/catkin_ws/
catkin_make

After building the package, source your environment

cd /home/workspace/catkin_ws/
source devel/setup.bash

Make sure to check and install any missing dependencies

rosdep install -i simple_arm

Once the simple_arm package has been built, you can launch the simulation environment using

roslaunch simple_arm robot_spawn.launch

Interact with the arm using the safe_move service

Open a new terminal and type the following:

cd /home/workspace/catkin_ws/
source devel/setup.bash
rosservice call /arm_mover/safe_move "joint_1: 0.0 joint_2: 0.0"

When trying to move the arm using the following command (line break required!),

rosservice call /arm_mover/safe_move "joint_1: 1.57
joint_2: 2.0"

the ROS server will report an error:

[ WARN] [1590169890.483779630, 524.840000000]: j2 is out of bounds, valid range (0.00,1.57), clamping to: 1.57

We can update the joint limits by reaching out to the parameter server …

rosparam set /arm_mover/max_joint_2_angle 2.0

… after which the rosservice call above will succeed as intended.

How to view image stream from the camera?

Camera image stream is published to the following topic:

/rgb_camera/image_raw

This stream can be viewed by following command in separate terminal:

rosrun image_view image_view image:=/rgb_camera/image_raw

Fixing issues for Kinetic

Error: legacyModeNS

Originally, the code produced the following output:

[ERROR] [1590091780.648877316, 261.772000000]: GazeboRosControlPlugin missing <legacyModeNS> while using DefaultRobotHWSim, defaults to true.
This setting assumes you have an old package with an old implementation of DefaultRobotHWSim, where the robotNamespace is disregarded and absolute paths are used instead.
If you do not want to fix this issue in an old package just set <legacyModeNS> to true.

Following the answers to this question, we can find the file that needs changes by running

grep robotSimType -R .

This gives

./src/simple_arm/urdf/simple_arm.gazebo.xacro

Changing the section

<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
        <robotNamespace>/simple_arm</robotNamespace>
        <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
</gazebo>

to contain <legacyModeNS>true</legacyModeNS> like so suppresses the error:

<gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
        <legacyModeNS>true</legacyModeNS>
        <robotNamespace>/simple_arm</robotNamespace>
        <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
</gazebo>

About

RoboND Refresh mini-project to explain pub-sub architecture in ROS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 53.8%
  • CMake 46.2%