osrf / rosbook

Example code to accompany the book Programming Robots with ROS
Apache License 2.0
476 stars 237 forks source link

NASA R2 repositories have moved #24

Open gbiggs opened 7 years ago

gbiggs commented 7 years ago

NASA appears to have moved all their code for the R2 simulation to gitlab.

https://gitlab.com/nasa-jsc-robotics/robonaut2/wikis/R2%20Gazebo%20Simulation

The bitbucket repositories have all been marked as deprecated and renamed, meaning that the instructions on page 172 no longer work.

https://bitbucket.org/nasa_ros_pkg/

Additionally, the install process appears to have changed (probably the code has been reorganised); see the above page.

ghost commented 7 years ago

I encountered this too, and decided to move on and just read the chapter w/o practicing (I'll find something else to cover that) due to compile errors which I assumed were because of API changes (read the kinetic part below), it would be awesome to get this fixed in another edition.

I chose to follow the book using ROS Kinetic, and so far (I'm on chapter 12) this has been the only chapter that didn't work with trivial fixes (trivial as in just replace "indigo" with "kinetic" in the packages you're installing). Skimming through the remaining chapters it might also be the only one throughout the book, but I can't be 100% sure without actually trying.

gbiggs commented 7 years ago

I'm currently working on fixing this problem. I hope to have revised sample code for the chapter by the end of this month.

Regarding Kinetic support, the reorganised sample code (which includes the fixes ticketed here) available below has mostly be tested as working on Kinetic.

https://github.com/gbiggs/ros_book_sample_code

Only the three noted chapters had problems. With the recent release of MoveIt! on Kinetic, I expect to have all that code working and packaged for Kinetic soon.

On Feb 22, 2017, at 20:44, Bogdan Alexandru Marginean notifications@github.com wrote:

I encountered this too, and decided to move on and just read the chapter w/o practicing (I'll find something else to cover that) due to compile errors which I assumed were because of API changes (read the kinetic part below), it would be awesome to get this fixed in another edition.

I chose to follow the book using ROS Kinetic, and so far (I'm on chapter 12) this has been the only chapter that didn't work with trivial fixes (trivial as in just replace "indigo" with "kinetic" in the packages you're installing). Skimming through the remaining chapters it might also be the only one throughout the book, but I can't be 100% sure without actually trying.

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ghost commented 7 years ago

Awesome stuff, thanks for your effort! Interesting that you listed chapter 12 as being buggy on Kinetic. The line shows up fine for me in Gazebo and I can run the python examples fine. Or rather almost fine, I have some issues with images not showing up in the window unless I create the window in the topic callback. No clue as to why so far but after some googling it seems people have all kinds of strange behaviors with imshow, named windows and waitKey. Need to investigate some more later.

gbiggs commented 7 years ago

That means it's probably either a bug that has been fixed since I set up that code 6 months ago, or something in my environment (Gazebo can sometimes be sensitive to your environment not being quite right). If it's working for you then that's great; it's one less thing I need to fix! :)

gbiggs commented 7 years ago

Regarding the existing bitbucket repositories on Indigo/14.04, I have tested them and they work just fine. All that needs changing is adding deprecated_ to the repository name:

git clone -b indigo https://bitbucket.org/nasa_ros_pkg/deprecated_nasa_r2_simulator.git
git clone -b indigo https://bitbucket.org/nasa_ros_pkg/deprecated_nasa_r2_common.git

Unfortunately, they do not build as-is on Kinetic/16.04. The gazebo_gripper package has numerous errors in libraries such as sdformat and ignition which appear to relate to the compiler version. Because the code is deprecated, I do not think it is feasible to try and make it work on Kinetic.

gbiggs commented 7 years ago

Here's my progress on the new R2 code.

Possible repository/package mappings from bitbucket to gitlab

gazebo_gripper                git@gitlab.com:nasa-jsc-robotics/r2_gazebo_gripper.git
gazebo_interface              git@gitlab.com:nasa-jsc-robotics/r2_gazebo_interface.git
gazebo_taskboard              git@gitlab.com:nasa-jsc-robotics/iss_taskboard_gazebo.git
nasa_r2_simulator             
r2_controllers_ros            
r2_gazebo                     git@gitlab.com:nasa-jsc-robotics/r2_gazebo.git

nasa_r2_common                
nasa_r2_common_msgs           
r2_control                    git@gitlab.com:nasa-jsc-robotics/r2_supervisors_control.git
r2_description                git@gitlab.com:nasa-jsc-robotics/r2_description.git
r2_fullbody_moveit_config     git@gitlab.com:nasa-jsc-robotics/r2_moveit_config.git
r2_moveit_config              git@gitlab.com:nasa-jsc-robotics/r2_upperbody_moveit_config.git

The installation instructions on the below webpage are fairly accurate. I didn't bother with the rosdeps stuff as I assumed I already had everything I needed; this assumption turned out to be correct.

https://gitlab.com/nasa-jsc-robotics/robonaut2/wikis/R2%20Gazebo%20Simulation

To grab whole workspace:

mkdir -p chessbot/src
cd chessbot/src
catkin_init_workspace
git clone git@gitlab.com:nasa-jsc-robotics/r2_workspaces.git
vcs import < ~/git/r2_workspaces/public_sim.yaml
cd robot_instance
git checkout 2016_11_7_ar_demo
cd ../..
catkin_make

Kinetic

r2_supervisors_control depends on driver_base, which is both deprecated and not available in kinetic. It uses the SensorLevels message from this package, which has been moved to dynamic_reconfigure. Change the import and dependency specifications to dynamic_reconfigure and it compiles.

iss_taskboard_gazebo does not compile with the version of Boost included in Ubuntu 16.04 (1.58?). The file plugins/src/ISSTaskboardPanelA.cpp needs to include boost/algorithm/string/replace.hpp to get boost::replace_all().

In r2_gazebo, the file r2c.gazebo.sensors.xacro includes two sensor xacro files, but includes them by path relative to the parent directory, not the directory that r2c.gazebo.sensors.xacro is in. This fixes the problem:

diff --git a/xacro/sensors/r2c.gazebo.sensors.xacro b/xacro/sensors/r2c.gazebo.sensors.xacro
index 01d4e64..aa89f65 100644
--- a/xacro/sensors/r2c.gazebo.sensors.xacro
+++ b/xacro/sensors/r2c.gazebo.sensors.xacro
@@ -4,8 +4,8 @@
                        xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
                        xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface">

-  <xacro:include filename="sensors/grasshopper2.gazebo.xacro" />
-  <xacro:include filename="sensors/asus.gazebo.xacro" />
+  <xacro:include filename="grasshopper2.gazebo.xacro" />
+  <xacro:include filename="asus.gazebo.xacro" />
   <!-- Left Camera -->
   <joint name="${robot_name}fixed/left_camera_frame/left_camera_optical_frame" type="fixed">
     <parent link="${robot_name}head/left_camera_frame"/>

The correct MoveIt! configuration is changed from r2_moveit_config to r2_upperbody_moveit_config. The full-body one does have a "no_legs" parameter but it seemed to be causing problems which I haven't had time to fix yet.

With the above process and fixes, it compiles on Kinetic/16.04, and Gazebo launches. However, it does not respond to MoveIt! control. Despite r2_supervisors_control/r2_test.py reporting that the test was a success, the simulated robot never moves and appears to be freely moving under gravity.

Indigo

Include fixes made above, except for the xacro file change (is this a change in behaviour in xacro between Indigo and Kinetic?).

The ros-indigo-log4cpp package must be installed.

Compiles, and when run the robot appears to be controlling its joints (they do not fall freely under gravity). The r2_ready_pose.py and r2_ready_pose_high.py scripts do control the joints.

MoveIt! samples in the book do not work. They all fail to find a motion plan. Output of r2_cli.py:

ABORTED: No motion plan found. No execution attempted.

Output of move_group:

[ INFO] [1488266368.974722161, 222.025000000]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline.
[ INFO] [1488266368.975038126, 222.025000000]: Planning attempt 1 of at most 1
[ INFO] [1488266368.977612917, 222.025000000]: No planner specified. Using default.
[ INFO] [1488266368.978463626, 222.025000000]: RRTConnect: Starting planning with 1 states already in datastructure
[ERROR] [1488266373.985949642, 225.201000000]: RRTConnect: Unable to sample any valid states for goal tree
[ INFO] [1488266373.986062813, 225.201000000]: RRTConnect: Created 1 states (1 start + 0 goal)
[ INFO] [1488266373.986082825, 225.201000000]: No solution found after 5.008049 seconds
[ INFO] [1488266374.055969839, 225.251000000]: Unable to solve the planning problem
gbiggs commented 7 years ago

I think that, given that the book targets Indigo, the easiest option is to create copies here of the two NASA BitBucket repositories that have been marked as deprecated, and alter the instructions in the book for cloning the code to use the URLs for these instead of the BitBucket URLs. A note could be added pointing out that a newer version of the code is available at NASA's GitLab site, but the sample code in the book may not work as-is with it.