diff --git a/README.md b/README.md index 6d4fde2c1..cf7bf0535 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Wrappers, tools and additional API's for using ROS with the Gazebo simulator. Fo [Installing gazebo_ros_pkgs](http://gazebosim.org/wiki/Tutorials/1.9/Installing_gazebo_ros_Packages) ### Documentation and Tutorials -[On gazebosim.org](http://gazebosim.org/wiki/Tutorials#ROS_Integration) +[On gazebosim.org](http://gazebosim.org/tutorials?cat=connect_ros) ### Develop and Contribute diff --git a/gazebo_msgs/CHANGELOG.rst b/gazebo_msgs/CHANGELOG.rst index 94beba3f1..e16394ecf 100644 --- a/gazebo_msgs/CHANGELOG.rst +++ b/gazebo_msgs/CHANGELOG.rst @@ -2,9 +2,42 @@ Changelog for package gazebo_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.4.6 (2014-09-01) +------------------ + +2.4.5 (2014-08-18) +------------------ + +2.4.4 (2014-07-18) +------------------ +* Fix repo names in package.xml's +* Contributors: Jon Binney + +2.4.3 (2014-05-12) +------------------ + +2.4.2 (2014-03-27) +------------------ +* merging from hydro-devel +* bump patch version for indigo-devel to 2.4.1 +* merging from indigo-devel after 2.3.4 release +* "2.4.0" +* catkin_generate_changelog +* Contributors: John Hsu + +2.4.1 (2013-11-13) +------------------ +* rerelease because sdformat became libsdformat, but we also based change on 2.3.4 in hydro-devel. + 2.4.0 (2013-10-14) ------------------ +2.3.5 (2014-03-26) +------------------ + +2.3.4 (2013-11-13) +------------------ + 2.3.3 (2013-10-10) ------------------ diff --git a/gazebo_msgs/package.xml b/gazebo_msgs/package.xml index ae772e5d7..a7e73c4d0 100644 --- a/gazebo_msgs/package.xml +++ b/gazebo_msgs/package.xml @@ -1,7 +1,7 @@ gazebo_msgs - 2.4.0 + 2.4.6 Message and service data structures for interacting with Gazebo from ROS. @@ -11,8 +11,8 @@ BSD http://gazebosim.org/wiki/Tutorials#ROS_Integration - https://github.com/osrf/gazebo_ros_pkgs/issues - https://github.com/osrf/gazebo_ros_pkgs + https://github.com/ros-simulation/gazebo_ros_pkgs/issues + https://github.com/ros-simulation/gazebo_ros_pkgs John Hsu diff --git a/gazebo_plugins/CHANGELOG.rst b/gazebo_plugins/CHANGELOG.rst index 404c1181a..9911983f1 100644 --- a/gazebo_plugins/CHANGELOG.rst +++ b/gazebo_plugins/CHANGELOG.rst @@ -2,6 +2,125 @@ Changelog for package gazebo_plugins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.4.6 (2014-09-01) +------------------ +* Update gazebo_ros_openni_kinect.cpp +* merging from hydro-devel into indigo-devel +* Merge pull request `#204 `_ from fsuarez6/hydro-devel + gazebo_plugins: Adding ForceTorqueSensor Plugin +* Updated to Apache 2.0 license +* Merge pull request `#180 `_ from vrabaud/indigo-devel + remove PCL dependency +* merging +* check deprecation of gazebo::Joint::SetAngle by SetPosition +* compatibility with gazebo 4.x +* Update changelogs for the upcoming release +* Fix build with gazebo4 and indigo +* Added Gaussian Noise generator +* publish organized pointcloud from openni plugin +* Changed measurement direction to "parent to child" +* gazebo_plugin: Added updateRate parameter to the gazebo_ros_imu plugin +* gazebo_plugins: Adding ForceTorqueSensor Plugin +* remove PCL dependency +* ros_camera_utils: Adding CameraInfoManager to satisfy full ROS camera API (relies on https://github.com/ros-perception/image_common/pull/20 ) + ros_camera_utils: Adding CameraInfoManager to satisfy full ROS camera API (relies on https://github.com/ros-perception/image_common/pull/20 ) +* Contributors: John Hsu, Jonathan Bohren, Jose Luis Rivero, Nate Koenig, Ryohei Ueda, Vincent Rabaud, fsuarez6, gborque, John Binney + +2.4.5 (2014-08-18) +------------------ +* Replace SetAngle with SetPosition for gazebo 4 and up +* Port fix_build branch for indigo-devel + See pull request `#221 `_ +* Contributors: Jose Luis Rivero, Steven Peters + +2.4.4 (2014-07-18) +------------------ +* Merge branch 'hydro-devel' into indigo-devel +* gazebo_ros_diff_drive gazebo_ros_tricycle_drive encoderSource option names updated +* gazebo_ros_diff_drive is now able to use the wheels rotation of the optometry or the gazebo ground truth based on the 'odometrySource' parameter +* simple linear controller for the tricycle_drive added +* second robot for testing in tricycle_drive_scenario.launch added +* Merge remote-tracking branch 'upstream/hydro-devel' into hydro-devel +* BDS licenses header fixed and tricycle drive plugin added +* format patch of hsu applied +* Updated package.xml +* Fix repo names in package.xml's +* ros diff drive supports now an acceleration limit +* Pioneer model: Diff_drive torque reduced +* GPU Laser test example added +* fixed gpu_laser to work with workspaces +* hand_of_god: Adding hand-of-god plugin + ros_force: Fixing error messages to refer to the right plugin +* Remove unneeded dependency on pcl_ros +* minor fixes on relative paths in xacro for pioneer robot +* gazebo test model pionneer 3dx updated with xacro path variables +* pioneer model update for the multi_robot_scenario +* Merge remote-tracking branch 'upstream/hydro-devel' into hydro-devel +* fixed camera to work with workspaces +* fixed links related to changed name +* diff drive name changed to multi robot scenario +* working camera added +* Merge remote-tracking branch 'upstream/hydro-devel' into hydro-devel +* fix in pioneer xacro model for diff_drive +* Laser colour in rviz changed +* A test model for the ros_diff_drive ros_laser and joint_state_publisher added +* the ros_laser checkes now for the model name and adds it als prefix +* joint velocity fixed using radius instead of diameter +* ROS_INFO on laser plugin added to see if it starts +* fetched with upstream +* gazebo_ros_diff_drive was enhanced to publish the wheels tf or the wheels joint state depending on two additinal xml options +* Gazebo ROS joint state publisher added +* Contributors: Dave Coleman, John Hsu, Jon Binney, Jonathan Bohren, Markus Bader, Steven Peters + +2.4.3 (2014-05-12) +------------------ +* gazebo_plugins: add run-time dependency on gazebo_ros +* Merge pull request `#176 `_ from ros-simulation/issue_175 + Fix `#175 `_: dynamic reconfigure dependency error +* Remove unneeded dependency on pcl_ros +* Fix `#175 `_: dynamic reconfigure dependency error +* Contributors: Steven Peters + +2.4.2 (2014-03-27) +------------------ +* merging from hydro-devel +* bump patch version for indigo-devel to 2.4.1 +* merging from indigo-devel after 2.3.4 release +* "2.4.0" +* catkin_generate_changelog +* Contributors: John Hsu + +2.4.1 (2013-11-13) +------------------ + +2.3.5 (2014-03-26) +------------------ +* update test world for block laser +* this corrects the right orientation of the laser scan and improves on comparison between 2 double numbers +* Initialize ``depth_image_connect_count_`` in openni_kinect plugin +* multicamera bad namespace. Fixes `#161 `_ + There was a race condition between GazeboRosCameraUtils::LoadThread + creating the ros::NodeHandle and GazeboRosCameraUtils::Load + suffixing the camera name in the namespace +* Use function for accessing scene node in gazebo_ros_video +* readded the trailing whitespace for cleaner diff +* the parent sensor in gazebo seems not to be active +* Contributors: Dejan Pangercic, Ian Chen, John Hsu, Jordi Pages, Toni Oliver, Ugo Cupcic + +2.3.4 (2013-11-13) +------------------ +* rerelease because sdformat became libsdformat, but we also based change on 2.3.4 in hydro-devel. +* Simplify ``gazebo_plugins/CMakeLists.txt`` + Replace ``cxx_flags`` and ``ld_flags`` variables with simpler cmake macros + and eliminate unnecessary references to ``SDFormat_LIBRARIES``, since + they are already part of ``GAZEBO_LIBRARIES``. +* Put some cmake lists on multiple lines to improve readability. +* Add dependencies on dynamic reconfigure files + Occasionally the build can fail due to some targets having an + undeclared dependency on automatically generated dynamic + reconfigure files (GazeboRosCameraConfig.h for example). This + commit declares several of those dependencies. + 2.4.0 (2013-10-14) ------------------ diff --git a/gazebo_plugins/CMakeLists.txt b/gazebo_plugins/CMakeLists.txt index 43f68b5c5..2ef56f6e7 100644 --- a/gazebo_plugins/CMakeLists.txt +++ b/gazebo_plugins/CMakeLists.txt @@ -14,17 +14,17 @@ find_package(catkin REQUIRED COMPONENTS nav_msgs urdf tf + tf2_ros dynamic_reconfigure driver_base rosgraph_msgs trajectory_msgs - pcl_ros - pcl_conversions image_transport rosconsole cv_bridge polled_camera diagnostic_updater + camera_info_manager ) include (FindPkgConfig) @@ -38,7 +38,6 @@ endif() # Depend on system install of Gazebo and SDFormat find_package(gazebo REQUIRED) -find_package(PCL REQUIRED) find_package(Boost REQUIRED COMPONENTS thread) execute_process(COMMAND @@ -49,26 +48,31 @@ execute_process(COMMAND catkin_python_setup() -generate_dynamic_reconfigure_options(cfg/CameraSynchronizer.cfg cfg/GazeboRosCamera.cfg cfg/GazeboRosOpenniKinect.cfg cfg/Hokuyo.cfg) - -include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS} ${OGRE_INCLUDE_DIRS} ${OGRE-Terrain_INCLUDE_DIRS} ${SDFormat_INCLUDE_DIRS}) - -# \todo: remove these? -set(cxx_flags) -foreach (item ${GAZEBO_CFLAGS}) - set(cxx_flags "${cxx_flags} ${item}") -endforeach () +generate_dynamic_reconfigure_options( + cfg/CameraSynchronizer.cfg + cfg/GazeboRosCamera.cfg + cfg/GazeboRosOpenniKinect.cfg + cfg/Hokuyo.cfg +) -set(ld_flags) -foreach (item ${GAZEBO_LDFLAGS}) - set(ld_flags "${ld_flags} ${item}") -endforeach () +include_directories(include + ${Boost_INCLUDE_DIRS} + ${catkin_INCLUDE_DIRS} + ${GAZEBO_INCLUDE_DIRS} + ${OGRE_INCLUDE_DIRS} + ${OGRE-Terrain_INCLUDE_DIRS} +) +link_directories( + ${GAZEBO_LIBRARY_DIRS} + ${OGRE_LIBRARY_DIRS} +) catkin_package( INCLUDE_DIRS include LIBRARIES vision_reconfigure + gazebo_ros_utils gazebo_ros_camera_utils gazebo_ros_camera gazebo_ros_multicamera @@ -80,14 +84,17 @@ catkin_package( gazebo_ros_p3d gazebo_ros_imu gazebo_ros_f3d + gazebo_ros_ft_sensor gazebo_ros_bumper gazebo_ros_template gazebo_ros_projector gazebo_ros_prosilica gazebo_ros_force gazebo_ros_joint_trajectory + gazebo_ros_joint_state_publisher gazebo_ros_joint_pose_trajectory gazebo_ros_diff_drive + gazebo_ros_tricycle_drive gazebo_ros_skid_steer_drive gazebo_ros_video gazebo_ros_planar_move @@ -105,18 +112,19 @@ catkin_package( nav_msgs urdf tf + tf2_ros dynamic_reconfigure driver_base rosgraph_msgs trajectory_msgs - pcl_ros - pcl_conversions image_transport rosconsole + camera_info_manager DEPENDS gazebo SDF ) +add_dependencies(${PROJECT_NAME}_gencfg ${catkin_EXPORTED_TARGETS}) ## Executables add_executable(hokuyo_node src/hokuyo_node.cpp) @@ -125,134 +133,116 @@ target_link_libraries(hokuyo_node ${catkin_LIBRARIES} ) +add_library(gazebo_ros_utils src/gazebo_ros_utils.cpp) +target_link_libraries(gazebo_ros_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + add_library(vision_reconfigure src/vision_reconfigure.cpp) -add_dependencies(vision_reconfigure gazebo_plugins_gencfg) +add_dependencies(vision_reconfigure ${PROJECT_NAME}_gencfg) target_link_libraries(vision_reconfigure ${catkin_LIBRARIES}) add_executable(camera_synchronizer src/camera_synchronizer.cpp) +add_dependencies(camera_synchronizer ${PROJECT_NAME}_gencfg) target_link_libraries(camera_synchronizer vision_reconfigure ${catkin_LIBRARIES}) add_executable(pub_joint_trajectory_test test/pub_joint_trajectory_test.cpp) -set_target_properties(pub_joint_trajectory_test PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(pub_joint_trajectory_test PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(pub_joint_trajectory_test ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(pub_joint_trajectory_test ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_dependencies(pub_joint_trajectory_test ${catkin_EXPORTED_TARGETS}) # don't build until gazebo_msgs is done add_definitions(-fPIC) # what is this for? ## Plugins add_library(gazebo_ros_camera_utils src/gazebo_ros_camera_utils.cpp) -set_target_properties(gazebo_ros_camera_utils PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_camera_utils PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +add_dependencies(gazebo_ros_camera_utils ${PROJECT_NAME}_gencfg) +target_link_libraries(gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(MultiCameraPlugin src/MultiCameraPlugin.cpp) -set_target_properties(MultiCameraPlugin PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(MultiCameraPlugin PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(MultiCameraPlugin ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(MultiCameraPlugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_camera src/gazebo_ros_camera.cpp) -set_target_properties(gazebo_ros_camera PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_camera PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} CameraPlugin ${catkin_LIBRARIES}) +add_dependencies(gazebo_ros_camera ${PROJECT_NAME}_gencfg) +target_link_libraries(gazebo_ros_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} CameraPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_multicamera src/gazebo_ros_multicamera.cpp) -set_target_properties(gazebo_ros_multicamera PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_multicamera PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_multicamera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} MultiCameraPlugin ${catkin_LIBRARIES}) +add_dependencies(gazebo_ros_multicamera ${PROJECT_NAME}_gencfg) +target_link_libraries(gazebo_ros_multicamera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} MultiCameraPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_depth_camera src/gazebo_ros_depth_camera.cpp) -set_target_properties(gazebo_ros_depth_camera PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_depth_camera PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_depth_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES}) +add_dependencies(gazebo_ros_depth_camera ${PROJECT_NAME}_gencfg) +target_link_libraries(gazebo_ros_depth_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_openni_kinect src/gazebo_ros_openni_kinect.cpp) -set_target_properties(gazebo_ros_openni_kinect PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_openni_kinect PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_openni_kinect gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES}) +add_dependencies(gazebo_ros_openni_kinect ${PROJECT_NAME}_gencfg) +target_link_libraries(gazebo_ros_openni_kinect gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_gpu_laser src/gazebo_ros_gpu_laser.cpp) -set_target_properties(gazebo_ros_gpu_laser PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_gpu_laser PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_gpu_laser ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} GpuRayPlugin) +target_link_libraries(gazebo_ros_gpu_laser ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} GpuRayPlugin) add_library(gazebo_ros_laser src/gazebo_ros_laser.cpp) -set_target_properties(gazebo_ros_laser PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_laser PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_laser ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} RayPlugin ${catkin_LIBRARIES}) +target_link_libraries(gazebo_ros_laser ${GAZEBO_LIBRARIES} RayPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_block_laser src/gazebo_ros_block_laser.cpp) -set_target_properties(gazebo_ros_block_laser PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_block_laser PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_block_laser ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} RayPlugin ${catkin_LIBRARIES}) +target_link_libraries(gazebo_ros_block_laser ${GAZEBO_LIBRARIES} RayPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_p3d src/gazebo_ros_p3d.cpp) -set_target_properties(gazebo_ros_p3d PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_p3d PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_p3d ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_p3d ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_imu src/gazebo_ros_imu.cpp) -set_target_properties(gazebo_ros_imu PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_imu PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_imu ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_imu ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_f3d src/gazebo_ros_f3d.cpp) -set_target_properties(gazebo_ros_f3d PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_f3d PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_f3d ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_f3d ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_bumper src/gazebo_ros_bumper.cpp) add_dependencies(gazebo_ros_bumper gazebo_msgs_gencpp) -set_target_properties(gazebo_ros_bumper PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_bumper PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_bumper ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${Boost_LIBRARIES} ContactPlugin ${catkin_LIBRARIES}) +target_link_libraries(gazebo_ros_bumper ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ContactPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_projector src/gazebo_ros_projector.cpp) -set_target_properties(gazebo_ros_projector PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_projector PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_projector ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES}) +target_link_libraries(gazebo_ros_projector ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES}) add_library(gazebo_ros_prosilica src/gazebo_ros_prosilica.cpp) -set_target_properties(gazebo_ros_prosilica PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_prosilica PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_prosilica gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} CameraPlugin ${catkin_LIBRARIES}) +add_dependencies(gazebo_ros_prosilica ${PROJECT_NAME}_gencfg) +target_link_libraries(gazebo_ros_prosilica gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} CameraPlugin ${catkin_LIBRARIES}) add_library(gazebo_ros_force src/gazebo_ros_force.cpp) -set_target_properties(gazebo_ros_force PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_force PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_force ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_force ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_joint_trajectory src/gazebo_ros_joint_trajectory.cpp) -set_target_properties(gazebo_ros_joint_trajectory PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_joint_trajectory PROPERTIES COMPILE_FLAGS "${cxx_flags}") add_dependencies(gazebo_ros_joint_trajectory gazebo_msgs_gencpp) -target_link_libraries(gazebo_ros_joint_trajectory ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_joint_trajectory ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + + +add_library(gazebo_ros_joint_state_publisher src/gazebo_ros_joint_state_publisher.cpp) +set_target_properties(gazebo_ros_joint_state_publisher PROPERTIES LINK_FLAGS "${ld_flags}") +set_target_properties(gazebo_ros_joint_state_publisher PROPERTIES COMPILE_FLAGS "${cxx_flags}") +add_dependencies(gazebo_ros_joint_state_publisher gazebo_msgs_gencpp) +target_link_libraries(gazebo_ros_joint_state_publisher ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_joint_pose_trajectory src/gazebo_ros_joint_pose_trajectory.cpp) -set_target_properties(gazebo_ros_joint_pose_trajectory PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_joint_pose_trajectory PROPERTIES COMPILE_FLAGS "${cxx_flags}") add_dependencies(gazebo_ros_joint_pose_trajectory gazebo_msgs_gencpp) -target_link_libraries(gazebo_ros_joint_pose_trajectory ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_joint_pose_trajectory ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_diff_drive src/gazebo_ros_diff_drive.cpp) -set_target_properties(gazebo_ros_diff_drive PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_diff_drive PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_diff_drive ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_diff_drive gazebo_ros_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + +add_library(gazebo_ros_tricycle_drive src/gazebo_ros_tricycle_drive.cpp) +target_link_libraries(gazebo_ros_tricycle_drive gazebo_ros_utils ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES}) add_library(gazebo_ros_skid_steer_drive src/gazebo_ros_skid_steer_drive.cpp) -set_target_properties(gazebo_ros_skid_steer_drive PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_skid_steer_drive PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_skid_steer_drive ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_skid_steer_drive ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_library(gazebo_ros_video src/gazebo_ros_video.cpp) -set_target_properties(gazebo_ros_video PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_video PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_video ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OGRE_LIBRARIES}) +target_link_libraries(gazebo_ros_video ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OGRE_LIBRARIES}) add_library(gazebo_ros_planar_move src/gazebo_ros_planar_move.cpp) -set_target_properties(gazebo_ros_planar_move PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_planar_move PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_planar_move ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_planar_move ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + +add_library(gazebo_ros_hand_of_god src/gazebo_ros_hand_of_god.cpp) +set_target_properties(gazebo_ros_hand_of_god PROPERTIES LINK_FLAGS "${ld_flags}") +set_target_properties(gazebo_ros_hand_of_god PROPERTIES COMPILE_FLAGS "${cxx_flags}") +target_link_libraries(gazebo_ros_hand_of_god ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + +add_library(gazebo_ros_ft_sensor src/gazebo_ros_ft_sensor.cpp) +target_link_libraries(gazebo_ros_ft_sensor ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) ## ## Add your new plugin here @@ -260,14 +250,13 @@ target_link_libraries(gazebo_ros_planar_move ${GAZEBO_LIBRARIES} ${SDFormat_LIBR ## Template add_library(gazebo_ros_template src/gazebo_ros_template.cpp) -set_target_properties(gazebo_ros_template PROPERTIES LINK_FLAGS "${ld_flags}") -set_target_properties(gazebo_ros_template PROPERTIES COMPILE_FLAGS "${cxx_flags}") -target_link_libraries(gazebo_ros_template ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(gazebo_ros_template ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) install(TARGETS hokuyo_node vision_reconfigure camera_synchronizer + gazebo_ros_utils gazebo_ros_camera_utils gazebo_ros_camera gazebo_ros_multicamera @@ -280,14 +269,18 @@ install(TARGETS gazebo_ros_p3d gazebo_ros_imu gazebo_ros_f3d + gazebo_ros_ft_sensor gazebo_ros_bumper + gazebo_ros_hand_of_god gazebo_ros_template gazebo_ros_projector gazebo_ros_prosilica gazebo_ros_force gazebo_ros_joint_trajectory + gazebo_ros_joint_state_publisher gazebo_ros_joint_pose_trajectory gazebo_ros_diff_drive + gazebo_ros_tricycle_drive gazebo_ros_skid_steer_drive gazebo_ros_video gazebo_ros_planar_move diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h index f2adce0f2..cb68d8f32 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_block_laser.h @@ -1,28 +1,23 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ +*/ /* * Desc: ros laser controller. * Author: Nathan Koenig * Date: 01 Feb 2007 - * SVN: $Id: gazebo_ros_block_laser.hh 6656 2008-06-20 22:52:19Z natepak $ */ #ifndef GAZEBO_ROS_BLOCK_LASER_HH diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_camera_utils.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_camera_utils.h index d74cb992e..313e18264 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_camera_utils.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_camera_utils.h @@ -34,6 +34,7 @@ #include #include #include +#include // dynamic reconfigure stuff #include @@ -46,6 +47,7 @@ #include #include #include +#include namespace gazebo { @@ -62,7 +64,10 @@ namespace gazebo /// \brief Load the plugin. /// \param[in] _parent Take in SDF root element. /// \param[in] _sdf SDF values. - public: void Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf); + /// \param[in] _camera_name_suffix required before calling LoadThread + public: void Load(sensors::SensorPtr _parent, + sdf::ElementPtr _sdf, + const std::string &_camera_name_suffix = ""); /// \brief Load the plugin. /// \param[in] _parent Take in SDF root element. @@ -113,6 +118,9 @@ namespace gazebo /// \brief ROS camera name private: std::string camera_name_; + /// \brief tf prefix + private: std::string tf_prefix_; + /// \brief ROS image topic name protected: std::string image_topic_name_; @@ -147,6 +155,9 @@ namespace gazebo protected: double distortion_t1_; protected: double distortion_t2_; + protected: boost::shared_ptr camera_info_manager_; + + /// \brief A mutex to lock access to fields /// that are used in ROS message callbacks protected: boost::mutex lock_; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_depth_camera.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_depth_camera.h index 5a6ebae63..28c2ad848 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_depth_camera.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_depth_camera.h @@ -1,29 +1,25 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ +*/ /* * Desc: A dynamic controller plugin that publishes ROS image_raw camera_info topic for generic camera sensor. * Author: John Hsu * Date: 24 Sept 2008 - * SVN: $Id$ */ + #ifndef GAZEBO_ROS_DEPTH_CAMERA_HH #define GAZEBO_ROS_DEPTH_CAMERA_HH @@ -32,9 +28,6 @@ #include #include -#include -#include - // ros messages stuff #include #include @@ -124,7 +117,7 @@ namespace gazebo private: ros::Publisher point_cloud_pub_; private: ros::Publisher depth_image_pub_; - /// \brief PCL point cloud message + /// \brief PointCloud2 point cloud message private: sensor_msgs::PointCloud2 point_cloud_msg_; private: sensor_msgs::Image depth_image_msg_; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_diff_drive.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_diff_drive.h index 339c73691..74335f612 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_diff_drive.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_diff_drive.h @@ -46,14 +46,16 @@ // Gazebo #include #include +#include // ROS #include #include #include #include +#include #include -#include +#include // Custom Callback Queue #include @@ -70,6 +72,11 @@ namespace gazebo { class GazeboRosDiffDrive : public ModelPlugin { + enum OdomSource + { + ENCODER = 0, + WORLD = 1, + }; public: GazeboRosDiffDrive(); ~GazeboRosDiffDrive(); @@ -82,26 +89,30 @@ namespace gazebo { private: void publishOdometry(double step_time); void getWheelVelocities(); + void publishWheelTF(); /// publishes the wheel tf's + void publishWheelJointState(); + void UpdateOdometryEncoder(); - physics::WorldPtr world; + + GazeboRosPtr gazebo_ros_; physics::ModelPtr parent; event::ConnectionPtr update_connection_; - std::string left_joint_name_; - std::string right_joint_name_; - double wheel_separation_; double wheel_diameter_; - double torque; + double wheel_torque; double wheel_speed_[2]; + double wheel_accel; + double wheel_speed_instr_[2]; - physics::JointPtr joints[2]; + std::vector joints_; // ROS STUFF - ros::NodeHandle* rosnode_; ros::Publisher odometry_publisher_; ros::Subscriber cmd_vel_subscriber_; - tf::TransformBroadcaster *transform_broadcaster_; + boost::shared_ptr transform_broadcaster_; + sensor_msgs::JointState joint_state_; + ros::Publisher joint_state_publisher_; nav_msgs::Odometry odom_; std::string tf_prefix_; @@ -112,7 +123,7 @@ namespace gazebo { std::string odometry_topic_; std::string odometry_frame_; std::string robot_base_frame_; - + bool publish_tf_; // Custom Callback Queue ros::CallbackQueue queue_; boost::thread callback_queue_thread_; @@ -129,6 +140,14 @@ namespace gazebo { double update_rate_; double update_period_; common::Time last_update_time_; + + OdomSource odom_source_; + geometry_msgs::Pose2D pose_encoder_; + common::Time last_odom_update_; + + // Flags + bool publishWheelTF_; + bool publishWheelJointState_; }; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_f3d.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_f3d.h index ec487d834..a04779d49 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_f3d.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_f3d.h @@ -1,29 +1,25 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ +*/ /* * Desc: 3D Applied Force Feedback Interface * Author: John Hsu * Date: 24 Sept 2008 - * SVN: $Id$ */ + #ifndef GAZEBO_ROS_F3D_HH #define GAZEBO_ROS_F3D_HH diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_force.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_force.h index 39110a131..d356a01b4 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_force.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_force.h @@ -1,28 +1,25 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ +*/ /* * Desc: A dynamic controller plugin that performs generic force interface. * Author: John Hsu * Date: 24 Sept 2008 */ + #ifndef GAZEBO_ROS_FORCE_HH #define GAZEBO_ROS_FORCE_HH diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_ft_sensor.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_ft_sensor.h new file mode 100644 index 000000000..087525de5 --- /dev/null +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_ft_sensor.h @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2012-2014 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +/* + * Desc: Force Torque Sensor Plugin + * Author: Francisco Suarez-Ruiz + * Date: 5 June 2014 + */ + +#ifndef GAZEBO_ROS_FT_HH +#define GAZEBO_ROS_FT_HH + +// Custom Callback Queue +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace gazebo +{ +/// @addtogroup gazebo_dynamic_plugins Gazebo ROS Dynamic Plugins +/// @{ +/** \defgroup GazeboRosFTSensor Plugin XML Reference and Example + +\brief Ros Gazebo Ros Force/Torque Sensor Plugin. +This is a model plugin which broadcasts geometry_msgs/WrenchStamped messages +with measured force and torque on a specified joint. +The wrench is reported in the joint CHILD link frame and the measure direction +is child-to-parent link. + +Example Usage: + +\verbatim + + +true + + + + +100.0 +ft_sensor_topic +JOINT_NAME + + +\endverbatim +\{ +*/ + + +/// \brief GazeboRosFT controller +/// This is a controller that simulates a 6 dof force sensor +class GazeboRosFT : public ModelPlugin +{ + /// \brief Constructor + /// \param parent The parent entity must be a Model + public: GazeboRosFT(); + + /// \brief Destructor + public: virtual ~GazeboRosFT(); + + /// \brief Load the controller + public: void Load( physics::ModelPtr _parent, sdf::ElementPtr _sdf ); + + /// \brief Update the controller + protected: virtual void UpdateChild(); + + /// \brief Gaussian noise + private: double gaussian_noise_; + private: unsigned int seed; + /// \brief Gaussian noise generator + private: double GaussianKernel(double mu, double sigma); + + /// \brief A pointer to the Gazebo joint + private: physics::JointPtr joint_; + + /// \brief A pointer to the Gazebo parent link + private: physics::LinkPtr parent_link_; + + /// \brief A pointer to the Gazebo child link + private: physics::LinkPtr child_link_; + + /// \brief A pointer to the Gazebo model + private: physics::ModelPtr model_; + + /// \brief A pointer to the Gazebo world + private: physics::WorldPtr world_; + + /// \brief A pointer to the ROS node. A node will be instantiated if it does not exist. + private: ros::NodeHandle* rosnode_; + private: ros::Publisher pub_; + + /// \brief ROS WrenchStamped message + private: geometry_msgs::WrenchStamped wrench_msg_; + + /// \brief store bodyname + private: std::string joint_name_; + + /// \brief ROS WrenchStamped topic name + private: std::string topic_name_; + + /// \brief ROS frame transform name to use in the image message header. + /// FIXME: extract link name directly? + private: std::string frame_name_; + + /// \brief for setting ROS name space + private: std::string robot_namespace_; + + /// \brief A mutex to lock access to fields that are used in message callbacks + private: boost::mutex lock_; + + /// \brief save last_time + private: common::Time last_time_; + + // rate control + private: double update_rate_; + + /// \brief: keep track of number of connections + private: int ft_connect_count_; + private: void FTConnect(); + private: void FTDisconnect(); + + // Custom Callback Queue + private: ros::CallbackQueue queue_; + private: void QueueThread(); + private: boost::thread callback_queue_thread_; + + // Pointer to the update event connection + private: event::ConnectionPtr update_connection_; + +}; + +/** \} */ +/// @} + + +} + +#endif diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_gpu_laser.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_gpu_laser.h index 741bc52f7..8e09e5e06 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_gpu_laser.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_gpu_laser.h @@ -75,6 +75,9 @@ namespace gazebo /// \brief frame transform name, should match link name private: std::string frame_name_; + + /// \brief tf prefix + private: std::string tf_prefix_; /// \brief for setting ROS name space private: std::string robot_namespace_; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_hand_of_god.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_hand_of_god.h new file mode 100644 index 000000000..4773b8029 --- /dev/null +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_hand_of_god.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2012-2014 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +/* + * Desc: 3D position interface. + * Author: Sachin Chitta and John Hsu + * Date: 10 June 2008 + */ + +#ifndef GAZEBO_ROS_TEMPLATE_HH +#define GAZEBO_ROS_TEMPLATE_HH + +#include + +#include +#include +#include +#include +#include + +#include +#include + +namespace gazebo +{ + + class GazeboRosHandOfGod : public ModelPlugin + { + /// \brief Constructor + public: GazeboRosHandOfGod(); + + /// \brief Destructor + public: virtual ~GazeboRosHandOfGod(); + + /// \brief Load the controller + public: void Load( physics::ModelPtr _parent, sdf::ElementPtr _sdf ); + + /// \brief Update the controller + protected: virtual void GazeboUpdate(); + + /// Pointer to the update event connection + private: event::ConnectionPtr update_connection_; + boost::shared_ptr tf_buffer_; + boost::shared_ptr tf_listener_; + boost::shared_ptr tf_broadcaster_; + physics::ModelPtr model_; + physics::LinkPtr floating_link_; + std::string link_name_; + std::string robot_namespace_; + std::string frame_id_; + double kl_, ka_; + double cl_, ca_; + }; + +} + +#endif + diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_imu.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_imu.h index 4317fbaf0..6f3191713 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_imu.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_imu.h @@ -84,6 +84,9 @@ namespace gazebo private: math::Vector3 last_veul_; private: math::Vector3 apos_; private: math::Vector3 aeul_; + + // rate control + private: double update_rate_; /// \brief: keep initial pose to offset orientation in imu message private: math::Pose initial_pose_; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_joint_state_publisher.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_joint_state_publisher.h new file mode 100644 index 000000000..550a65b8f --- /dev/null +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_joint_state_publisher.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2013, Markus Bader + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Antons Rebguns ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Antons Rebguns BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + **/ + + +#ifndef JOINT_STATE_PUBLISHER_PLUGIN_HH +#define JOINT_STATE_PUBLISHER_PLUGIN_HH + +#include +#include +#include +#include +#include + +// ROS +#include +#include +#include + +// Usage in URDF: +// +// +// /pioneer2dx +// chassis_swivel_joint, swivel_wheel_joint, left_hub_joint, right_hub_joint +// 100.0 +// true +// +// + + + +namespace gazebo { +class GazeboRosJointStatePublisher : public ModelPlugin { +public: + GazeboRosJointStatePublisher(); + ~GazeboRosJointStatePublisher(); + void Load ( physics::ModelPtr _parent, sdf::ElementPtr _sdf ); + void OnUpdate ( const common::UpdateInfo & _info ); + void publishJointStates(); + // Pointer to the model +private: + event::ConnectionPtr updateConnection; + physics::WorldPtr world_; + physics::ModelPtr parent_; + std::vector joints_; + + // ROS STUFF + boost::shared_ptr rosnode_; + sensor_msgs::JointState joint_state_; + ros::Publisher joint_state_publisher_; + std::string tf_prefix_; + std::string robot_namespace_; + std::vector joint_names_; + + // Update Rate + double update_rate_; + double update_period_; + common::Time last_update_time_; + +}; + +// Register this plugin with the simulator +GZ_REGISTER_MODEL_PLUGIN ( GazeboRosJointStatePublisher ) +} + +#endif //JOINT_STATE_PUBLISHER_PLUGIN_HH + diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_laser.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_laser.h index d89cf93e4..e89c38d42 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_laser.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_laser.h @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -59,6 +60,7 @@ namespace gazebo private: void LaserDisconnect(); // Pointer to the model + GazeboRosPtr gazebo_ros_; private: std::string world_name_; private: physics::WorldPtr world_; /// \brief The parent sensor @@ -74,6 +76,9 @@ namespace gazebo /// \brief frame transform name, should match link name private: std::string frame_name_; + + /// \brief tf prefix + private: std::string tf_prefix_; /// \brief for setting ROS name space private: std::string robot_namespace_; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_openni_kinect.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_openni_kinect.h index 4b7992ee4..8f30e5201 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_openni_kinect.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_openni_kinect.h @@ -1,29 +1,25 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ +*/ /* * Desc: A dynamic controller plugin that publishes ROS image_raw camera_info topic for generic camera sensor. * Author: John Hsu * Date: 24 Sept 2008 - * SVN: $Id$ */ + #ifndef GAZEBO_ROS_OPENNI_KINECT_HH #define GAZEBO_ROS_OPENNI_KINECT_HH @@ -32,9 +28,6 @@ #include #include -#include -#include - // ros messages stuff #include #include @@ -118,7 +111,7 @@ namespace gazebo private: ros::Publisher point_cloud_pub_; private: ros::Publisher depth_image_pub_; - /// \brief PCL point cloud message + /// \brief PointCloud2 point cloud message private: sensor_msgs::PointCloud2 point_cloud_msg_; private: sensor_msgs::Image depth_image_msg_; diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_template.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_template.h index 255367dbe..4e1f18597 100644 --- a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_template.h +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_template.h @@ -1,29 +1,25 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ +*/ /* * Desc: 3D position interface. * Author: Sachin Chitta and John Hsu * Date: 10 June 2008 - * SVN: $Id$ */ + #ifndef GAZEBO_ROS_TEMPLATE_HH #define GAZEBO_ROS_TEMPLATE_HH diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_tricycle_drive.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_tricycle_drive.h new file mode 100644 index 000000000..0dd3aa937 --- /dev/null +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_tricycle_drive.h @@ -0,0 +1,170 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2013, Markus Bader + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + +/** + * \file gazebo_ros_tricycle_drive.cpp + * \brief A tricycle drive plugin for gazebo. + * \author Markus Bader + * \date 22th of June 2014 + */ + +#ifndef TRICYCLE_DRIVE_PLUGIN_HH +#define TRICYCLE_DRIVE_PLUGIN_HH + +#include + +// Gazebo +#include + +// ROS +#include +#include +#include +#include +#include +#include +#include +#include + +// Custom Callback Queue +#include +#include + +// Boost +#include +#include + +namespace gazebo { + +class Joint; +class Entity; + + +class GazeboRosTricycleDrive : public ModelPlugin { + + class TricycleDriveCmd { + public: + TricycleDriveCmd():speed(0), angle(0) {}; + double speed; + double angle; + }; + + enum OdomSource + { + ENCODER = 0, + WORLD = 1, + }; +public: + GazeboRosTricycleDrive(); + ~GazeboRosTricycleDrive(); + void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf); + +protected: + virtual void UpdateChild(); + virtual void FiniChild(); + +private: + GazeboRosPtr gazebo_ros_; + physics::ModelPtr parent; + void publishOdometry(double step_time); + void publishWheelTF(); /// publishes the wheel tf's + void publishWheelJointState(); + void motorController(double target_speed, double target_angle, double dt); + + event::ConnectionPtr update_connection_; + + physics::JointPtr joint_steering_; + physics::JointPtr joint_wheel_actuated_; + physics::JointPtr joint_wheel_encoder_left_; + physics::JointPtr joint_wheel_encoder_right_; + + double diameter_encoder_wheel_; + double diameter_actuated_wheel_; + double wheel_acceleration_; + double wheel_deceleration_; + double wheel_speed_tolerance_; + double steering_angle_tolerance_; + double steering_speed_; + double separation_encoder_wheel_; + + OdomSource odom_source_; + double wheel_torque_; + + std::string robot_namespace_; + std::string command_topic_; + std::string odometry_topic_; + std::string odometry_frame_; + std::string robot_base_frame_; + + // ROS STUFF + ros::Publisher odometry_publisher_; + ros::Subscriber cmd_vel_subscriber_; + boost::shared_ptr transform_broadcaster_; + sensor_msgs::JointState joint_state_; + ros::Publisher joint_state_publisher_; + nav_msgs::Odometry odom_; + + boost::mutex lock; + + + // Custom Callback Queue + ros::CallbackQueue queue_; + boost::thread callback_queue_thread_; + void QueueThread(); + + // DiffDrive stuff + void cmdVelCallback(const geometry_msgs::Twist::ConstPtr& cmd_msg); + + /// updates the relative robot pose based on the wheel encoders + void UpdateOdometryEncoder(); + + TricycleDriveCmd cmd_; + bool alive_; + geometry_msgs::Pose2D pose_encoder_; + common::Time last_odom_update_; + + // Update Rate + double update_rate_; + double update_period_; + common::Time last_actuator_update_; + + // Flags + bool publishWheelTF_; + bool publishWheelJointState_; + +}; + +} + +#endif + diff --git a/gazebo_plugins/include/gazebo_plugins/gazebo_ros_utils.h b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_utils.h new file mode 100644 index 000000000..3db4c45f5 --- /dev/null +++ b/gazebo_plugins/include/gazebo_plugins/gazebo_ros_utils.h @@ -0,0 +1,291 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2013, Markus Bader + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + +#ifndef GAZEBO_ROS_UTILS_H +#define GAZEBO_ROS_UTILS_H +#include +#include + +#include +#include +#include +#include + +namespace gazebo +{ + +/** +* Accessing model name like suggested by nkoenig at http://answers.gazebosim.org/question/4878/multiple-robots-with-ros-plugins-sensor-plugin-vs/ +* @param parent +* @return accessing model name +**/ +inline std::string GetModelName ( const sensors::SensorPtr &parent ) +{ + std::string modelName; + std::vector values; + std::string scopedName = parent->GetScopedName(); + boost::replace_all ( scopedName, "::", "," ); + boost::split ( values, scopedName, boost::is_any_of ( "," ) ); + if ( values.size() < 2 ) { + modelName = ""; + } else { + modelName = values[1]; + } + return modelName; +} + +/** +* @brief Reads the name space tag of a sensor plugin +* @param parent +* @param sdf +* @param pInfo +* @return node namespace +**/ +inline std::string GetRobotNamespace ( const sensors::SensorPtr &parent, const sdf::ElementPtr &sdf, const char *pInfo = NULL ) +{ + std::string name_space; + std::stringstream ss; + if ( sdf->HasElement ( "robotNamespace" ) ) { + name_space = sdf->Get ( "robotNamespace" ); + if ( name_space.empty() ) { + ss << "the 'robotNamespace' param was empty"; + name_space = GetModelName ( parent ); + } else { + ss << "Using the 'robotNamespace' param: '" << name_space << "'"; + } + } else { + ss << "the 'robotNamespace' param did not exit"; + } + if ( pInfo != NULL ) { + ROS_INFO ( "%s Plugin (robotNamespace = %s), Info: %s" , pInfo, name_space.c_str(), ss.str().c_str() ); + } + return name_space; +} + +/** + * Gazebo ros helper class + * The class simplifies the parameter and rosnode handling + * @author Markus Bader + **/ +class GazeboRos +{ +private: + sdf::ElementPtr sdf_; /// sdf to read + std::string plugin_; /// name of the plugin class + std::string namespace_; /// name of the launched node + boost::shared_ptr rosnode_; /// rosnode + std::string tf_prefix_; /// prefix for the ros tf plublisher if not set it uses the namespace_ + std::string info_text; /// info text for log messages to identify the node + /** + * Reads the common plugin parameters used by the constructor + **/ + void readCommonParameter (); +public: + /** + * Constructor + * @param _parent models parent + * @param _sdf sdf to read + * @param _name of the plugin class + **/ + GazeboRos ( physics::ModelPtr &_parent, sdf::ElementPtr _sdf, const std::string &_plugin ) + : sdf_ ( _sdf ), plugin_ ( _plugin ) { + namespace_ = _parent->GetName (); + if ( !sdf_->HasElement ( "robotNamespace" ) ) { + ROS_INFO ( "%s missing , defaults is %s", plugin_.c_str(), namespace_.c_str() ); + } else { + namespace_ = sdf_->GetElement ( "robotNamespace" )->Get(); + if ( namespace_.empty() ) { + namespace_ = _parent->GetName(); + } + } + if ( !namespace_.empty() ) + this->namespace_ += "/"; + rosnode_ = boost::shared_ptr ( new ros::NodeHandle ( namespace_ ) ); + info_text = plugin_ + "(ns = " + namespace_ + ")"; + readCommonParameter (); + } + /** + * Constructor + * @param _parent sensor parent + * @param _sdf sdf to read + * @param _name of the plugin class + **/ + GazeboRos ( sensors::SensorPtr _parent, sdf::ElementPtr _sdf, const std::string &_plugin ) + : sdf_ ( _sdf ), plugin_ ( _plugin ) { + + std::stringstream ss; + if ( sdf_->HasElement ( "robotNamespace" ) ) { + namespace_ = sdf_->Get ( "robotNamespace" ); + if ( namespace_.empty() ) { + ss << "the 'robotNamespace' param was empty"; + namespace_ = GetModelName ( _parent ); + } else { + ss << "Using the 'robotNamespace' param: '" << namespace_ << "'"; + } + } else { + ss << "the 'robotNamespace' param did not exit"; + } + info_text = plugin_ + "(ns = " + namespace_ + ")"; + ROS_INFO ( "%s: %s" , info_text.c_str(), ss.str().c_str() ); + readCommonParameter (); + } + + /** + * Returns info text used for log messages + * @return class name and node name as string + **/ + const char* info() const; + /** + * returns the initialized created within the constuctor + * @return rosnode + **/ + boost::shared_ptr& node();; + /** + * returns the initialized within the constuctor + * @return rosnode + **/ + const boost::shared_ptr& node() const; + /** + * resolves a tf frame name by adding the tf_prefix initialized within the constuctor + * @param _name + * @retun resolved tf name + **/ + std::string resolveTF ( const std::string &_name ); + + /** + * reads the follwoing _tag_name paramer or sets a _default value + * @param _value + * @param _tag_name + * @param _default + * @retun sdf tag value + **/ + void getParameterBoolean ( bool &_value, const char *_tag_name, const bool &_default ); + /** + * reads the follwoing _tag_name paramer + * @param _value + * @param _tag_name + * @retun sdf tag value + **/ + void getParameterBoolean ( bool &_value, const char *_tag_name ); + /** + * retuns a JointPtr based on an sdf tag_name entry + * @param _value + * @param _tag_name + * @param _joint_default_name + * @retun JointPtr + **/ + physics::JointPtr getJoint ( physics::ModelPtr &_parent, const char *_tag_name, const std::string &_joint_default_name ); + /** + * checks if the ros not is initialized + * @retun JointPtr + **/ + void isInitialized(); + + + /** + * reads the follwoing _tag_name paramer or sets a _default value + * @param _value + * @param _tag_name + * @param _default + * @retun sdf tag value + **/ + template + void getParameter ( T &_value, const char *_tag_name, const T &_default ) { + _value = _default; + if ( !sdf_->HasElement ( _tag_name ) ) { + ROS_WARN ( "%s: missing <%s> default is %s", info(), _tag_name, boost::lexical_cast ( _default ).c_str() ); + } else { + this->getParameter ( _value, _tag_name ); + } + } + /** + * reads the follwoing _tag_name paramer + * @param _value + * @param _tag_name + * @param _default + * @retun sdf tag value + **/ + template + void getParameter ( T &_value, const char *_tag_name ) { + if ( sdf_->HasElement ( _tag_name ) ) { + _value = sdf_->GetElement ( _tag_name )->Get(); + } + ROS_DEBUG ( "%s: <%s> = %s", info(), _tag_name, boost::lexical_cast ( _value ).c_str() ); + + } + + /** + * reads the following _tag_name paramer and compares the value with an _options map keys and retuns the corresponding value. + * @param _value + * @param _tag_name + * @param _default + * @retun sdf tag value + **/ + template + void getParameter ( T &_value, const char *_tag_name, const std::map &_options, const T &_default ) { + _value = _default; + if ( !sdf_->HasElement ( _tag_name ) ) { + ROS_WARN ( "%s: missing <%s> default is %s", info(), _tag_name, boost::lexical_cast ( _default ).c_str() ); + } else { + this->getParameter ( _value, _tag_name, _options ); + } + } + /** + * reads the following _tag_name paramer and compares the value with an _options map keys and retuns the corresponding value. + * @param _value + * @param _tag_name + * @param _default + * @retun sdf tag value + **/ + template + void getParameter ( T &_value, const char *_tag_name, const std::map &_options ) { + typename std::map::const_iterator it; + if ( sdf_->HasElement ( _tag_name ) ) { + std::string value = sdf_->GetElement ( _tag_name )->Get(); + it = _options.find ( value ); + if ( it == _options.end() ) { + ROS_WARN ( "%s: <%s> no matching key to %s", info(), _tag_name, value.c_str() ); + } else { + _value = it->second; + } + } + ROS_DEBUG ( "%s: <%s> = %s := %s", info(), _tag_name, ( it == _options.end() ?"default":it->first.c_str() ), boost::lexical_cast ( _value ).c_str() ); + } +}; + +typedef boost::shared_ptr GazeboRosPtr; +} +#endif + + + diff --git a/gazebo_plugins/package.xml b/gazebo_plugins/package.xml index e3b03dbdd..75b80a863 100644 --- a/gazebo_plugins/package.xml +++ b/gazebo_plugins/package.xml @@ -1,18 +1,17 @@ gazebo_plugins - 2.4.0 + 2.4.6 Robot-independent Gazebo plugins for sensors, motors and dynamic reconfigurable components. John Hsu - Dave Coleman - BSD + BSD, Apache 2.0 http://gazebosim.org/wiki/Tutorials#ROS_Integration - https://github.com/osrf/gazebo_ros_pkgs/issues - https://github.com/osrf/gazebo_ros_pkgs + https://github.com/ros-simulation/gazebo_ros_pkgs/issues + https://github.com/ros-simulation/gazebo_ros_pkgs John Hsu @@ -31,20 +30,21 @@ nav_msgs urdf tf + tf2_ros dynamic_reconfigure driver_base rosgraph_msgs - pcl_ros - pcl_conversions image_transport rosconsole message_generation cv_bridge polled_camera diagnostic_updater + camera_info_manager gazebo gazebo_msgs + gazebo_ros geometry_msgs sensor_msgs trajectory_msgs @@ -56,15 +56,15 @@ nav_msgs urdf tf + tf2_ros dynamic_reconfigure driver_base rosgraph_msgs - pcl_ros - pcl_conversions image_transport rosconsole message_generation cv_bridge polled_camera + camera_info_manager diff --git a/gazebo_plugins/src/gazebo_ros_block_laser.cpp b/gazebo_plugins/src/gazebo_ros_block_laser.cpp index b57c13aae..d8f40bc6a 100644 --- a/gazebo_plugins/src/gazebo_ros_block_laser.cpp +++ b/gazebo_plugins/src/gazebo_ros_block_laser.cpp @@ -40,6 +40,8 @@ #include +#define EPSILON_DIFF 0.000001 + namespace gazebo { // Register this plugin with the simulator @@ -321,31 +323,27 @@ void GazeboRosBlockLaser::PutLaserData(common::Time &_updateTime) /* point scan from laser */ /* */ /***************************************************************/ - if (r == maxRange - minRange) + //compare 2 doubles + double diffRange = maxRange - minRange; + double diff = diffRange - r; + if (fabs(diff) < EPSILON_DIFF) { // no noise if at max range geometry_msgs::Point32 point; - point.x = (r+minRange) * cos(pAngle)*cos(yAngle); - point.y = -(r+minRange) * sin(yAngle); - point.z = (r+minRange) * sin(pAngle)*cos(yAngle); - //pAngle is rotated by yAngle: - point.x = (r+minRange) * cos(pAngle) * cos(yAngle); - point.y = -(r+minRange) * cos(pAngle) * sin(yAngle); - point.z = (r+minRange) * sin(pAngle); + point.x = r * cos(pAngle) * cos(yAngle); + point.y = r * cos(pAngle) * sin(yAngle); + point.z = -r * sin(pAngle); this->cloud_msg_.points.push_back(point); } else { geometry_msgs::Point32 point; - point.x = (r+minRange) * cos(pAngle)*cos(yAngle) + this->GaussianKernel(0,this->gaussian_noise_) ; - point.y = -(r+minRange) * sin(yAngle) + this->GaussianKernel(0,this->gaussian_noise_) ; - point.z = (r+minRange) * sin(pAngle)*cos(yAngle) + this->GaussianKernel(0,this->gaussian_noise_) ; //pAngle is rotated by yAngle: - point.x = (r+minRange) * cos(pAngle) * cos(yAngle) + this->GaussianKernel(0,this->gaussian_noise_); - point.y = -(r+minRange) * cos(pAngle) * sin(yAngle) + this->GaussianKernel(0,this->gaussian_noise_); - point.z = (r+minRange) * sin(pAngle) + this->GaussianKernel(0,this->gaussian_noise_); + point.x = r * cos(pAngle) * cos(yAngle) + this->GaussianKernel(0,this->gaussian_noise_); + point.y = r * cos(pAngle) * sin(yAngle) + this->GaussianKernel(0,this->gaussian_noise_); + point.z = -r * sin(pAngle) + this->GaussianKernel(0,this->gaussian_noise_); this->cloud_msg_.points.push_back(point); } // only 1 channel diff --git a/gazebo_plugins/src/gazebo_ros_bumper.cpp b/gazebo_plugins/src/gazebo_ros_bumper.cpp index 4d8ad1bdc..059f1d935 100644 --- a/gazebo_plugins/src/gazebo_ros_bumper.cpp +++ b/gazebo_plugins/src/gazebo_ros_bumper.cpp @@ -121,6 +121,9 @@ void GazeboRosBumper::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) // simulation iteration. this->update_connection_ = this->parentSensor->ConnectUpdated( boost::bind(&GazeboRosBumper::OnContact, this)); + + // Make sure the parent sensor is active. + this->parentSensor->SetActive(true); } //////////////////////////////////////////////////////////////////////////////// diff --git a/gazebo_plugins/src/gazebo_ros_camera_utils.cpp b/gazebo_plugins/src/gazebo_ros_camera_utils.cpp index 70edb4362..2129b65ab 100644 --- a/gazebo_plugins/src/gazebo_ros_camera_utils.cpp +++ b/gazebo_plugins/src/gazebo_ros_camera_utils.cpp @@ -22,11 +22,13 @@ #include #include +#include #include #include #include #include #include +#include #include @@ -85,22 +87,22 @@ void GazeboRosCameraUtils::Load(sensors::SensorPtr _parent, const std::string &_camera_name_suffix, double _hack_baseline) { - // default Load - this->Load(_parent, _sdf); + // default Load: + // provide _camera_name_suffix to prevent LoadThread() creating the ros::NodeHandle with + //an incomplete this->camera_name_ namespace. There was a race condition when the _camera_name_suffix + //was appended in this function. + this->Load(_parent, _sdf, _camera_name_suffix); // overwrite hack baseline if specified at load // example usage in gazebo_ros_multicamera this->hack_baseline_ = _hack_baseline; - - // overwrite camera suffix - // example usage in gazebo_ros_multicamera - this->camera_name_ += _camera_name_suffix; } //////////////////////////////////////////////////////////////////////////////// // Load the controller void GazeboRosCameraUtils::Load(sensors::SensorPtr _parent, - sdf::ElementPtr _sdf) + sdf::ElementPtr _sdf, + const std::string &_camera_name_suffix) { // Get the world name. std::string world_name = _parent->GetWorldName(); @@ -115,10 +117,9 @@ void GazeboRosCameraUtils::Load(sensors::SensorPtr _parent, // pr2_gazebo_plugins this->world = this->world_; - this->robot_namespace_ = ""; - if (this->sdf->HasElement("robotNamespace")) - this->robot_namespace_ = this->sdf->Get("robotNamespace") + "/"; - + std::stringstream ss; + this->robot_namespace_ = GetRobotNamespace(_parent, _sdf, "Camera"); + this->image_topic_name_ = "image_raw"; if (this->sdf->HasElement("imageTopicName")) this->image_topic_name_ = this->sdf->Get("imageTopicName"); @@ -133,6 +134,10 @@ void GazeboRosCameraUtils::Load(sensors::SensorPtr _parent, else this->camera_name_ = this->sdf->Get("cameraName"); + // overwrite camera suffix + // example usage in gazebo_ros_multicamera + this->camera_name_ += _camera_name_suffix; + if (!this->sdf->HasElement("frameName")) ROS_DEBUG("Camera plugin missing , defaults to /world"); else @@ -266,10 +271,11 @@ void GazeboRosCameraUtils::LoadThread() // associated ROS topics. this->parentSensor_->SetActive(false); - this->rosnode_ = new ros::NodeHandle(this->robot_namespace_ + - "/" + this->camera_name_); + this->rosnode_ = new ros::NodeHandle(this->robot_namespace_ + "/" + this->camera_name_); - this->itnode_ = new image_transport::ImageTransport(*this->rosnode_); + // initialize camera_info_manager + this->camera_info_manager_.reset(new camera_info_manager::CameraInfoManager( + *this->rosnode_, this->camera_name_)); // resolve tf prefix std::string key; @@ -279,6 +285,20 @@ void GazeboRosCameraUtils::LoadThread() this->frame_name_ = tf::resolve(prefix, this->frame_name_); } + this->itnode_ = new image_transport::ImageTransport(*this->rosnode_); + + // resolve tf prefix + this->tf_prefix_ = tf::getPrefixParam(*this->rosnode_); + if(this->tf_prefix_.empty()) { + this->tf_prefix_ = this->robot_namespace_; + boost::trim_right_if(this->tf_prefix_,boost::is_any_of("/")); + } + this->frame_name_ = tf::resolve(this->tf_prefix_, this->frame_name_); + + ROS_INFO("Camera Plugin (ns = %s) , set to \"%s\"", + this->robot_namespace_.c_str(), this->tf_prefix_.c_str()); + + if (!this->camera_name_.empty()) { dyn_srv_ = @@ -473,6 +493,59 @@ void GazeboRosCameraUtils::Init() } } + // fill CameraInfo + sensor_msgs::CameraInfo camera_info_msg; + + camera_info_msg.header.frame_id = this->frame_name_; + + camera_info_msg.height = this->height_; + camera_info_msg.width = this->width_; + // distortion +#if ROS_VERSION_MINIMUM(1, 3, 0) + camera_info_msg.distortion_model = "plumb_bob"; + camera_info_msg.D.resize(5); +#endif + camera_info_msg.D[0] = this->distortion_k1_; + camera_info_msg.D[1] = this->distortion_k2_; + camera_info_msg.D[2] = this->distortion_k3_; + camera_info_msg.D[3] = this->distortion_t1_; + camera_info_msg.D[4] = this->distortion_t2_; + // original camera_ matrix + camera_info_msg.K[0] = this->focal_length_; + camera_info_msg.K[1] = 0.0; + camera_info_msg.K[2] = this->cx_; + camera_info_msg.K[3] = 0.0; + camera_info_msg.K[4] = this->focal_length_; + camera_info_msg.K[5] = this->cy_; + camera_info_msg.K[6] = 0.0; + camera_info_msg.K[7] = 0.0; + camera_info_msg.K[8] = 1.0; + // rectification + camera_info_msg.R[0] = 1.0; + camera_info_msg.R[1] = 0.0; + camera_info_msg.R[2] = 0.0; + camera_info_msg.R[3] = 0.0; + camera_info_msg.R[4] = 1.0; + camera_info_msg.R[5] = 0.0; + camera_info_msg.R[6] = 0.0; + camera_info_msg.R[7] = 0.0; + camera_info_msg.R[8] = 1.0; + // camera_ projection matrix (same as camera_ matrix due + // to lack of distortion/rectification) (is this generated?) + camera_info_msg.P[0] = this->focal_length_; + camera_info_msg.P[1] = 0.0; + camera_info_msg.P[2] = this->cx_; + camera_info_msg.P[3] = -this->focal_length_ * this->hack_baseline_; + camera_info_msg.P[4] = 0.0; + camera_info_msg.P[5] = this->focal_length_; + camera_info_msg.P[6] = this->cy_; + camera_info_msg.P[7] = 0.0; + camera_info_msg.P[8] = 0.0; + camera_info_msg.P[9] = 0.0; + camera_info_msg.P[10] = 1.0; + camera_info_msg.P[11] = 0.0; + + this->camera_info_manager_->setCameraInfo(camera_info_msg); // start custom queue for camera_ this->callback_queue_thread_ = boost::thread( @@ -546,58 +619,10 @@ void GazeboRosCameraUtils::PublishCameraInfo() void GazeboRosCameraUtils::PublishCameraInfo( ros::Publisher camera_info_publisher) { - sensor_msgs::CameraInfo camera_info_msg; - // fill CameraInfo - camera_info_msg.header.frame_id = this->frame_name_; + sensor_msgs::CameraInfo camera_info_msg = camera_info_manager_->getCameraInfo(); camera_info_msg.header.stamp.sec = this->sensor_update_time_.sec; camera_info_msg.header.stamp.nsec = this->sensor_update_time_.nsec; - camera_info_msg.height = this->height_; - camera_info_msg.width = this->width_; - // distortion -#if ROS_VERSION_MINIMUM(1, 3, 0) - camera_info_msg.distortion_model = "plumb_bob"; - camera_info_msg.D.resize(5); -#endif - camera_info_msg.D[0] = this->distortion_k1_; - camera_info_msg.D[1] = this->distortion_k2_; - camera_info_msg.D[2] = this->distortion_k3_; - camera_info_msg.D[3] = this->distortion_t1_; - camera_info_msg.D[4] = this->distortion_t2_; - // original camera_ matrix - camera_info_msg.K[0] = this->focal_length_; - camera_info_msg.K[1] = 0.0; - camera_info_msg.K[2] = this->cx_; - camera_info_msg.K[3] = 0.0; - camera_info_msg.K[4] = this->focal_length_; - camera_info_msg.K[5] = this->cy_; - camera_info_msg.K[6] = 0.0; - camera_info_msg.K[7] = 0.0; - camera_info_msg.K[8] = 1.0; - // rectification - camera_info_msg.R[0] = 1.0; - camera_info_msg.R[1] = 0.0; - camera_info_msg.R[2] = 0.0; - camera_info_msg.R[3] = 0.0; - camera_info_msg.R[4] = 1.0; - camera_info_msg.R[5] = 0.0; - camera_info_msg.R[6] = 0.0; - camera_info_msg.R[7] = 0.0; - camera_info_msg.R[8] = 1.0; - // camera_ projection matrix (same as camera_ matrix due - // to lack of distortion/rectification) (is this generated?) - camera_info_msg.P[0] = this->focal_length_; - camera_info_msg.P[1] = 0.0; - camera_info_msg.P[2] = this->cx_; - camera_info_msg.P[3] = -this->focal_length_ * this->hack_baseline_; - camera_info_msg.P[4] = 0.0; - camera_info_msg.P[5] = this->focal_length_; - camera_info_msg.P[6] = this->cy_; - camera_info_msg.P[7] = 0.0; - camera_info_msg.P[8] = 0.0; - camera_info_msg.P[9] = 0.0; - camera_info_msg.P[10] = 1.0; - camera_info_msg.P[11] = 0.0; camera_info_publisher.publish(camera_info_msg); } diff --git a/gazebo_plugins/src/gazebo_ros_depth_camera.cpp b/gazebo_plugins/src/gazebo_ros_depth_camera.cpp index 30fa05fc9..0bdad5ef0 100644 --- a/gazebo_plugins/src/gazebo_ros_depth_camera.cpp +++ b/gazebo_plugins/src/gazebo_ros_depth_camera.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include @@ -246,24 +246,29 @@ void GazeboRosDepthCamera::OnNewRGBPointCloud(const float *_pcd, this->point_cloud_msg_.height = this->height; this->point_cloud_msg_.row_step = this->point_cloud_msg_.point_step * this->width; - pcl::PointCloud point_cloud; - point_cloud.points.resize(0); - point_cloud.is_dense = true; + sensor_msgs::PointCloud2Modifier pcd_modifier(point_cloud_msg_); + pcd_modifier.setPointCloud2FieldsByString(2, "xyz", "rgb"); + pcd_modifier.resize(_width*_height); + + point_cloud_msg_.is_dense = true; + + sensor_msgs::PointCloud2Iterator iter_x(point_cloud_msg_, "x"); + sensor_msgs::PointCloud2Iterator iter_y(point_cloud_msg_, "y"); + sensor_msgs::PointCloud2Iterator iter_z(point_cloud_msg_, "z"); + sensor_msgs::PointCloud2Iterator iter_rgb(point_cloud_msg_, "rgb"); for (unsigned int i = 0; i < _width; i++) { - for (unsigned int j = 0; j < _height; j++) + for (unsigned int j = 0; j < _height; j++, ++iter_x, ++iter_y, ++iter_z, ++iter_rgb) { unsigned int index = (j * _width) + i; - pcl::PointXYZRGB point; - point.x = _pcd[4 * index]; - point.y = _pcd[4 * index + 1]; - point.z = _pcd[4 * index + 2]; - point.rgb = _pcd[4 * index + 3]; - point_cloud.points.push_back(point); + *iter_x = _pcd[4 * index]; + *iter_y = _pcd[4 * index + 1]; + *iter_z = _pcd[4 * index + 2]; + *iter_rgb = _pcd[4 * index + 3]; if (i == _width /2 && j == _height / 2) { - uint32_t rgb = *reinterpret_cast(&point.rgb); + uint32_t rgb = *reinterpret_cast(&(*iter_rgb)); uint8_t r = (rgb >> 16) & 0x0000ff; uint8_t g = (rgb >> 8) & 0x0000ff; uint8_t b = (rgb) & 0x0000ff; @@ -272,10 +277,6 @@ void GazeboRosDepthCamera::OnNewRGBPointCloud(const float *_pcd, } } - point_cloud.header = pcl_conversions::toPCL(point_cloud_msg_.header); - - pcl::toROSMsg(point_cloud, this->point_cloud_msg_); - this->point_cloud_pub_.publish(this->point_cloud_msg_); this->lock_.unlock(); } @@ -361,10 +362,16 @@ bool GazeboRosDepthCamera::FillPointCloudHelper( uint32_t rows_arg, uint32_t cols_arg, uint32_t step_arg, void* data_arg) { - pcl::PointCloud point_cloud; + sensor_msgs::PointCloud2Modifier pcd_modifier(point_cloud_msg); + pcd_modifier.setPointCloud2FieldsByString(2, "xyz", "rgb"); + pcd_modifier.resize(rows_arg*cols_arg); - point_cloud.points.resize(0); - point_cloud.is_dense = true; + sensor_msgs::PointCloud2Iterator iter_x(point_cloud_msg_, "x"); + sensor_msgs::PointCloud2Iterator iter_y(point_cloud_msg_, "y"); + sensor_msgs::PointCloud2Iterator iter_z(point_cloud_msg_, "z"); + sensor_msgs::PointCloud2Iterator iter_rgb(point_cloud_msg_, "rgb"); + + point_cloud_msg.is_dense = true; float* toCopyFrom = (float*)data_arg; int index = 0; @@ -379,7 +386,7 @@ bool GazeboRosDepthCamera::FillPointCloudHelper( if (rows_arg>1) pAngle = atan2( (double)j - 0.5*(double)(rows_arg-1), fl); else pAngle = 0.0; - for (uint32_t i=0; i1) yAngle = atan2( (double)i - 0.5*(double)(cols_arg-1), fl); @@ -391,17 +398,16 @@ bool GazeboRosDepthCamera::FillPointCloudHelper( // hardcoded rotation rpy(-M_PI/2, 0, -M_PI/2) is built-in // to urdf, where the *_optical_frame should have above relative // rotation from the physical camera *_frame - pcl::PointXYZRGB point; - point.x = depth * tan(yAngle); - point.y = depth * tan(pAngle); + *iter_x = depth * tan(yAngle); + *iter_y = depth * tan(pAngle); if(depth > this->point_cloud_cutoff_) { - point.z = depth; + *iter_z = depth; } else //point in the unseeable range { - point.x = point.y = point.z = std::numeric_limits::quiet_NaN (); - point_cloud.is_dense = false; + *iter_x = *iter_y = *iter_z = std::numeric_limits::quiet_NaN (); + point_cloud_msg.is_dense = false; } // put image color data for each point @@ -409,32 +415,27 @@ bool GazeboRosDepthCamera::FillPointCloudHelper( if (this->image_msg_.data.size() == rows_arg*cols_arg*3) { // color - point.r = image_src[i*3+j*cols_arg*3+0]; - point.g = image_src[i*3+j*cols_arg*3+1]; - point.b = image_src[i*3+j*cols_arg*3+2]; + iter_rgb[0] = image_src[i*3+j*cols_arg*3+0]; + iter_rgb[1] = image_src[i*3+j*cols_arg*3+1]; + iter_rgb[2] = image_src[i*3+j*cols_arg*3+2]; } else if (this->image_msg_.data.size() == rows_arg*cols_arg) { // mono (or bayer? @todo; fix for bayer) - point.r = image_src[i+j*cols_arg]; - point.g = image_src[i+j*cols_arg]; - point.b = image_src[i+j*cols_arg]; + iter_rgb[0] = image_src[i+j*cols_arg]; + iter_rgb[1] = image_src[i+j*cols_arg]; + iter_rgb[2] = image_src[i+j*cols_arg]; } else { // no image - point.r = 0; - point.g = 0; - point.b = 0; + iter_rgb[0] = 0; + iter_rgb[1] = 0; + iter_rgb[2] = 0; } - - point_cloud.points.push_back(point); } } - point_cloud.header = pcl_conversions::toPCL(point_cloud_msg.header); - - pcl::toROSMsg(point_cloud, point_cloud_msg); return true; } diff --git a/gazebo_plugins/src/gazebo_ros_diff_drive.cpp b/gazebo_plugins/src/gazebo_ros_diff_drive.cpp index a702016a3..99dbd549e 100644 --- a/gazebo_plugins/src/gazebo_ros_diff_drive.cpp +++ b/gazebo_plugins/src/gazebo_ros_diff_drive.cpp @@ -29,7 +29,7 @@ /* * \file gazebo_ros_diff_drive.cpp * - * \brief A differential drive plugin for gazebo. Based on the diffdrive plugin + * \brief A differential drive plugin for gazebo. Based on the diffdrive plugin * developed for the erratic robot (see copyright notice above). The original * plugin can be found in the ROS package gazebo_erratic_plugins. * @@ -38,6 +38,15 @@ * $ Id: 06/21/2013 11:23:40 AM piyushk $ */ + +/* + * + * The support of acceleration limit was added by + * \author George Todoran + * \author Markus Bader + * \date 22th of May 2014 + */ + #include #include @@ -47,132 +56,67 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -namespace gazebo { +namespace gazebo +{ - enum { +enum { RIGHT, LEFT, - }; +}; - GazeboRosDiffDrive::GazeboRosDiffDrive() {} +GazeboRosDiffDrive::GazeboRosDiffDrive() {} - // Destructor - GazeboRosDiffDrive::~GazeboRosDiffDrive() { - delete rosnode_; - delete transform_broadcaster_; - } +// Destructor +GazeboRosDiffDrive::~GazeboRosDiffDrive() {} - // Load the controller - void GazeboRosDiffDrive::Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf) { +// Load the controller +void GazeboRosDiffDrive::Load ( physics::ModelPtr _parent, sdf::ElementPtr _sdf ) +{ this->parent = _parent; - this->world = _parent->GetWorld(); - - this->robot_namespace_ = ""; - if (!_sdf->HasElement("robotNamespace")) { - ROS_INFO("GazeboRosDiffDrive Plugin missing , defaults to \"%s\"", - this->robot_namespace_.c_str()); - } else { - this->robot_namespace_ = - _sdf->GetElement("robotNamespace")->Get() + "/"; - } - - this->left_joint_name_ = "left_joint"; - if (!_sdf->HasElement("leftJoint")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to \"%s\"", - this->robot_namespace_.c_str(), this->left_joint_name_.c_str()); - } else { - this->left_joint_name_ = _sdf->GetElement("leftJoint")->Get(); - } - - this->right_joint_name_ = "right_joint"; - if (!_sdf->HasElement("rightJoint")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to \"%s\"", - this->robot_namespace_.c_str(), this->right_joint_name_.c_str()); - } else { - this->right_joint_name_ = _sdf->GetElement("rightJoint")->Get(); - } - - this->wheel_separation_ = 0.34; - if (!_sdf->HasElement("wheelSeparation")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to %f", - this->robot_namespace_.c_str(), this->wheel_separation_); - } else { - this->wheel_separation_ = - _sdf->GetElement("wheelSeparation")->Get(); - } - - this->wheel_diameter_ = 0.15; - if (!_sdf->HasElement("wheelDiameter")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to %f", - this->robot_namespace_.c_str(), this->wheel_diameter_); - } else { - this->wheel_diameter_ = _sdf->GetElement("wheelDiameter")->Get(); - } - - this->torque = 5.0; - if (!_sdf->HasElement("torque")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to %f", - this->robot_namespace_.c_str(), this->torque); - } else { - this->torque = _sdf->GetElement("torque")->Get(); - } - - this->command_topic_ = "cmd_vel"; - if (!_sdf->HasElement("commandTopic")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to \"%s\"", - this->robot_namespace_.c_str(), this->command_topic_.c_str()); - } else { - this->command_topic_ = _sdf->GetElement("commandTopic")->Get(); - } - - this->odometry_topic_ = "odom"; - if (!_sdf->HasElement("odometryTopic")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to \"%s\"", - this->robot_namespace_.c_str(), this->odometry_topic_.c_str()); - } else { - this->odometry_topic_ = _sdf->GetElement("odometryTopic")->Get(); - } - - this->odometry_frame_ = "odom"; - if (!_sdf->HasElement("odometryFrame")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to \"%s\"", - this->robot_namespace_.c_str(), this->odometry_frame_.c_str()); - } else { - this->odometry_frame_ = _sdf->GetElement("odometryFrame")->Get(); - } - - this->robot_base_frame_ = "base_footprint"; - if (!_sdf->HasElement("robotBaseFrame")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to \"%s\"", - this->robot_namespace_.c_str(), this->robot_base_frame_.c_str()); - } else { - this->robot_base_frame_ = _sdf->GetElement("robotBaseFrame")->Get(); - } - - this->update_rate_ = 100.0; - if (!_sdf->HasElement("updateRate")) { - ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to %f", - this->robot_namespace_.c_str(), this->update_rate_); + gazebo_ros_ = GazeboRosPtr ( new GazeboRos ( _parent, _sdf, "DiffDrive" ) ); + // Make sure the ROS node for Gazebo has already been initialized + gazebo_ros_->isInitialized(); + + gazebo_ros_->getParameter ( command_topic_, "commandTopic", "cmd_vel" ); + gazebo_ros_->getParameter ( odometry_topic_, "odometryTopic", "odom" ); + gazebo_ros_->getParameter ( odometry_frame_, "odometryFrame", "odom" ); + gazebo_ros_->getParameter ( robot_base_frame_, "robotBaseFrame", "base_footprint" ); + gazebo_ros_->getParameterBoolean ( publishWheelTF_, "publishWheelTF", false ); + gazebo_ros_->getParameterBoolean ( publishWheelJointState_, "publishWheelJointState", false ); + + gazebo_ros_->getParameter ( wheel_separation_, "wheelSeparation", 0.34 ); + gazebo_ros_->getParameter ( wheel_diameter_, "wheelDiameter", 0.15 ); + gazebo_ros_->getParameter ( wheel_accel, "wheelAcceleration", 0.0 ); + gazebo_ros_->getParameter ( wheel_torque, "wheelTorque", 5.0 ); + gazebo_ros_->getParameter ( update_rate_, "updateRate", 100.0 ); + std::map odomOptions; + odomOptions["encoder"] = ENCODER; + odomOptions["world"] = WORLD; + gazebo_ros_->getParameter ( odom_source_, "odometrySource", odomOptions, WORLD ); + + + joints_.resize ( 2 ); + joints_[LEFT] = gazebo_ros_->getJoint ( parent, "leftJoint", "left_joint" ); + joints_[RIGHT] = gazebo_ros_->getJoint ( parent, "rightJoint", "right_joint" ); + joints_[LEFT]->SetMaxForce ( 0, wheel_torque ); + joints_[RIGHT]->SetMaxForce ( 0, wheel_torque ); + + + + this->publish_tf_ = true; + if (!_sdf->HasElement("publishTf")) { + ROS_WARN("GazeboRosDiffDrive Plugin (ns = %s) missing , defaults to %d", + this->robot_namespace_.c_str(), this->publish_tf_); } else { - this->update_rate_ = _sdf->GetElement("updateRate")->Get(); + this->publish_tf_ = _sdf->GetElement("publishTf")->Get(); } // Initialize update rate stuff - if (this->update_rate_ > 0.0) { - this->update_period_ = 1.0 / this->update_rate_; - } else { - this->update_period_ = 0.0; - } - last_update_time_ = this->world->GetSimTime(); + if ( this->update_rate_ > 0.0 ) this->update_period_ = 1.0 / this->update_rate_; + else this->update_period_ = 0.0; + last_update_time_ = parent->GetWorld()->GetSimTime(); // Initialize velocity stuff wheel_speed_[RIGHT] = 0; @@ -182,143 +126,257 @@ namespace gazebo { rot_ = 0; alive_ = true; - joints[LEFT] = this->parent->GetJoint(left_joint_name_); - joints[RIGHT] = this->parent->GetJoint(right_joint_name_); - - if (!joints[LEFT]) { - char error[200]; - snprintf(error, 200, - "GazeboRosDiffDrive Plugin (ns = %s) couldn't get left hinge joint named \"%s\"", - this->robot_namespace_.c_str(), this->left_joint_name_.c_str()); - gzthrow(error); - } - if (!joints[RIGHT]) { - char error[200]; - snprintf(error, 200, - "GazeboRosDiffDrive Plugin (ns = %s) couldn't get right hinge joint named \"%s\"", - this->robot_namespace_.c_str(), this->right_joint_name_.c_str()); - gzthrow(error); - } - - joints[LEFT]->SetMaxForce(0, torque); - joints[RIGHT]->SetMaxForce(0, torque); - // Make sure the ROS node for Gazebo has already been initialized - if (!ros::isInitialized()) + if (this->publishWheelJointState_) { - ROS_FATAL_STREAM("A ROS node for Gazebo has not been initialized, unable to load plugin. " - << "Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package)"); - return; + joint_state_publisher_ = gazebo_ros_->node()->advertise("joint_states", 1000); + ROS_INFO("%s: Advertise joint_states!", gazebo_ros_->info()); } - rosnode_ = new ros::NodeHandle(this->robot_namespace_); - - ROS_INFO("Starting GazeboRosDiffDrive Plugin (ns = %s)!", this->robot_namespace_.c_str()); - - tf_prefix_ = tf::getPrefixParam(*rosnode_); - transform_broadcaster_ = new tf::TransformBroadcaster(); + transform_broadcaster_ = boost::shared_ptr(new tf::TransformBroadcaster()); // ROS: Subscribe to the velocity command topic (usually "cmd_vel") + ROS_INFO("%s: Try to subscribe to %s!", gazebo_ros_->info(), command_topic_.c_str()); + ros::SubscribeOptions so = - ros::SubscribeOptions::create(command_topic_, 1, - boost::bind(&GazeboRosDiffDrive::cmdVelCallback, this, _1), - ros::VoidPtr(), &queue_); + ros::SubscribeOptions::create(command_topic_, 1, + boost::bind(&GazeboRosDiffDrive::cmdVelCallback, this, _1), + ros::VoidPtr(), &queue_); - cmd_vel_subscriber_ = rosnode_->subscribe(so); + cmd_vel_subscriber_ = gazebo_ros_->node()->subscribe(so); + ROS_INFO("%s: Subscribe to %s!", gazebo_ros_->info(), command_topic_.c_str()); - odometry_publisher_ = rosnode_->advertise(odometry_topic_, 1); + if (this->publish_tf_) + { + odometry_publisher_ = gazebo_ros_->node()->advertise(odometry_topic_, 1); + ROS_INFO("%s: Advertise odom on %s !", gazebo_ros_->info(), odometry_topic_.c_str()); + } // start custom queue for diff drive - this->callback_queue_thread_ = - boost::thread(boost::bind(&GazeboRosDiffDrive::QueueThread, this)); + this->callback_queue_thread_ = + boost::thread ( boost::bind ( &GazeboRosDiffDrive::QueueThread, this ) ); // listen to the update event (broadcast every simulation iteration) - this->update_connection_ = - event::Events::ConnectWorldUpdateBegin( - boost::bind(&GazeboRosDiffDrive::UpdateChild, this)); + this->update_connection_ = + event::Events::ConnectWorldUpdateBegin ( boost::bind ( &GazeboRosDiffDrive::UpdateChild, this ) ); - } +} - // Update the controller - void GazeboRosDiffDrive::UpdateChild() { - common::Time current_time = this->world->GetSimTime(); - double seconds_since_last_update = - (current_time - last_update_time_).Double(); - if (seconds_since_last_update > update_period_) { +void GazeboRosDiffDrive::publishWheelJointState() +{ + ros::Time current_time = ros::Time::now(); - publishOdometry(seconds_since_last_update); + joint_state_.header.stamp = current_time; + joint_state_.name.resize ( joints_.size() ); + joint_state_.position.resize ( joints_.size() ); - // Update robot in case new velocities have been requested - getWheelVelocities(); - joints[LEFT]->SetVelocity(0, wheel_speed_[LEFT] / wheel_diameter_); - joints[RIGHT]->SetVelocity(0, wheel_speed_[RIGHT] / wheel_diameter_); + for ( int i = 0; i < 2; i++ ) { + physics::JointPtr joint = joints_[i]; + math::Angle angle = joint->GetAngle ( 0 ); + joint_state_.name[i] = joint->GetName(); + joint_state_.position[i] = angle.Radian () ; + } + joint_state_publisher_.publish ( joint_state_ ); +} - last_update_time_+= common::Time(update_period_); +void GazeboRosDiffDrive::publishWheelTF() +{ + ros::Time current_time = ros::Time::now(); + for ( int i = 0; i < 2; i++ ) { + + std::string wheel_frame = gazebo_ros_->resolveTF(joints_[i]->GetChild()->GetName ()); + std::string wheel_parent_frame = gazebo_ros_->resolveTF(joints_[i]->GetParent()->GetName ()); + + math::Pose poseWheel = joints_[i]->GetChild()->GetRelativePose(); + + tf::Quaternion qt ( poseWheel.rot.x, poseWheel.rot.y, poseWheel.rot.z, poseWheel.rot.w ); + tf::Vector3 vt ( poseWheel.pos.x, poseWheel.pos.y, poseWheel.pos.z ); + + tf::Transform tfWheel ( qt, vt ); + transform_broadcaster_->sendTransform ( + tf::StampedTransform ( tfWheel, current_time, wheel_parent_frame, wheel_frame ) ); + } +} +// Update the controller +void GazeboRosDiffDrive::UpdateChild() +{ + + if ( odom_source_ == ENCODER ) UpdateOdometryEncoder(); + common::Time current_time = parent->GetWorld()->GetSimTime(); + double seconds_since_last_update = ( current_time - last_update_time_ ).Double(); + if ( seconds_since_last_update > update_period_ ) { + if (this->publish_tf_) publishOdometry ( seconds_since_last_update ); + if ( publishWheelTF_ ) publishWheelTF(); + if ( publishWheelJointState_ ) publishWheelJointState(); + + // Update robot in case new velocities have been requested + getWheelVelocities(); + + double current_speed[2]; + + current_speed[LEFT] = joints_[LEFT]->GetVelocity ( 0 ) * ( wheel_diameter_ / 2.0 ); + current_speed[RIGHT] = joints_[RIGHT]->GetVelocity ( 0 ) * ( wheel_diameter_ / 2.0 ); + + if ( wheel_accel == 0 || + ( fabs ( wheel_speed_[LEFT] - current_speed[LEFT] ) < 0.01 ) || + ( fabs ( wheel_speed_[RIGHT] - current_speed[RIGHT] ) < 0.01 ) ) { + //if max_accel == 0, or target speed is reached + joints_[LEFT]->SetVelocity ( 0, wheel_speed_[LEFT]/ ( wheel_diameter_ / 2.0 ) ); + joints_[RIGHT]->SetVelocity ( 0, wheel_speed_[RIGHT]/ ( wheel_diameter_ / 2.0 ) ); + } else { + if ( wheel_speed_[LEFT]>=current_speed[LEFT] ) + wheel_speed_instr_[LEFT]+=fmin ( wheel_speed_[LEFT]-current_speed[LEFT], wheel_accel * seconds_since_last_update ); + else + wheel_speed_instr_[LEFT]+=fmax ( wheel_speed_[LEFT]-current_speed[LEFT], -wheel_accel * seconds_since_last_update ); + + if ( wheel_speed_[RIGHT]>current_speed[RIGHT] ) + wheel_speed_instr_[RIGHT]+=fmin ( wheel_speed_[RIGHT]-current_speed[RIGHT], wheel_accel * seconds_since_last_update ); + else + wheel_speed_instr_[RIGHT]+=fmax ( wheel_speed_[RIGHT]-current_speed[RIGHT], -wheel_accel * seconds_since_last_update ); + + // ROS_INFO("actual wheel speed = %lf, issued wheel speed= %lf", current_speed[LEFT], wheel_speed_[LEFT]); + // ROS_INFO("actual wheel speed = %lf, issued wheel speed= %lf", current_speed[RIGHT],wheel_speed_[RIGHT]); + + joints_[LEFT]->SetVelocity ( 0,wheel_speed_instr_[LEFT] / ( wheel_diameter_ / 2.0 ) ); + joints_[RIGHT]->SetVelocity ( 0,wheel_speed_instr_[RIGHT] / ( wheel_diameter_ / 2.0 ) ); + } + last_update_time_+= common::Time ( update_period_ ); } - } +} - // Finalize the controller - void GazeboRosDiffDrive::FiniChild() { +// Finalize the controller +void GazeboRosDiffDrive::FiniChild() +{ alive_ = false; queue_.clear(); queue_.disable(); - rosnode_->shutdown(); + gazebo_ros_->node()->shutdown(); callback_queue_thread_.join(); - } +} - void GazeboRosDiffDrive::getWheelVelocities() { - boost::mutex::scoped_lock scoped_lock(lock); +void GazeboRosDiffDrive::getWheelVelocities() +{ + boost::mutex::scoped_lock scoped_lock ( lock ); double vr = x_; double va = rot_; wheel_speed_[LEFT] = vr + va * wheel_separation_ / 2.0; wheel_speed_[RIGHT] = vr - va * wheel_separation_ / 2.0; - } - - void GazeboRosDiffDrive::cmdVelCallback( - const geometry_msgs::Twist::ConstPtr& cmd_msg) { +} - boost::mutex::scoped_lock scoped_lock(lock); +void GazeboRosDiffDrive::cmdVelCallback ( const geometry_msgs::Twist::ConstPtr& cmd_msg ) +{ + boost::mutex::scoped_lock scoped_lock ( lock ); x_ = cmd_msg->linear.x; rot_ = cmd_msg->angular.z; - } +} - void GazeboRosDiffDrive::QueueThread() { +void GazeboRosDiffDrive::QueueThread() +{ static const double timeout = 0.01; - while (alive_ && rosnode_->ok()) { - queue_.callAvailable(ros::WallDuration(timeout)); + while ( alive_ && gazebo_ros_->node()->ok() ) { + queue_.callAvailable ( ros::WallDuration ( timeout ) ); } - } +} + +void GazeboRosDiffDrive::UpdateOdometryEncoder() +{ + double vl = joints_[LEFT]->GetVelocity ( 0 ); + double vr = joints_[RIGHT]->GetVelocity ( 0 ); + common::Time current_time = parent->GetWorld()->GetSimTime(); + double seconds_since_last_update = ( current_time - last_odom_update_ ).Double(); + last_odom_update_ = current_time; + + double b = wheel_separation_; - void GazeboRosDiffDrive::publishOdometry(double step_time) { + // Book: Sigwart 2011 Autonompus Mobile Robots page:337 + double sl = vl * ( wheel_diameter_ / 2.0 ) * seconds_since_last_update; + double sr = vr * ( wheel_diameter_ / 2.0 ) * seconds_since_last_update; + double theta = ( sl - sr ) /b; + + + double dx = ( sl + sr ) /2.0 * cos ( pose_encoder_.theta + ( sl - sr ) / ( 2.0*b ) ); + double dy = ( sl + sr ) /2.0 * sin ( pose_encoder_.theta + ( sl - sr ) / ( 2.0*b ) ); + double dtheta = ( sl - sr ) /b; + + pose_encoder_.x += dx; + pose_encoder_.y += dy; + pose_encoder_.theta += dtheta; + + double w = dtheta/seconds_since_last_update; + double v = sqrt ( dx*dx+dy*dy ) /seconds_since_last_update; + + tf::Quaternion qt; + tf::Vector3 vt; + qt.setRPY ( 0,0,pose_encoder_.theta ); + vt = tf::Vector3 ( pose_encoder_.x, pose_encoder_.y, 0 ); + + odom_.pose.pose.position.x = vt.x(); + odom_.pose.pose.position.y = vt.y(); + odom_.pose.pose.position.z = vt.z(); + + odom_.pose.pose.orientation.x = qt.x(); + odom_.pose.pose.orientation.y = qt.y(); + odom_.pose.pose.orientation.z = qt.z(); + odom_.pose.pose.orientation.w = qt.w(); + + odom_.twist.twist.angular.z = w; + odom_.twist.twist.linear.x = dx/seconds_since_last_update; + odom_.twist.twist.linear.y = dy/seconds_since_last_update; +} + +void GazeboRosDiffDrive::publishOdometry ( double step_time ) +{ + ros::Time current_time = ros::Time::now(); - std::string odom_frame = - tf::resolve(tf_prefix_, odometry_frame_); - std::string base_footprint_frame = - tf::resolve(tf_prefix_, robot_base_frame_); - - // getting data for base_footprint to odom transform - math::Pose pose = this->parent->GetWorldPose(); - - tf::Quaternion qt(pose.rot.x, pose.rot.y, pose.rot.z, pose.rot.w); - tf::Vector3 vt(pose.pos.x, pose.pos.y, pose.pos.z); - - tf::Transform base_footprint_to_odom(qt, vt); - transform_broadcaster_->sendTransform( - tf::StampedTransform(base_footprint_to_odom, current_time, - odom_frame, base_footprint_frame)); - - // publish odom topic - odom_.pose.pose.position.x = pose.pos.x; - odom_.pose.pose.position.y = pose.pos.y; - - odom_.pose.pose.orientation.x = pose.rot.x; - odom_.pose.pose.orientation.y = pose.rot.y; - odom_.pose.pose.orientation.z = pose.rot.z; - odom_.pose.pose.orientation.w = pose.rot.w; + std::string odom_frame = gazebo_ros_->resolveTF ( odometry_frame_ ); + std::string base_footprint_frame = gazebo_ros_->resolveTF ( robot_base_frame_ ); + + tf::Quaternion qt; + tf::Vector3 vt; + + if ( odom_source_ == ENCODER ) { + // getting data form encoder integration + qt = tf::Quaternion ( odom_.pose.pose.orientation.x, odom_.pose.pose.orientation.y, odom_.pose.pose.orientation.z, odom_.pose.pose.orientation.w ); + vt = tf::Vector3 ( odom_.pose.pose.position.x, odom_.pose.pose.position.y, odom_.pose.pose.position.z ); + + } + if ( odom_source_ == WORLD ) { + // getting data form gazebo world + math::Pose pose = parent->GetWorldPose(); + qt = tf::Quaternion ( pose.rot.x, pose.rot.y, pose.rot.z, pose.rot.w ); + vt = tf::Vector3 ( pose.pos.x, pose.pos.y, pose.pos.z ); + + odom_.pose.pose.position.x = vt.x(); + odom_.pose.pose.position.y = vt.y(); + odom_.pose.pose.position.z = vt.z(); + + odom_.pose.pose.orientation.x = qt.x(); + odom_.pose.pose.orientation.y = qt.y(); + odom_.pose.pose.orientation.z = qt.z(); + odom_.pose.pose.orientation.w = qt.w(); + + // get velocity in /odom frame + math::Vector3 linear; + linear = parent->GetWorldLinearVel(); + odom_.twist.twist.angular.z = parent->GetWorldAngularVel().z; + + // convert velocity to child_frame_id (aka base_footprint) + float yaw = pose.rot.GetYaw(); + odom_.twist.twist.linear.x = cosf ( yaw ) * linear.x + sinf ( yaw ) * linear.y; + odom_.twist.twist.linear.y = cosf ( yaw ) * linear.y - sinf ( yaw ) * linear.x; + } + + tf::Transform base_footprint_to_odom ( qt, vt ); + transform_broadcaster_->sendTransform ( + tf::StampedTransform ( base_footprint_to_odom, current_time, + odom_frame, base_footprint_frame ) ); + + + // set covariance odom_.pose.covariance[0] = 0.00001; odom_.pose.covariance[7] = 0.00001; odom_.pose.covariance[14] = 1000000000000.0; @@ -326,22 +384,15 @@ namespace gazebo { odom_.pose.covariance[28] = 1000000000000.0; odom_.pose.covariance[35] = 0.001; - // get velocity in /odom frame - math::Vector3 linear; - linear = this->parent->GetWorldLinearVel(); - odom_.twist.twist.angular.z = this->parent->GetWorldAngularVel().z; - - // convert velocity to child_frame_id (aka base_footprint) - float yaw = pose.rot.GetYaw(); - odom_.twist.twist.linear.x = cosf(yaw) * linear.x + sinf(yaw) * linear.y; - odom_.twist.twist.linear.y = cosf(yaw) * linear.y - sinf(yaw) * linear.x; + // set header odom_.header.stamp = current_time; odom_.header.frame_id = odom_frame; odom_.child_frame_id = base_footprint_frame; - odometry_publisher_.publish(odom_); - } + odometry_publisher_.publish ( odom_ ); +} - GZ_REGISTER_MODEL_PLUGIN(GazeboRosDiffDrive) +GZ_REGISTER_MODEL_PLUGIN ( GazeboRosDiffDrive ) } + diff --git a/gazebo_plugins/src/gazebo_ros_force.cpp b/gazebo_plugins/src/gazebo_ros_force.cpp index 7f10ce8e4..0f6cc0721 100644 --- a/gazebo_plugins/src/gazebo_ros_force.cpp +++ b/gazebo_plugins/src/gazebo_ros_force.cpp @@ -71,7 +71,7 @@ void GazeboRosForce::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) if (!_sdf->HasElement("bodyName")) { - ROS_FATAL("f3d plugin missing , cannot proceed"); + ROS_FATAL("force plugin missing , cannot proceed"); return; } else @@ -80,13 +80,13 @@ void GazeboRosForce::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) this->link_ = _model->GetLink(this->link_name_); if (!this->link_) { - ROS_FATAL("gazebo_ros_f3d plugin error: link named: %s does not exist\n",this->link_name_.c_str()); + ROS_FATAL("gazebo_ros_force plugin error: link named: %s does not exist\n",this->link_name_.c_str()); return; } if (!_sdf->HasElement("topicName")) { - ROS_FATAL("f3d plugin missing , cannot proceed"); + ROS_FATAL("force plugin missing , cannot proceed"); return; } else diff --git a/gazebo_plugins/src/gazebo_ros_ft_sensor.cpp b/gazebo_plugins/src/gazebo_ros_ft_sensor.cpp new file mode 100644 index 000000000..db694e7f0 --- /dev/null +++ b/gazebo_plugins/src/gazebo_ros_ft_sensor.cpp @@ -0,0 +1,241 @@ +/* + * Copyright (C) 2012-2014 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +/* + * Desc: Force Torque Sensor Plugin + * Author: Francisco Suarez-Ruiz + * Date: 5 June 2014 + */ + +#include +#include + +namespace gazebo +{ +GZ_REGISTER_MODEL_PLUGIN(GazeboRosFT); + +//////////////////////////////////////////////////////////////////////////////// +// Constructor +GazeboRosFT::GazeboRosFT() +{ + this->ft_connect_count_ = 0; + this->seed = 0; +} + +//////////////////////////////////////////////////////////////////////////////// +// Destructor +GazeboRosFT::~GazeboRosFT() +{ + event::Events::DisconnectWorldUpdateBegin(this->update_connection_); + // Custom Callback Queue + this->queue_.clear(); + this->queue_.disable(); + this->rosnode_->shutdown(); + this->callback_queue_thread_.join(); + delete this->rosnode_; +} + +//////////////////////////////////////////////////////////////////////////////// +// Load the controller +void GazeboRosFT::Load( physics::ModelPtr _model, sdf::ElementPtr _sdf ) +{ + // Save pointers + this->model_ = _model; + this->world_ = this->model_->GetWorld(); + + // load parameters + this->robot_namespace_ = ""; + if (_sdf->HasElement("robotNamespace")) + this->robot_namespace_ = _sdf->GetElement("robotNamespace")->Get() + "/"; + + if (!_sdf->HasElement("jointName")) + { + ROS_FATAL("ft_sensor plugin missing , cannot proceed"); + return; + } + else + this->joint_name_ = _sdf->GetElement("jointName")->Get(); + + this->joint_ = this->model_->GetJoint(this->joint_name_); + if (!this->joint_) + { + ROS_FATAL("gazebo_ros_ft_sensor plugin error: jointName: %s does not exist\n",this->joint_name_.c_str()); + return; + } + + this->parent_link_ = this->joint_->GetParent(); + this->child_link_ = this->joint_->GetChild(); + this->frame_name_ = this->child_link_->GetName(); + + ROS_INFO("ft_sensor plugin reporting wrench values to the frame [%s]", this->frame_name_.c_str()); + + if (!_sdf->HasElement("topicName")) + { + ROS_FATAL("ft_sensor plugin missing , cannot proceed"); + return; + } + else + this->topic_name_ = _sdf->GetElement("topicName")->Get(); + + if (!_sdf->HasElement("gaussianNoise")) + { + ROS_INFO("imu plugin missing , defaults to 0.0"); + this->gaussian_noise_ = 0.0; + } + else + this->gaussian_noise_ = _sdf->Get("gaussianNoise"); + + if (!_sdf->HasElement("updateRate")) + { + ROS_DEBUG("ft_sensor plugin missing , defaults to 0.0" + " (as fast as possible)"); + this->update_rate_ = 0; + } + else + this->update_rate_ = _sdf->GetElement("updateRate")->Get(); + + // Make sure the ROS node for Gazebo has already been initialized + if (!ros::isInitialized()) + { + ROS_FATAL_STREAM("A ROS node for Gazebo has not been initialized, unable to load plugin. " + << "Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package)"); + return; + } + + this->rosnode_ = new ros::NodeHandle(this->robot_namespace_); + + // resolve tf prefix + std::string prefix; + this->rosnode_->getParam(std::string("tf_prefix"), prefix); + this->frame_name_ = tf::resolve(prefix, this->frame_name_); + + // Custom Callback Queue + ros::AdvertiseOptions ao = ros::AdvertiseOptions::create( + this->topic_name_,1, + boost::bind( &GazeboRosFT::FTConnect,this), + boost::bind( &GazeboRosFT::FTDisconnect,this), ros::VoidPtr(), &this->queue_); + this->pub_ = this->rosnode_->advertise(ao); + + // Custom Callback Queue + this->callback_queue_thread_ = boost::thread( boost::bind( &GazeboRosFT::QueueThread,this ) ); + + // New Mechanism for Updating every World Cycle + // Listen to the update event. This event is broadcast every + // simulation iteration. + this->update_connection_ = event::Events::ConnectWorldUpdateBegin( + boost::bind(&GazeboRosFT::UpdateChild, this)); +} + +//////////////////////////////////////////////////////////////////////////////// +// Someone subscribes to me +void GazeboRosFT::FTConnect() +{ + this->ft_connect_count_++; +} + +//////////////////////////////////////////////////////////////////////////////// +// Someone subscribes to me +void GazeboRosFT::FTDisconnect() +{ + this->ft_connect_count_--; +} + +//////////////////////////////////////////////////////////////////////////////// +// Update the controller +void GazeboRosFT::UpdateChild() +{ + common::Time cur_time = this->world_->GetSimTime(); + + // rate control + if (this->update_rate_ > 0 && + (cur_time-this->last_time_).Double() < (1.0/this->update_rate_)) + return; + + if (this->ft_connect_count_ == 0) + return; + + physics::JointWrench wrench; + math::Vector3 torque; + math::Vector3 force; + + // FIXME: Should include options for diferent frames and measure directions + // E.g: https://bitbucket.org/osrf/gazebo/raw/default/gazebo/sensors/ForceTorqueSensor.hh + // Get force torque at the joint + // The wrench is reported in the CHILD + // The is child_to_parent + wrench = this->joint_->GetForceTorque(0); + force = wrench.body2Force; + torque = wrench.body2Torque; + + + this->lock_.lock(); + // copy data into wrench message + this->wrench_msg_.header.frame_id = this->frame_name_; + this->wrench_msg_.header.stamp.sec = (this->world_->GetSimTime()).sec; + this->wrench_msg_.header.stamp.nsec = (this->world_->GetSimTime()).nsec; + + this->wrench_msg_.wrench.force.x = force.x + this->GaussianKernel(0, this->gaussian_noise_); + this->wrench_msg_.wrench.force.y = force.y + this->GaussianKernel(0, this->gaussian_noise_); + this->wrench_msg_.wrench.force.z = force.z + this->GaussianKernel(0, this->gaussian_noise_); + this->wrench_msg_.wrench.torque.x = torque.x + this->GaussianKernel(0, this->gaussian_noise_); + this->wrench_msg_.wrench.torque.y = torque.y + this->GaussianKernel(0, this->gaussian_noise_); + this->wrench_msg_.wrench.torque.z = torque.z + this->GaussianKernel(0, this->gaussian_noise_); + + this->pub_.publish(this->wrench_msg_); + this->lock_.unlock(); + + // save last time stamp + this->last_time_ = cur_time; +} + +////////////////////////////////////////////////////////////////////////////// +// Utility for adding noise +double GazeboRosFT::GaussianKernel(double mu, double sigma) +{ + // using Box-Muller transform to generate two independent standard + // normally disbributed normal variables see wikipedia + + // normalized uniform random variable + double U = static_cast(rand_r(&this->seed)) / + static_cast(RAND_MAX); + + // normalized uniform random variable + double V = static_cast(rand_r(&this->seed)) / + static_cast(RAND_MAX); + + double X = sqrt(-2.0 * ::log(U)) * cos(2.0*M_PI * V); + // double Y = sqrt(-2.0 * ::log(U)) * sin(2.0*M_PI * V); + + // there are 2 indep. vars, we'll just use X + // scale to our mu and sigma + X = sigma * X + mu; + return X; +} + +// Custom Callback Queue +//////////////////////////////////////////////////////////////////////////////// +// custom callback queue thread +void GazeboRosFT::QueueThread() +{ + static const double timeout = 0.01; + + while (this->rosnode_->ok()) + { + this->queue_.callAvailable(ros::WallDuration(timeout)); + } +} + +} diff --git a/gazebo_plugins/src/gazebo_ros_gpu_laser.cpp b/gazebo_plugins/src/gazebo_ros_gpu_laser.cpp index e780fa240..811fc81b2 100644 --- a/gazebo_plugins/src/gazebo_ros_gpu_laser.cpp +++ b/gazebo_plugins/src/gazebo_ros_gpu_laser.cpp @@ -33,10 +33,13 @@ #include #include #include +#include #include +#include #include "gazebo_plugins/gazebo_ros_gpu_laser.h" +#include namespace gazebo { @@ -78,13 +81,11 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) if (!this->parent_ray_sensor_) gzthrow("GazeboRosLaser controller requires a Ray Sensor as its parent"); - this->robot_namespace_ = ""; - if (this->sdf->HasElement("robotNamespace")) - this->robot_namespace_ = this->sdf->Get("robotNamespace") + "/"; + this->robot_namespace_ = GetRobotNamespace(_parent, _sdf, "Laser"); if (!this->sdf->HasElement("frameName")) { - ROS_INFO("Laser plugin missing , defaults to /world"); + ROS_INFO("GazeboRosLaser plugin missing , defaults to /world"); this->frame_name_ = "/world"; } else @@ -92,7 +93,7 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) if (!this->sdf->HasElement("topicName")) { - ROS_INFO("Laser plugin missing , defaults to /world"); + ROS_INFO("GazeboRosLaser plugin missing , defaults to /world"); this->topic_name_ = "/world"; } else @@ -109,6 +110,7 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) return; } + ROS_INFO ( "Starting GazeboRosLaser Plugin (ns = %s)!", this->robot_namespace_.c_str() ); // ros callback queue for processing subscription this->deferred_load_thread_ = boost::thread( boost::bind(&GazeboRosLaser::LoadThread, this)); @@ -119,16 +121,23 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) // Load the controller void GazeboRosLaser::LoadThread() { - this->rosnode_ = new ros::NodeHandle(this->robot_namespace_); this->gazebo_node_ = gazebo::transport::NodePtr(new gazebo::transport::Node()); this->gazebo_node_->Init(this->world_name_); this->pmq.startServiceThread(); + this->rosnode_ = new ros::NodeHandle(this->robot_namespace_); + + this->tf_prefix_ = tf::getPrefixParam(*this->rosnode_); + if(this->tf_prefix_.empty()) { + this->tf_prefix_ = this->robot_namespace_; + boost::trim_right_if(this->tf_prefix_,boost::is_any_of("/")); + } + ROS_INFO("GPU Laser Plugin (ns = %s) , set to \"%s\"", + this->robot_namespace_.c_str(), this->tf_prefix_.c_str()); + // resolve tf prefix - std::string prefix; - this->rosnode_->getParam(std::string("tf_prefix"), prefix); - this->frame_name_ = tf::resolve(prefix, this->frame_name_); + this->frame_name_ = tf::resolve(this->tf_prefix_, this->frame_name_); if (this->topic_name_ != "") { diff --git a/gazebo_plugins/src/gazebo_ros_hand_of_god.cpp b/gazebo_plugins/src/gazebo_ros_hand_of_god.cpp new file mode 100644 index 000000000..607476c9e --- /dev/null +++ b/gazebo_plugins/src/gazebo_ros_hand_of_god.cpp @@ -0,0 +1,190 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2013, Open Source Robotics Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the Open Source Robotics Foundation + * nor the names of its contributors may be + * used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + +/** + * \author Jonathan Bohren + * \desc A "hand-of-god" plugin which drives a floating object around based + * on the location of a TF frame. This plugin is useful for connecting human input + * devices to "god-like" objects in a Gazebo simulation. + */ + +#include +#include + +namespace gazebo +{ + // Register this plugin with the simulator + GZ_REGISTER_MODEL_PLUGIN(GazeboRosHandOfGod); + + //////////////////////////////////////////////////////////////////////////////// + // Constructor + GazeboRosHandOfGod::GazeboRosHandOfGod() : + ModelPlugin(), + robot_namespace_(""), + frame_id_("hog"), + kl_(200), + ka_(200) + { + } + + //////////////////////////////////////////////////////////////////////////////// + // Destructor + GazeboRosHandOfGod::~GazeboRosHandOfGod() + { + } + + //////////////////////////////////////////////////////////////////////////////// + // Load the controller + void GazeboRosHandOfGod::Load( physics::ModelPtr _parent, sdf::ElementPtr _sdf ) + { + // Make sure the ROS node for Gazebo has already been initalized + if (!ros::isInitialized()) { + ROS_FATAL_STREAM("A ROS node for Gazebo has not been initialized, unable to load plugin. " + << "Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package)"); + return; + } + + // Get sdf parameters + if(_sdf->HasElement("robotNamespace")) { + this->robot_namespace_ = _sdf->Get("robotNamespace") + "/"; + } + + if(_sdf->HasElement("frameId")) { + this->frame_id_ = _sdf->Get("frameId"); + } + + if(_sdf->HasElement("kl")) { + this->kl_ = _sdf->Get("kl"); + } + if(_sdf->HasElement("ka")) { + this->ka_ = _sdf->Get("ka"); + } + + if(_sdf->HasElement("linkName")) { + this->link_name_ = _sdf->Get("linkName"); + } else { + ROS_FATAL_STREAM("The hand-of-god plugin requires a `linkName` parameter tag"); + return; + } + + // Store the model + model_ = _parent; + + // Disable gravity for the hog + model_->SetGravityMode(false); + + // Get the floating link + floating_link_ = model_->GetLink(link_name_); + if(!floating_link_) { + ROS_ERROR("Floating link not found!"); + const std::vector &links = model_->GetLinks(); + for(unsigned i=0; i < links.size(); i++) { + ROS_ERROR_STREAM(" -- Link "<GetName()); + } + return; + } + + cl_ = 2.0 * sqrt(kl_*floating_link_->GetInertial()->GetMass()); + ca_ = 2.0 * sqrt(ka_*floating_link_->GetInertial()->GetIXX()); + + // Create the TF listener for the desired position of the hog + tf_buffer_.reset(new tf2_ros::Buffer()); + tf_listener_.reset(new tf2_ros::TransformListener(*tf_buffer_)); + tf_broadcaster_.reset(new tf2_ros::TransformBroadcaster()); + + // Register update event handler + this->update_connection_ = event::Events::ConnectWorldUpdateBegin( + boost::bind(&GazeboRosHandOfGod::GazeboUpdate, this)); + } + + //////////////////////////////////////////////////////////////////////////////// + // Update the controller + void GazeboRosHandOfGod::GazeboUpdate() + { + // Get TF transform relative to the /world link + geometry_msgs::TransformStamped hog_desired_tform; + static bool errored = false; + try{ + hog_desired_tform = tf_buffer_->lookupTransform("world", frame_id_+"_desired", ros::Time(0)); + errored = false; + } catch (tf2::TransformException ex){ + if(!errored) { + ROS_ERROR("%s",ex.what()); + errored = true; + } + return; + } + + // Convert TF transform to Gazebo Pose + const geometry_msgs::Vector3 &p = hog_desired_tform.transform.translation; + const geometry_msgs::Quaternion &q = hog_desired_tform.transform.rotation; + gazebo::math::Pose hog_desired( + gazebo::math::Vector3(p.x, p.y, p.z), + gazebo::math::Quaternion(q.w, q.x, q.y, q.z)); + + // Relative transform from actual to desired pose + gazebo::math::Pose world_pose = floating_link_->GetDirtyPose(); + gazebo::math::Vector3 err_pos = hog_desired.pos - world_pose.pos; + // Get exponential coordinates for rotation + gazebo::math::Quaternion err_rot = (world_pose.rot.GetAsMatrix4().Inverse() * hog_desired.rot.GetAsMatrix4()).GetRotation(); + gazebo::math::Quaternion not_a_quaternion = err_rot.GetLog(); + + floating_link_->AddForce( + kl_ * err_pos - cl_ * floating_link_->GetWorldLinearVel()); + + floating_link_->AddRelativeTorque( + ka_ * gazebo::math::Vector3(not_a_quaternion.x, not_a_quaternion.y, not_a_quaternion.z) - ca_ * floating_link_->GetRelativeAngularVel()); + + // Convert actual pose to TransformStamped message + geometry_msgs::TransformStamped hog_actual_tform; + + hog_actual_tform.header.frame_id = "world"; + hog_actual_tform.header.stamp = ros::Time::now(); + + hog_actual_tform.child_frame_id = frame_id_ + "_actual"; + + hog_actual_tform.transform.translation.x = world_pose.pos.x; + hog_actual_tform.transform.translation.y = world_pose.pos.y; + hog_actual_tform.transform.translation.z = world_pose.pos.z; + + hog_actual_tform.transform.rotation.w = world_pose.rot.w; + hog_actual_tform.transform.rotation.x = world_pose.rot.x; + hog_actual_tform.transform.rotation.y = world_pose.rot.y; + hog_actual_tform.transform.rotation.z = world_pose.rot.z; + + tf_broadcaster_->sendTransform(hog_actual_tform); + } + +} diff --git a/gazebo_plugins/src/gazebo_ros_imu.cpp b/gazebo_plugins/src/gazebo_ros_imu.cpp index bc3e8ebf1..233a44fb9 100644 --- a/gazebo_plugins/src/gazebo_ros_imu.cpp +++ b/gazebo_plugins/src/gazebo_ros_imu.cpp @@ -86,7 +86,7 @@ void GazeboRosIMU::LoadThread() if (!this->sdf->HasElement("gaussianNoise")) { ROS_INFO("imu plugin missing , defaults to 0.0"); - this->gaussian_noise_ = 0; + this->gaussian_noise_ = 0.0; } else this->gaussian_noise_ = this->sdf->Get("gaussianNoise"); @@ -114,6 +114,15 @@ void GazeboRosIMU::LoadThread() } else this->offset_.rot = this->sdf->Get("rpyOffset"); + + if (!this->sdf->HasElement("updateRate")) + { + ROS_DEBUG("imu plugin missing , defaults to 0.0" + " (as fast as possible)"); + this->update_rate_ = 0.0; + } + else + this->update_rate_ = this->sdf->GetElement("updateRate")->Get(); // Make sure the ROS node for Gazebo has already been initialized @@ -187,6 +196,13 @@ bool GazeboRosIMU::ServiceCallback(std_srvs::Empty::Request &req, // Update the controller void GazeboRosIMU::UpdateChild() { + common::Time cur_time = this->world_->GetSimTime(); + + // rate control + if (this->update_rate_ > 0 && + (cur_time - this->last_time_).Double() < (1.0 / this->update_rate_)) + return; + if ((this->pub_.getNumSubscribers() > 0 && this->topic_name_ != "")) { math::Pose pose; @@ -203,8 +219,6 @@ void GazeboRosIMU::UpdateChild() rot = this->offset_.rot*rot; rot.Normalize(); - common::Time cur_time = this->world_->GetSimTime(); - // get Rates math::Vector3 vpos = this->link->GetWorldLinearVel(); math::Vector3 veul = this->link->GetWorldAngularVel(); diff --git a/gazebo_plugins/src/gazebo_ros_joint_pose_trajectory.cpp b/gazebo_plugins/src/gazebo_ros_joint_pose_trajectory.cpp index 0acbb7713..be0f0dd25 100644 --- a/gazebo_plugins/src/gazebo_ros_joint_pose_trajectory.cpp +++ b/gazebo_plugins/src/gazebo_ros_joint_pose_trajectory.cpp @@ -340,8 +340,14 @@ void GazeboRosJointPoseTrajectory::UpdateStates() { // this is not the most efficient way to set things if (this->joints_[i]) + { +#if GAZEBO_MAJOR_VERSION >= 4 + this->joints_[i]->SetPosition(0, +#else this->joints_[i]->SetAngle(0, +#endif this->points_[this->trajectory_index].positions[i]); + } } // set model pose diff --git a/gazebo_plugins/src/gazebo_ros_joint_state_publisher.cpp b/gazebo_plugins/src/gazebo_ros_joint_state_publisher.cpp new file mode 100644 index 000000000..6c1ede190 --- /dev/null +++ b/gazebo_plugins/src/gazebo_ros_joint_state_publisher.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2013, Markus Bader + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY Antons Rebguns ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Antons Rebguns BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + **/ +#include +#include +#include + +using namespace gazebo; + +GazeboRosJointStatePublisher::GazeboRosJointStatePublisher() {} + +// Destructor +GazeboRosJointStatePublisher::~GazeboRosJointStatePublisher() { + rosnode_->shutdown(); +} + +void GazeboRosJointStatePublisher::Load ( physics::ModelPtr _parent, sdf::ElementPtr _sdf ) { + // Store the pointer to the model + this->parent_ = _parent; + this->world_ = _parent->GetWorld(); + + this->robot_namespace_ = parent_->GetName (); + if ( !_sdf->HasElement ( "robotNamespace" ) ) { + ROS_INFO ( "GazeboRosJointStatePublisher Plugin missing , defaults to \"%s\"", + this->robot_namespace_.c_str() ); + } else { + this->robot_namespace_ = _sdf->GetElement ( "robotNamespace" )->Get(); + if ( this->robot_namespace_.empty() ) this->robot_namespace_ = parent_->GetName (); + } + if ( !robot_namespace_.empty() ) this->robot_namespace_ += "/"; + rosnode_ = boost::shared_ptr ( new ros::NodeHandle ( this->robot_namespace_ ) ); + + if ( !_sdf->HasElement ( "jointName" ) ) { + ROS_ASSERT ( "GazeboRosJointStatePublisher Plugin missing jointNames" ); + } else { + sdf::ElementPtr element = _sdf->GetElement ( "jointName" ) ; + std::string joint_names = element->Get(); + boost::erase_all ( joint_names, " " ); + boost::split ( joint_names_, joint_names, boost::is_any_of ( "," ) ); + } + + this->update_rate_ = 100.0; + if ( !_sdf->HasElement ( "updateRate" ) ) { + ROS_WARN ( "GazeboRosJointStatePublisher Plugin (ns = %s) missing , defaults to %f", + this->robot_namespace_.c_str(), this->update_rate_ ); + } else { + this->update_rate_ = _sdf->GetElement ( "updateRate" )->Get(); + } + + // Initialize update rate stuff + if ( this->update_rate_ > 0.0 ) { + this->update_period_ = 1.0 / this->update_rate_; + } else { + this->update_period_ = 0.0; + } + last_update_time_ = this->world_->GetSimTime(); + + for ( unsigned int i = 0; i< joint_names_.size(); i++ ) { + joints_.push_back ( this->parent_->GetJoint ( joint_names_[i] ) ); + ROS_INFO ( "GazeboRosJointStatePublisher is going to publish joint: %s", joint_names_[i].c_str() ); + } + + ROS_INFO ( "Starting GazeboRosJointStatePublisher Plugin (ns = %s)!, parent name: %s", this->robot_namespace_.c_str(), parent_->GetName ().c_str() ); + + tf_prefix_ = tf::getPrefixParam ( *rosnode_ ); + joint_state_publisher_ = rosnode_->advertise ( "joint_states",1000 ); + + last_update_time_ = this->world_->GetSimTime(); + // Listen to the update event. This event is broadcast every + // simulation iteration. + this->updateConnection = event::Events::ConnectWorldUpdateBegin ( + boost::bind ( &GazeboRosJointStatePublisher::OnUpdate, this, _1 ) ); +} + +void GazeboRosJointStatePublisher::OnUpdate ( const common::UpdateInfo & _info ) { + // Apply a small linear velocity to the model. + common::Time current_time = this->world_->GetSimTime(); + double seconds_since_last_update = ( current_time - last_update_time_ ).Double(); + if ( seconds_since_last_update > update_period_ ) { + + publishJointStates(); + + last_update_time_+= common::Time ( update_period_ ); + + } + +} + +void GazeboRosJointStatePublisher::publishJointStates() { + ros::Time current_time = ros::Time::now(); + + joint_state_.header.stamp = current_time; + joint_state_.name.resize ( joints_.size() ); + joint_state_.position.resize ( joints_.size() ); + + for ( int i = 0; i < joints_.size(); i++ ) { + physics::JointPtr joint = joints_[i]; + math::Angle angle = joint->GetAngle ( 0 ); + joint_state_.name[i] = joint->GetName(); + joint_state_.position[i] = angle.Radian () ; + } + joint_state_publisher_.publish ( joint_state_ ); +} + diff --git a/gazebo_plugins/src/gazebo_ros_joint_trajectory.cpp b/gazebo_plugins/src/gazebo_ros_joint_trajectory.cpp index eb7748b00..9da5052b9 100644 --- a/gazebo_plugins/src/gazebo_ros_joint_trajectory.cpp +++ b/gazebo_plugins/src/gazebo_ros_joint_trajectory.cpp @@ -342,8 +342,14 @@ void GazeboRosJointTrajectory::UpdateStates() { // this is not the most efficient way to set things if (this->joints_[i]) + { +#if GAZEBO_MAJOR_VERSION >= 4 + this->joints_[i]->SetPosition(0, +#else this->joints_[i]->SetAngle(0, +#endif this->points_[this->trajectory_index].positions[i]); + } } // set model pose diff --git a/gazebo_plugins/src/gazebo_ros_laser.cpp b/gazebo_plugins/src/gazebo_ros_laser.cpp index a6ee8cfa2..815c456e1 100644 --- a/gazebo_plugins/src/gazebo_ros_laser.cpp +++ b/gazebo_plugins/src/gazebo_ros_laser.cpp @@ -33,8 +33,10 @@ #include #include #include +#include #include +#include #include @@ -76,9 +78,7 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) if (!this->parent_ray_sensor_) gzthrow("GazeboRosLaser controller requires a Ray Sensor as its parent"); - this->robot_namespace_ = ""; - if (this->sdf->HasElement("robotNamespace")) - this->robot_namespace_ = this->sdf->Get("robotNamespace") + "/"; + this->robot_namespace_ = GetRobotNamespace(_parent, _sdf, "Laser"); if (!this->sdf->HasElement("frameName")) { @@ -88,6 +88,7 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) else this->frame_name_ = this->sdf->Get("frameName"); + if (!this->sdf->HasElement("topicName")) { ROS_INFO("Laser plugin missing , defaults to /world"); @@ -106,6 +107,7 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) return; } + ROS_INFO ( "Starting Laser Plugin (ns = %s)!", this->robot_namespace_.c_str() ); // ros callback queue for processing subscription this->deferred_load_thread_ = boost::thread( boost::bind(&GazeboRosLaser::LoadThread, this)); @@ -116,16 +118,23 @@ void GazeboRosLaser::Load(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) // Load the controller void GazeboRosLaser::LoadThread() { - this->rosnode_ = new ros::NodeHandle(this->robot_namespace_); this->gazebo_node_ = gazebo::transport::NodePtr(new gazebo::transport::Node()); this->gazebo_node_->Init(this->world_name_); this->pmq.startServiceThread(); + this->rosnode_ = new ros::NodeHandle(this->robot_namespace_); + + this->tf_prefix_ = tf::getPrefixParam(*this->rosnode_); + if(this->tf_prefix_.empty()) { + this->tf_prefix_ = this->robot_namespace_; + boost::trim_right_if(this->tf_prefix_,boost::is_any_of("/")); + } + ROS_INFO("Laser Plugin (ns = %s) , set to \"%s\"", + this->robot_namespace_.c_str(), this->tf_prefix_.c_str()); + // resolve tf prefix - std::string prefix; - this->rosnode_->getParam(std::string("tf_prefix"), prefix); - this->frame_name_ = tf::resolve(prefix, this->frame_name_); + this->frame_name_ = tf::resolve(this->tf_prefix_, this->frame_name_); if (this->topic_name_ != "") { @@ -151,8 +160,8 @@ void GazeboRosLaser::LaserConnect() { this->laser_connect_count_++; if (this->laser_connect_count_ == 1) - this->laser_scan_sub_ = - this->gazebo_node_->Subscribe(this->parent_ray_sensor_->GetTopic(), + this->laser_scan_sub_ = + this->gazebo_node_->Subscribe(this->parent_ray_sensor_->GetTopic(), &GazeboRosLaser::OnScan, this); } @@ -182,12 +191,12 @@ void GazeboRosLaser::OnScan(ConstLaserScanStampedPtr &_msg) laser_msg.range_min = _msg->scan().range_min(); laser_msg.range_max = _msg->scan().range_max(); laser_msg.ranges.resize(_msg->scan().ranges_size()); - std::copy(_msg->scan().ranges().begin(), - _msg->scan().ranges().end(), + std::copy(_msg->scan().ranges().begin(), + _msg->scan().ranges().end(), laser_msg.ranges.begin()); laser_msg.intensities.resize(_msg->scan().intensities_size()); - std::copy(_msg->scan().intensities().begin(), - _msg->scan().intensities().end(), + std::copy(_msg->scan().intensities().begin(), + _msg->scan().intensities().end(), laser_msg.intensities.begin()); this->pub_queue_->push(laser_msg, this->pub_); } diff --git a/gazebo_plugins/src/gazebo_ros_openni_kinect.cpp b/gazebo_plugins/src/gazebo_ros_openni_kinect.cpp index fbe3b2513..bf8a79697 100644 --- a/gazebo_plugins/src/gazebo_ros_openni_kinect.cpp +++ b/gazebo_plugins/src/gazebo_ros_openni_kinect.cpp @@ -32,8 +32,7 @@ #include #include -// for creating PointCloud2 from pcl point cloud -#include +#include #include @@ -48,6 +47,7 @@ GazeboRosOpenniKinect::GazeboRosOpenniKinect() { this->point_cloud_connect_count_ = 0; this->depth_info_connect_count_ = 0; + this->depth_image_connect_count_ = 0; this->last_depth_image_camera_info_update_time_ = common::Time(0); } @@ -300,10 +300,15 @@ bool GazeboRosOpenniKinect::FillPointCloudHelper( uint32_t rows_arg, uint32_t cols_arg, uint32_t step_arg, void* data_arg) { - pcl::PointCloud point_cloud; + sensor_msgs::PointCloud2Modifier pcd_modifier(point_cloud_msg); + pcd_modifier.setPointCloud2FieldsByString(2, "xyz", "rgb"); + pcd_modifier.resize(rows_arg*cols_arg); + point_cloud_msg.is_dense = true; - point_cloud.points.resize(0); - point_cloud.is_dense = true; + sensor_msgs::PointCloud2Iterator iter_x(point_cloud_msg_, "x"); + sensor_msgs::PointCloud2Iterator iter_y(point_cloud_msg_, "y"); + sensor_msgs::PointCloud2Iterator iter_z(point_cloud_msg_, "z"); + sensor_msgs::PointCloud2Iterator iter_rgb(point_cloud_msg_, "rgb"); float* toCopyFrom = (float*)data_arg; int index = 0; @@ -318,7 +323,7 @@ bool GazeboRosOpenniKinect::FillPointCloudHelper( if (rows_arg>1) pAngle = atan2( (double)j - 0.5*(double)(rows_arg-1), fl); else pAngle = 0.0; - for (uint32_t i=0; i1) yAngle = atan2( (double)i - 0.5*(double)(cols_arg-1), fl); @@ -330,17 +335,16 @@ bool GazeboRosOpenniKinect::FillPointCloudHelper( // hardcoded rotation rpy(-M_PI/2, 0, -M_PI/2) is built-in // to urdf, where the *_optical_frame should have above relative // rotation from the physical camera *_frame - pcl::PointXYZRGB point; - point.x = depth * tan(yAngle); - point.y = depth * tan(pAngle); + *iter_x = depth * tan(yAngle); + *iter_y = depth * tan(pAngle); if(depth > this->point_cloud_cutoff_) { - point.z = depth; + *iter_z = depth; } else //point in the unseeable range { - point.x = point.y = point.z = std::numeric_limits::quiet_NaN (); - point_cloud.is_dense = false; + *iter_x = *iter_y = *iter_z = std::numeric_limits::quiet_NaN (); + point_cloud_msg.is_dense = false; } // put image color data for each point @@ -348,32 +352,27 @@ bool GazeboRosOpenniKinect::FillPointCloudHelper( if (this->image_msg_.data.size() == rows_arg*cols_arg*3) { // color - point.r = image_src[i*3+j*cols_arg*3+0]; - point.g = image_src[i*3+j*cols_arg*3+1]; - point.b = image_src[i*3+j*cols_arg*3+2]; + iter_rgb[0] = image_src[i*3+j*cols_arg*3+0]; + iter_rgb[1] = image_src[i*3+j*cols_arg*3+1]; + iter_rgb[2] = image_src[i*3+j*cols_arg*3+2]; } else if (this->image_msg_.data.size() == rows_arg*cols_arg) { // mono (or bayer? @todo; fix for bayer) - point.r = image_src[i+j*cols_arg]; - point.g = image_src[i+j*cols_arg]; - point.b = image_src[i+j*cols_arg]; + iter_rgb[0] = image_src[i+j*cols_arg]; + iter_rgb[1] = image_src[i+j*cols_arg]; + iter_rgb[2] = image_src[i+j*cols_arg]; } else { // no image - point.r = 0; - point.g = 0; - point.b = 0; + iter_rgb[0] = 0; + iter_rgb[1] = 0; + iter_rgb[2] = 0; } - - point_cloud.points.push_back(point); } } - point_cloud.header = pcl_conversions::toPCL(point_cloud_msg.header); - - pcl::toROSMsg(point_cloud, point_cloud_msg); return true; } diff --git a/gazebo_plugins/src/gazebo_ros_tricycle_drive.cpp b/gazebo_plugins/src/gazebo_ros_tricycle_drive.cpp new file mode 100644 index 000000000..97c5ebb78 --- /dev/null +++ b/gazebo_plugins/src/gazebo_ros_tricycle_drive.cpp @@ -0,0 +1,404 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2013, Markus Bader + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + +/** + * \file gazebo_ros_tricycle_drive.cpp + * \brief A tricycle drive plugin for gazebo. + * \author Markus Bader + * \date 22th of June 2014 + */ + + +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace gazebo +{ + +enum { + RIGHT, + LEFT, +}; + +GazeboRosTricycleDrive::GazeboRosTricycleDrive() {} + +// Destructor +GazeboRosTricycleDrive::~GazeboRosTricycleDrive() {} + +// Load the controller +void GazeboRosTricycleDrive::Load ( physics::ModelPtr _parent, sdf::ElementPtr _sdf ) +{ + parent = _parent; + gazebo_ros_ = GazeboRosPtr ( new GazeboRos ( _parent, _sdf, "TricycleDrive" ) ); + // Make sure the ROS node for Gazebo has already been initialized + gazebo_ros_->isInitialized(); + + gazebo_ros_->getParameter ( diameter_actuated_wheel_, "actuatedWheelDiameter", 0.15 ); + gazebo_ros_->getParameter ( diameter_encoder_wheel_, "encoderWheelDiameter", 0.15 ); + gazebo_ros_->getParameter ( wheel_torque_, "wheelTorque", 5.0 ); + gazebo_ros_->getParameter ( command_topic_, "commandTopic", "cmd_vel" ); + gazebo_ros_->getParameter ( odometry_topic_, "odometryTopic", "odom" ); + gazebo_ros_->getParameter ( odometry_frame_, "odometryFrame", "odom" ); + gazebo_ros_->getParameter ( robot_base_frame_, "robotBaseFrame", "base_link" ); + + gazebo_ros_->getParameter ( update_rate_, "updateRate", 100.0 ); + gazebo_ros_->getParameter ( wheel_acceleration_, "wheelAcceleration", 0 ); + gazebo_ros_->getParameter ( wheel_deceleration_, "wheelDeceleration", wheel_acceleration_ ); + gazebo_ros_->getParameter ( wheel_speed_tolerance_, "wheelSpeedTolerance", 0.01 ); + gazebo_ros_->getParameter ( steering_speed_, "steeringSpeed", 0 ); + gazebo_ros_->getParameter ( steering_angle_tolerance_, "steeringAngleTolerance", 0.01 ); + gazebo_ros_->getParameter ( separation_encoder_wheel_, "encoderWheelSeparation", 0.5 ); + + gazebo_ros_->getParameterBoolean ( publishWheelTF_, "publishWheelTF", false ); + gazebo_ros_->getParameterBoolean ( publishWheelJointState_, "publishWheelJointState", false ); + + gazebo_ros_->getParameterBoolean ( publishWheelJointState_, "publishWheelJointState", false ); + + joint_steering_ = gazebo_ros_->getJoint ( parent, "steeringJoint", "front_steering_joint" ); + joint_wheel_actuated_ = gazebo_ros_->getJoint ( parent, "actuatedWheelJoint", "front_wheel_joint" ); + joint_wheel_encoder_left_ = gazebo_ros_->getJoint ( parent, "encoderWheelLeftJoint", "left_wheel_joint" ); + joint_wheel_encoder_right_ = gazebo_ros_->getJoint ( parent, "encoderWheelRightJoint", "right_wheel_joint" ); + + std::map odomOptions; + odomOptions["encoder"] = ENCODER; + odomOptions["world"] = WORLD; + gazebo_ros_->getParameter ( odom_source_, "odometrySource", odomOptions, WORLD ); + + joint_wheel_actuated_->SetMaxForce ( 0, wheel_torque_ ); + joint_steering_->SetMaxForce ( 0, wheel_torque_ ); + + + // Initialize update rate stuff + if ( this->update_rate_ > 0.0 ) this->update_period_ = 1.0 / this->update_rate_; + else this->update_period_ = 0.0; + last_actuator_update_ = parent->GetWorld()->GetSimTime(); + + // Initialize velocity stuff + alive_ = true; + + if ( this->publishWheelJointState_ ) { + joint_state_publisher_ = gazebo_ros_->node()->advertise ( "joint_states", 1000 ); + ROS_INFO ( "%s: Advertise joint_states!", gazebo_ros_->info() ); + } + + transform_broadcaster_ = boost::shared_ptr ( new tf::TransformBroadcaster() ); + + // ROS: Subscribe to the velocity command topic (usually "cmd_vel") + ROS_INFO ( "%s: Try to subscribe to %s!", gazebo_ros_->info(), command_topic_.c_str() ); + + ros::SubscribeOptions so = + ros::SubscribeOptions::create ( command_topic_, 1, + boost::bind ( &GazeboRosTricycleDrive::cmdVelCallback, this, _1 ), + ros::VoidPtr(), &queue_ ); + + cmd_vel_subscriber_ = gazebo_ros_->node()->subscribe ( so ); + ROS_INFO ( "%s: Subscribe to %s!", gazebo_ros_->info(), command_topic_.c_str() ); + + odometry_publisher_ = gazebo_ros_->node()->advertise ( odometry_topic_, 1 ); + ROS_INFO ( "%s: Advertise odom on %s !", gazebo_ros_->info(), odometry_topic_.c_str() ); + + // start custom queue for diff drive + this->callback_queue_thread_ = boost::thread ( boost::bind ( &GazeboRosTricycleDrive::QueueThread, this ) ); + + // listen to the update event (broadcast every simulation iteration) + this->update_connection_ = event::Events::ConnectWorldUpdateBegin ( boost::bind ( &GazeboRosTricycleDrive::UpdateChild, this ) ); + +} + +void GazeboRosTricycleDrive::publishWheelJointState() +{ + std::vector joints; + joints.push_back ( joint_steering_ ); + joints.push_back ( joint_wheel_actuated_ ); + joints.push_back ( joint_wheel_encoder_left_ ); + joints.push_back ( joint_wheel_encoder_right_ ); + + ros::Time current_time = ros::Time::now(); + joint_state_.header.stamp = current_time; + joint_state_.name.resize ( joints.size() ); + joint_state_.position.resize ( joints.size() ); + joint_state_.velocity.resize ( joints.size() ); + joint_state_.effort.resize ( joints.size() ); + for ( std::size_t i = 0; i < joints.size(); i++ ) { + joint_state_.name[i] = joints[i]->GetName(); + joint_state_.position[i] = joints[i]->GetAngle ( 0 ).Radian(); + joint_state_.velocity[i] = joints[i]->GetVelocity ( 0 ); + joint_state_.effort[i] = joints[i]->GetForce ( 0 ); + } + joint_state_publisher_.publish ( joint_state_ ); +} + +void GazeboRosTricycleDrive::publishWheelTF() +{ + ros::Time current_time = ros::Time::now(); + std::vector joints; + joints.push_back ( joint_steering_ ); + joints.push_back ( joint_wheel_actuated_ ); + joints.push_back ( joint_wheel_encoder_left_ ); + joints.push_back ( joint_wheel_encoder_right_ ); + for ( std::size_t i = 0; i < joints.size(); i++ ) { + std::string frame = gazebo_ros_->resolveTF ( joints[i]->GetName() ); + std::string parent_frame = gazebo_ros_->resolveTF ( joints[i]->GetParent()->GetName() ); + + math::Pose pose = joints[i]->GetChild()->GetRelativePose(); + + tf::Quaternion qt ( pose.rot.x, pose.rot.y, pose.rot.z, pose.rot.w ); + tf::Vector3 vt ( pose.pos.x, pose.pos.y, pose.pos.z ); + + tf::Transform transform ( qt, vt ); + transform_broadcaster_->sendTransform ( tf::StampedTransform ( transform, current_time, parent_frame, frame ) ); + } + +} +// Update the controller +void GazeboRosTricycleDrive::UpdateChild() +{ + if ( odom_source_ == ENCODER ) UpdateOdometryEncoder(); + common::Time current_time = parent->GetWorld()->GetSimTime(); + double seconds_since_last_update = ( current_time - last_actuator_update_ ).Double(); + if ( seconds_since_last_update > update_period_ ) { + + publishOdometry ( seconds_since_last_update ); + if ( publishWheelTF_ ) publishWheelTF(); + if ( publishWheelJointState_ ) publishWheelJointState(); + + double target_wheel_roation_speed = cmd_.speed / ( diameter_actuated_wheel_ / 2.0 ); + double target_steering_angle = cmd_.angle; + + motorController ( target_wheel_roation_speed, target_steering_angle, seconds_since_last_update ); + + //ROS_INFO("v = %f, w = %f !", target_wheel_roation_speed, target_steering_angle); + + last_actuator_update_ += common::Time ( update_period_ ); + } +} + + +void GazeboRosTricycleDrive::motorController ( double target_speed, double target_angle, double dt ) +{ + double applied_speed = target_speed; + double applied_angle = target_angle; + double applied_steering_speed = 0; + + double current_speed = joint_wheel_actuated_->GetVelocity ( 0 ); + if ( wheel_acceleration_ > 0 ) { + double diff_speed = current_speed - target_speed; + if ( fabs ( diff_speed ) < wheel_speed_tolerance_ ) { + applied_speed = target_speed; + } else if ( diff_speed < target_speed ) { + applied_speed = current_speed + wheel_acceleration_ * dt; + } else { + applied_speed = current_speed - wheel_deceleration_ * dt; + } + } + joint_wheel_actuated_->SetVelocity ( 0, applied_speed ); + + double current_angle = joint_steering_->GetAngle ( 0 ).Radian(); + if(target_angle > +M_PI / 2.0) target_angle = +M_PI / 2.0; + if(target_angle < -M_PI / 2.0) target_angle = -M_PI / 2.0; + if ( steering_speed_ > 0 ) { + double diff_angle = current_angle - target_angle; + if ( fabs ( diff_angle ) < steering_angle_tolerance_ ) { + applied_steering_speed = 0; + } else if ( diff_angle < target_speed ) { + applied_steering_speed = steering_speed_; + } else { + applied_steering_speed = -steering_speed_; + } + joint_steering_->SetVelocity ( 0, applied_steering_speed ); + }else { +#if GAZEBO_MAJOR_VERSION >= 4 + joint_steering_->SetPosition ( 0, applied_angle ); +#else + joint_steering_->SetAngle ( 0, math::Angle ( applied_angle ) ); +#endif + } + //ROS_INFO ( "target: [%3.2f, %3.2f], current: [%3.2f, %3.2f], applied: [%3.2f, %3.2f/%3.2f] !", + // target_speed, target_angle, current_speed, current_angle, applied_speed, applied_angle, applied_steering_speed ); + +} + +// Finalize the controller +void GazeboRosTricycleDrive::FiniChild() +{ + alive_ = false; + queue_.clear(); + queue_.disable(); + gazebo_ros_->node()->shutdown(); + callback_queue_thread_.join(); +} + +void GazeboRosTricycleDrive::cmdVelCallback ( const geometry_msgs::Twist::ConstPtr& cmd_msg ) +{ + boost::mutex::scoped_lock scoped_lock ( lock ); + cmd_.speed = cmd_msg->linear.x; + cmd_.angle = cmd_msg->angular.z; +} + +void GazeboRosTricycleDrive::QueueThread() +{ + static const double timeout = 0.01; + + while ( alive_ && gazebo_ros_->node()->ok() ) { + queue_.callAvailable ( ros::WallDuration ( timeout ) ); + } +} + +void GazeboRosTricycleDrive::UpdateOdometryEncoder() +{ + double vl = joint_wheel_encoder_left_->GetVelocity ( 0 ); + double vr = joint_wheel_encoder_right_->GetVelocity ( 0 ); + common::Time current_time = parent->GetWorld()->GetSimTime(); + double seconds_since_last_update = ( current_time - last_odom_update_ ).Double(); + last_odom_update_ = current_time; + + double b = separation_encoder_wheel_; + + // Book: Sigwart 2011 Autonompus Mobile Robots page:337 + double sl = vl * ( diameter_encoder_wheel_ / 2.0 ) * seconds_since_last_update; + double sr = vr * ( diameter_encoder_wheel_ / 2.0 ) * seconds_since_last_update; + double theta = ( sl - sr ) /b; + + + double dx = ( sl + sr ) /2.0 * cos ( pose_encoder_.theta + ( sl - sr ) / ( 2.0*b ) ); + double dy = ( sl + sr ) /2.0 * sin ( pose_encoder_.theta + ( sl - sr ) / ( 2.0*b ) ); + double dtheta = ( sl - sr ) /b; + + pose_encoder_.x += dx; + pose_encoder_.y += dy; + pose_encoder_.theta += dtheta; + + double w = dtheta/seconds_since_last_update; + double v = sqrt ( dx*dx+dy*dy ) /seconds_since_last_update; + + tf::Quaternion qt; + tf::Vector3 vt; + qt.setRPY ( 0,0,pose_encoder_.theta ); + vt = tf::Vector3 ( pose_encoder_.x, pose_encoder_.y, 0 ); + + odom_.pose.pose.position.x = vt.x(); + odom_.pose.pose.position.y = vt.y(); + odom_.pose.pose.position.z = vt.z(); + + odom_.pose.pose.orientation.x = qt.x(); + odom_.pose.pose.orientation.y = qt.y(); + odom_.pose.pose.orientation.z = qt.z(); + odom_.pose.pose.orientation.w = qt.w(); + + odom_.twist.twist.angular.z = w; + odom_.twist.twist.linear.x = dx/seconds_since_last_update; + odom_.twist.twist.linear.y = dy/seconds_since_last_update; +} + +void GazeboRosTricycleDrive::publishOdometry ( double step_time ) +{ + + ros::Time current_time = ros::Time::now(); + std::string odom_frame = gazebo_ros_->resolveTF ( odometry_frame_ ); + std::string base_footprint_frame = gazebo_ros_->resolveTF ( robot_base_frame_ ); + + tf::Quaternion qt; + tf::Vector3 vt; + + if ( odom_source_ == ENCODER ) { + // getting data form encoder integration + qt = tf::Quaternion ( odom_.pose.pose.orientation.x, odom_.pose.pose.orientation.y, odom_.pose.pose.orientation.z, odom_.pose.pose.orientation.w ); + vt = tf::Vector3 ( odom_.pose.pose.position.x, odom_.pose.pose.position.y, odom_.pose.pose.position.z ); + + } + if ( odom_source_ == WORLD ) { + // getting data form gazebo world + math::Pose pose = parent->GetWorldPose(); + qt = tf::Quaternion ( pose.rot.x, pose.rot.y, pose.rot.z, pose.rot.w ); + vt = tf::Vector3 ( pose.pos.x, pose.pos.y, pose.pos.z ); + + odom_.pose.pose.position.x = vt.x(); + odom_.pose.pose.position.y = vt.y(); + odom_.pose.pose.position.z = vt.z(); + + odom_.pose.pose.orientation.x = qt.x(); + odom_.pose.pose.orientation.y = qt.y(); + odom_.pose.pose.orientation.z = qt.z(); + odom_.pose.pose.orientation.w = qt.w(); + + // get velocity in /odom frame + math::Vector3 linear; + linear = parent->GetWorldLinearVel(); + odom_.twist.twist.angular.z = parent->GetWorldAngularVel().z; + + // convert velocity to child_frame_id (aka base_footprint) + float yaw = pose.rot.GetYaw(); + odom_.twist.twist.linear.x = cosf ( yaw ) * linear.x + sinf ( yaw ) * linear.y; + odom_.twist.twist.linear.y = cosf ( yaw ) * linear.y - sinf ( yaw ) * linear.x; + } + + tf::Transform base_footprint_to_odom ( qt, vt ); + transform_broadcaster_->sendTransform ( + tf::StampedTransform ( base_footprint_to_odom, current_time, + odom_frame, base_footprint_frame ) ); + + + // set covariance + odom_.pose.covariance[0] = 0.00001; + odom_.pose.covariance[7] = 0.00001; + odom_.pose.covariance[14] = 1000000000000.0; + odom_.pose.covariance[21] = 1000000000000.0; + odom_.pose.covariance[28] = 1000000000000.0; + odom_.pose.covariance[35] = 0.001; + + + // set header + odom_.header.stamp = current_time; + odom_.header.frame_id = odom_frame; + odom_.child_frame_id = base_footprint_frame; + + odometry_publisher_.publish ( odom_ ); +} + +GZ_REGISTER_MODEL_PLUGIN ( GazeboRosTricycleDrive ) +} + diff --git a/gazebo_plugins/src/gazebo_ros_utils.cpp b/gazebo_plugins/src/gazebo_ros_utils.cpp new file mode 100644 index 000000000..e98ee192c --- /dev/null +++ b/gazebo_plugins/src/gazebo_ros_utils.cpp @@ -0,0 +1,155 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2013, Markus Bader + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + + +#include + +#include +#include + +using namespace gazebo; + +const char* GazeboRos::info() const { + return info_text.c_str(); +} +boost::shared_ptr& GazeboRos ::node() { + return rosnode_; +} +const boost::shared_ptr& GazeboRos ::node() const { + return rosnode_; +} + +std::string GazeboRos ::resolveTF(const std::string &name) { + return tf::resolve(tf_prefix_, name); +} +void GazeboRos ::readCommonParameter() { + + ROS_INFO("Starting plugin %s!", info()); + + std::string debugLevel; + getParameter(debugLevel, "rosDebugLevel", "na"); + if(boost::iequals(debugLevel, std::string("Debug"))) { + if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug) ) { + ros::console::notifyLoggerLevelsChanged(); + } + } else if(boost::iequals(debugLevel, std::string("Info"))) { + if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info) ) { + ros::console::notifyLoggerLevelsChanged(); + } + } else if(boost::iequals(debugLevel, std::string("Warn"))) { + if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Warn) ) { + ros::console::notifyLoggerLevelsChanged(); + } + } else if(boost::iequals(debugLevel, std::string("Error"))) { + if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Error) ) { + ros::console::notifyLoggerLevelsChanged(); + } + } else if(boost::iequals(debugLevel, std::string("Fatal"))) { + if( ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Fatal) ) { + ros::console::notifyLoggerLevelsChanged(); + } + } + if (sdf_->HasElement("rosDebugLevel")) { + ROS_INFO("%s: = %s", info(), debugLevel.c_str()); + } + + + tf_prefix_ = tf::getPrefixParam(*rosnode_); + if(tf_prefix_.empty()) + { + tf_prefix_ = namespace_; + boost::trim_right_if(tf_prefix_,boost::is_any_of("/")); + } + ROS_INFO("%s: = %s", info(), tf_prefix_.c_str()); +} + + +void GazeboRos ::getParameterBoolean(bool &_value, const char *_tag_name, const bool &_default) { + _value = _default; + if (!sdf_->HasElement(_tag_name)) { + ROS_WARN("%s: missing <%s> default is %s", + info(), _tag_name, (_default?"ture":"false")); + } else { + getParameterBoolean(_value, _tag_name); + } + +} +void GazeboRos ::getParameterBoolean(bool &_value, const char *_tag_name) { + + if (sdf_->HasElement(_tag_name)) { + std::string value = sdf_->GetElement(_tag_name)->Get(); + if(boost::iequals(value, std::string("true"))) + { + _value = true; + } + else if(boost::iequals(value, std::string("false"))) + { + _value = false; + } + else + { + ROS_WARN("%s: <%s> must be either true or false", + info(), _tag_name); + } + } + ROS_DEBUG("%s: <%s> = %s", + info(), _tag_name, (_value?"ture":"false")); + +} + +physics::JointPtr GazeboRos::getJoint(physics::ModelPtr &_parent, const char *_tag_name, const std::string &_joint_default_name) { + std::string joint_name; + getParameter(joint_name, _tag_name, _joint_default_name); + physics::JointPtr joint = _parent->GetJoint(joint_name); + if (!joint) + { + char error[200]; + snprintf(error, 200, + "%s: couldn't get wheel hinge joint named %s", + info() , joint_name.c_str()); + gzthrow(error); + } + return joint; +} + +void GazeboRos::isInitialized() { + if (!ros::isInitialized()) + { + ROS_FATAL_STREAM(info() << "A ROS node for Gazebo has not been initialized, unable to load plugin. " + << "Load the Gazebo system plugin 'libgazebo_ros_api_plugin.so' in the gazebo_ros package)"); + return; + } +} + + + diff --git a/gazebo_plugins/src/gazebo_ros_video.cpp b/gazebo_plugins/src/gazebo_ros_video.cpp index 43de193a6..75d534a8f 100644 --- a/gazebo_plugins/src/gazebo_ros_video.cpp +++ b/gazebo_plugins/src/gazebo_ros_video.cpp @@ -74,7 +74,7 @@ namespace gazebo mo.convertToMesh(name + "__VideoMesh__"); Ogre::MovableObject *obj = (Ogre::MovableObject*) - this->sceneNode->getCreator()->createEntity( + this->GetSceneNode()->getCreator()->createEntity( name + "__VideoEntity__", name + "__VideoMesh__"); obj->setCastShadows(false); diff --git a/gazebo_plugins/test/multi_robot_scenario/launch/multi_robot_scenario.launch b/gazebo_plugins/test/multi_robot_scenario/launch/multi_robot_scenario.launch new file mode 100644 index 000000000..ddc9f79d4 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/launch/multi_robot_scenario.launch @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.gazebo.launch b/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.gazebo.launch new file mode 100644 index 000000000..35dd47a15 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.gazebo.launch @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.rviz b/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.rviz new file mode 100644 index 000000000..4300d22df --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.rviz @@ -0,0 +1,482 @@ +Panels: + - Class: rviz/Displays + Help Height: 84 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + - /TF1/Tree1 + - /LaserScan1 + - /LaserScan2 + - /Camera1 + Splitter Ratio: 0.528662 + Tree Height: 344 + - Class: rviz/Selection + Name: Selection + - Class: rviz/Tool Properties + Expanded: + - /2D Pose Estimate1 + - /2D Nav Goal1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.588679 + - Class: rviz/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: LaserScan +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.03 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Class: rviz/RobotModel + Collision Enabled: false + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + battery0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + center_hubcap: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + center_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + chassis: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_camera: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_laser: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_hub: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_hub: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + sonar: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + swivel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + top: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Name: RobotModel + Robot Description: r1/robot_description + TF Prefix: r1 + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + base_link: + Value: true + r1/base_link: + Value: true + r1/battery0: + Value: true + r1/center_hubcap: + Value: true + r1/center_wheel: + Value: true + r1/chassis: + Value: true + r1/front_camera: + Value: true + r1/front_laser: + Value: true + r1/left_hub: + Value: true + r1/left_wheel: + Value: true + r1/odom: + Value: true + r1/right_hub: + Value: true + r1/right_wheel: + Value: true + r1/sonar: + Value: true + r1/swivel: + Value: true + r1/top: + Value: true + r2/base_link: + Value: true + r2/battery0: + Value: true + r2/center_hubcap: + Value: true + r2/center_wheel: + Value: true + r2/chassis: + Value: true + r2/front_camera: + Value: true + r2/front_laser: + Value: true + r2/left_hub: + Value: true + r2/left_wheel: + Value: true + r2/odom: + Value: true + r2/right_hub: + Value: true + r2/right_wheel: + Value: true + r2/sonar: + Value: true + r2/swivel: + Value: true + r2/top: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + base_link: + r1/odom: + r1/base_link: + r1/chassis: + r1/battery0: + {} + r1/front_camera: + {} + r1/front_laser: + {} + r1/left_hub: + r1/left_wheel: + {} + r1/right_hub: + r1/right_wheel: + {} + r1/sonar: + {} + r1/swivel: + r1/center_wheel: + r1/center_hubcap: + {} + r1/top: + {} + r2/odom: + r2/base_link: + r2/chassis: + r2/battery0: + {} + r2/front_camera: + {} + r2/front_laser: + {} + r2/left_hub: + r2/left_wheel: + {} + r2/right_hub: + r2/right_wheel: + {} + r2/sonar: + {} + r2/swivel: + r2/center_wheel: + r2/center_hubcap: + {} + r2/top: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Class: rviz/RobotModel + Collision Enabled: false + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + battery0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + center_hubcap: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + center_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + chassis: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_camera: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_laser: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_hub: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_hub: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + sonar: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + swivel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + top: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Name: RobotModel + Robot Description: r2/robot_description + TF Prefix: r2 + Update Interval: 0 + Value: true + Visual Enabled: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz/LaserScan + Color: 255; 85; 255 + Color Transformer: FlatColor + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 999999 + Min Color: 0; 0; 0 + Min Intensity: -999999 + Name: LaserScan + Position Transformer: XYZ + Queue Size: 10 + Selectable: true + Size (Pixels): 3 + Size (m): 0.03 + Style: Flat Squares + Topic: /r1/front_laser/scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz/LaserScan + Color: 255; 85; 255 + Color Transformer: FlatColor + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 3.49902e-38 + Min Color: 0; 0; 0 + Min Intensity: -999999 + Name: LaserScan + Position Transformer: XYZ + Queue Size: 10 + Selectable: true + Size (Pixels): 3 + Size (m): 0.03 + Style: Flat Squares + Topic: /r2/front_laser/scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Class: rviz/Camera + Enabled: true + Image Rendering: background and overlay + Image Topic: /r1/front_camera/image_raw + Name: Camera + Overlay Alpha: 0.5 + Queue Size: 2 + Transport Hint: raw + Value: true + Visibility: + Grid: true + LaserScan: true + RobotModel: true + TF: true + Value: true + Zoom Factor: 1 + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: base_link + Frame Rate: 30 + Name: root + Tools: + - Class: rviz/Interact + Hide Inactive Objects: true + - Class: rviz/MoveCamera + - Class: rviz/Select + - Class: rviz/FocusCamera + - Class: rviz/Measure + - Class: rviz/SetInitialPose + Topic: /initialpose + - Class: rviz/SetGoal + Topic: /move_base_simple/goal + - Class: rviz/PublishPoint + Single click: true + Topic: /clicked_point + Value: true + Views: + Current: + Class: rviz/Orbit + Distance: 2.00511 + Enable Stereo Rendering: + Stereo Eye Separation: 0.06 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: -0.243573 + Y: -0.560009 + Z: 0.448538 + Name: Current View + Near Clip Distance: 0.01 + Pitch: 0.585398 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.665372 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 846 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd00000004000000000000013c000002affc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006a00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f000001ed000000e900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d0065007200610100000232000000bc0000001600ffffff000000010000010f000002affc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f000002af000000b600fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b00000029a00fffffffb0000000800540069006d0065010000000000000450000000000000000000000259000002af00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1200 + X: 2265 + Y: 97 diff --git a/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.urdf.launch b/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.urdf.launch new file mode 100644 index 000000000..1a2120564 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/launch/pioneer3dx.urdf.launch @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/laser/hokuyo.dae b/gazebo_plugins/test/multi_robot_scenario/meshes/laser/hokuyo.dae new file mode 100644 index 000000000..bc65151bb --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/meshes/laser/hokuyo.dae @@ -0,0 +1,253 @@ + + + + + Blender User + Blender 2.64.0 r51232 + + 2013-03-22T08:19:53 + 2013-03-22T08:19:53 + + Z_UP + + + + + + + 49.13434 + 1.777778 + 0.1 + 100 + + + + + + + + + + 1 1 1 + 1 + 0 + 0.00111109 + + + + + 0.000999987 + 0 + 1 + 1 + 1 + 1 + 1 + 2 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + 2880 + 2 + 30.002 + 1.000799 + 0.04999995 + 29.99998 + 1 + 2 + 0 + 0 + 1 + 1 + 1 + 1 + 8192 + 1 + 1 + 0 + 1 + 1 + 1 + 3 + 0 + 0 + 0 + 0 + 45 + 0 + 1 + 1 + 1 + 3 + 0.15 + 75 + 1 + 1 + 0 + 1 + 1 + 0 + + + + + + + + + + + + 0 0 0 1 + + + 0 0 0 1 + + + 0.020312 0.020312 0.020312 1 + + + 0.25 0.25 0.25 1 + + + 12 + + + 1 + + + + + + 1 + + + + 1 + + + + + + + 0 0 0 1 + + + 0 0 0 1 + + + 0.695112 0.695112 0.695112 1 + + + 0.0625 0.0625 0.0625 1 + + + 0 + + + 1 + + + + + + 1 + + + + 1 + + + + + + + + + + + + + + + -0.02213996 0.005949974 -0.004869997 -0.02213996 0.005949974 0.004869997 -0.02164 0.009949982 -0.004999995 -0.02164 0.009949982 -0.005999982 -0.02164 0.009949982 0.004999995 -0.02164 0.009949982 0.005999982 -0.02149999 0.009949982 -0.006499946 -0.02149999 0.009949982 0.006499946 -0.02113997 0.009949982 -0.006869971 -0.02113997 0.009949982 0.006869971 -0.02063995 0.005949974 0.006999969 -0.02063995 0.009949982 -0.006999969 -0.02063995 0.009949982 0.006999969 -0.01979994 0.009949982 -0.006999969 -0.01979994 0.005949974 -0.006999969 -0.01979994 0.005949974 0.006999969 -0.01979994 0.009949982 0.006999969 -0.01838999 0.005949974 0.01014 -0.02063995 0.005949974 -0.006999969 -0.02113997 0.005949974 0.006869971 -0.02113997 0.005949974 -0.006869971 -0.02149999 0.005949974 0.006499946 -0.02149999 0.005949974 -0.006499946 -0.02164 0.005949974 0.005999982 -0.02164 0.005949974 0.004999995 -0.02164 0.005949974 -0.004999995 -0.02164 0.005949974 -0.005999982 -0.01920998 0.01990997 0.004999995 -0.01920998 0.01990997 -0.004999995 -0.005279958 0.02695 -0.01798999 -0.009719967 0.02695 -0.01595997 -0.01014 0.02695 -0.01576995 -0.01365 0.02695 -0.01273 -0.01416999 0.02695 -0.01227998 -0.01655995 0.02695 -0.008569955 -0.01705998 0.02695 -0.007789969 -0.01822996 0.02695 -0.003779947 -0.01855999 0.02695 -0.00266999 -0.01855999 0.02695 0.00127995 -0.01855999 0.02695 0.00266999 -0.01750999 0.02695 0.006229996 -0.01705998 0.02695 0.007789969 -0.01516997 0.02695 0.01071995 -0.01416999 0.02695 0.01227998 -0.01170998 0.02695 0.01440995 -0.01014 0.02695 0.01576995 -0.007389962 0.02695 0.01703 -0.005279958 0.02695 0.01798999 -0.002529978 0.02695 0.01838999 0 0.02695 0.01874995 0.002529978 0.02695 0.01838999 0.005279958 0.02695 0.01798999 0.007389962 0.02695 0.01703 0.01014 0.02695 0.01576995 0.01170998 0.02695 0.01440995 0.01416999 0.02695 0.01227998 0.01516997 0.02695 0.01071995 0.01705998 0.02695 0.007789969 0.01750999 0.02695 0.006229996 0.01855999 0.02695 0.00266999 0.01855999 0.02695 0.00127995 0.01855999 0.02695 -0.00266999 0.01822996 0.02695 -0.003779947 0.01705998 0.02695 -0.007789969 0.01655995 0.02695 -0.008569955 0.01416999 0.02695 -0.01227998 0.01365 0.02695 -0.01273 0.01014 0.02695 -0.01576995 0.009719967 0.02695 -0.01595997 0.005279958 0.02695 -0.01798999 0.005049943 0.02695 -0.01801997 -0.005049943 0.02695 -0.01801997 0 0.02695 -0.01874995 -0.01885998 0.02594995 0.001289963 -0.01850998 0.02594995 -0.003849983 -0.02039998 0.009949982 -0.004999995 -0.02039998 0.009949982 0.004999995 -0.01848 0.02594995 0.003999948 -0.01836997 0.02572995 0.004629969 -0.01840996 0.02588999 0.004329979 -0.01838999 0.02579998 0.004489958 -0.01835 0.02544999 0.004859983 -0.01838999 0.02494996 0.004999995 -0.01835995 0.02517998 0.004969954 -0.02164 0.02494996 0.004999995 -0.02164 0.02544999 0.004869997 -0.02188998 0.02537995 0.004869997 -0.02206999 0.02519994 0.004869997 -0.02213996 0.02494996 0.004869997 -0.02164 0.02581995 0.004499971 -0.02206999 0.02569997 0.004499971 -0.02238994 0.02537995 0.004499971 -0.02249997 0.02494996 0.004499971 -0.02164 0.02594995 0.003999948 -0.02213996 0.02581995 0.003999948 -0.02263998 0.02494996 0.003999948 -0.02249997 0.02544999 0.003999948 -0.02213996 0.02581995 -0.003999948 -0.02249997 0.02544999 -0.003999948 -0.02263998 0.02494996 -0.003999948 -0.02206999 0.02569997 -0.004499971 -0.02188998 0.02537995 -0.004869997 -0.02238994 0.02537995 -0.004499971 -0.02249997 0.02494996 -0.004499971 -0.02206999 0.02519994 -0.004869997 -0.02213996 0.02494996 -0.004869997 -0.01838999 0.02494996 -0.004999995 -0.02164 0.02494996 -0.004999995 -0.01835 0.02555996 -0.004789948 -0.01835995 0.02526998 -0.004949986 -0.01835 0.02543997 -0.00484997 -0.01836997 0.02577996 -0.004559993 -0.02164 0.02544999 -0.004869997 -0.02164 0.02581995 -0.004499971 -0.01848 0.02594995 -0.003999948 -0.02164 0.02594995 -0.003999948 -0.01841998 0.02590996 -0.004269957 -0.02001994 0.01871997 -0.004999995 -0.01986998 0.01879996 -0.004999995 -0.02025997 0.01844996 -0.004999995 -0.02039998 0.01794999 -0.004999995 -0.02037996 0.01813995 -0.004999995 -0.02039998 0.01794999 0.004999995 -0.02033996 0.01826995 0.004999995 -0.01993995 0.01877999 0.004999995 -0.01936 0.01894998 0.004999995 -0.01962 0.01892 0.004999995 -0.01879996 0.01894998 0.006679952 -0.01845997 0.01894998 0.007699966 -0.01936 0.01894998 -0.004999995 -0.01971 0.01888996 -0.004999995 -0.01845997 0.01894998 -0.007699966 -0.01668 0.01894998 -0.01102995 -0.01141995 0.01894998 -0.01641994 -7.8e-4 0.01894998 -0.01997995 0 0.01894998 -0.01993995 0.002989947 0.01894998 -0.01976996 0.01315999 0.01894998 -0.01505994 0.01454997 0.01894998 -0.01358997 0.01576 0.01894998 -0.01230996 0.01990997 0.01894998 0.001369953 0.01990997 0.01894998 -0.001889944 0.01919996 0.01894998 0.005609989 0.01779997 0.01894998 0.009119987 0.00792998 0.01894998 0.01826995 0.01008999 0.01894998 0.01726996 -0.007959961 0.01894998 0.01832997 -0.004529953 0.01894998 0.01947999 -0.01668 0.01894998 0.01102995 -0.01892 0.01881998 0.007889986 -0.02024996 0.01843994 0.004999995 -0.02017998 0.01855999 0.004999995 -0.00812 0.01894998 -0.01827996 0.006659984 0.01894998 -0.01885998 0.01576 0.01894998 0.01230996 0.002989947 0.01894998 0.01976996 0.002719998 0.01894998 0.01978999 -0.01141995 0.01894998 0.01641994 -0.01256996 0.01894998 0.01545 -0.01767998 0.01894998 -0.009159982 -0.01892 0.01881998 -0.007889986 -0.01937997 0.01794999 -0.008079946 -0.01830995 0.01794999 -0.01009994 -0.01925998 0.01844996 -0.008029997 -0.01458996 0.01894998 -0.01362997 -0.01709997 0.01881998 -0.01130998 -0.01750999 0.01794999 -0.01159 -0.0151 0.01794999 -0.01457995 -0.01739996 0.01844996 -0.01150995 -0.01431 0.01894998 -0.01397997 -0.01466 0.01881998 -0.01432996 -0.01501995 0.01794999 -0.01467996 -0.01491999 0.01844996 -0.01457995 -0.01034998 0.01894998 -0.01701998 -0.008319973 0.01881998 -0.01872998 -0.01169997 0.01881998 -0.01682996 -0.01198995 0.01794999 -0.01723998 -0.01190996 0.01844996 -0.01712995 -8.2e-4 0.01794999 -0.02098 -0.004759967 0.01794999 -0.02044999 -0.004729986 0.01844996 -0.02031999 -0.005689978 0.01794999 -0.02013999 -0.01073998 0.01794999 -0.01794999 -0.008529961 0.01794999 -0.01918995 -0.008469998 0.01844996 -0.01906996 -2.5e-4 0.01794999 -0.02094995 -8.2e-4 0.01844996 -0.02085 -8.1e-4 0.01881998 -0.02047997 -0.005379974 0.01894998 -0.01919996 -0.004649996 0.01881998 -0.01996999 -0.004529953 0.01894998 -0.01947999 0.005379974 0.01894998 -0.01917999 0.006829977 0.01881998 -0.01932996 0.003069996 0.01881998 -0.02026998 0.003139972 0.01794999 -0.02075999 0.003119945 0.01844996 -0.02063 0.01381999 0.01794999 -0.01580995 0.01059997 0.01794999 -0.01813 0.01052999 0.01844996 -0.01800996 0.01034998 0.01794999 -0.01824998 0.005209982 0.01794999 -0.02024996 0.006989955 0.01794999 -0.01979994 0.006949961 0.01844996 -0.01966995 0.01469999 0.01794999 -0.01488 0.01372998 0.01844996 -0.01570999 0.01348996 0.01881998 -0.01542997 0.01008999 0.01894998 -0.01726996 0.01034998 0.01881998 -0.01769995 0.01036995 0.01894998 -0.01705998 0.01774996 0.01894998 -0.009199976 0.01823997 0.01881998 -0.009349942 0.01615995 0.01881998 -0.01261997 0.01655 0.01794999 -0.01291996 0.01644998 0.01844996 -0.01283997 0.02090996 0.01794999 -0.00198996 0.02023994 0.01794999 -0.005469977 0.02002996 0.01844996 -0.005849957 0.02015995 0.01794999 -0.005889952 0.01807999 0.01794999 -0.01052999 0.01868999 0.01794999 -0.009579956 0.01857 0.01844996 -0.009519994 0.02090996 0.01794999 0 0.02076995 0.01844996 -0.001969993 0.02041 0.01881998 -0.001939952 0.01919996 0.01894998 -0.005609989 0.01967996 0.01881998 -0.00575 0.01949995 0.01894998 -0.004049956 0.01990997 0.01894998 0.001889944 0.02041 0.01881998 0.001939952 0.02090996 0.01794999 0.00198996 0.02023994 0.01794999 0.005469977 0.02076995 0.01844996 0.001969993 0.01876997 0.01894998 0.006669998 0.01967996 0.01881998 0.00575 0.02015995 0.01794999 0.005889952 0.02002996 0.01844996 0.005849957 0.01627999 0.01894998 0.0115 0.01615995 0.01881998 0.01261997 0.01823997 0.01881998 0.009349942 0.01868999 0.01794999 0.009579956 0.01857 0.01844996 0.009519994 0.01059997 0.01794999 0.01813 0.01381999 0.01794999 0.01580995 0.01372998 0.01844996 0.01570999 0.01469999 0.01794999 0.01488 0.01807999 0.01794999 0.01052999 0.01655 0.01794999 0.01291996 0.01644998 0.01844996 0.01283997 0.01034998 0.01794999 0.01824998 0.01052999 0.01844996 0.01800996 0.01034998 0.01881998 0.01769995 0.01315999 0.01894998 0.01505994 0.01348996 0.01881998 0.01542997 0.01258999 0.01894998 0.01546996 0.006659984 0.01894998 0.01885998 0.003069996 0.01881998 0.02026998 0.006829977 0.01881998 0.01932996 0.006989955 0.01794999 0.01979994 0.006949961 0.01844996 0.01966995 -0.004759967 0.01794999 0.02044999 -8.2e-4 0.01794999 0.02098 -8.2e-4 0.01844996 0.02085 -2.5e-4 0.01794999 0.02094995 0.005209982 0.01794999 0.02024996 0.003139972 0.01794999 0.02075999 0.003119945 0.01844996 0.02063 -0.005689978 0.01794999 0.02013999 -0.004729986 0.01844996 0.02031999 -0.004649996 0.01881998 0.01996999 -7.8e-4 0.01894998 0.01997995 -8.1e-4 0.01881998 0.02047997 -0.002709984 0.01894998 0.01972997 -0.00812 0.01894998 0.01827996 -0.01169997 0.01881998 0.01682996 -0.008319973 0.01881998 0.01872998 -0.008529961 0.01794999 0.01918995 -0.008469998 0.01844996 0.01906996 -0.01750999 0.01794999 0.01159 -0.0151 0.01794999 0.01457995 -0.01491999 0.01844996 0.01457995 -0.01501995 0.01794999 0.01467996 -0.01073998 0.01794999 0.01794999 -0.01198995 0.01794999 0.01723998 -0.01190996 0.01844996 0.01712995 -0.01937997 0.01794999 0.008079946 -0.01830995 0.01794999 0.01009994 -0.01925998 0.01844996 0.008029997 -0.01739996 0.01844996 0.01150995 -0.01709997 0.01881998 0.01130998 -0.01431 0.01894998 0.01397997 -0.01466 0.01881998 0.01432996 -0.01629996 0.01894998 0.0115 -0.01014 0.03504997 -0.01576995 -0.005279958 0.03504997 0.01798999 0 0.03504997 0.01874995 0.005279958 0.03504997 0.01798999 0.01014 0.03504997 0.01576995 0.01416999 0.03504997 0.01227998 0.01705998 0.03504997 0.007789969 0.01855999 0.03504997 0.00266999 0.01855999 0.03504997 -0.00266999 -0.01014 0.03504997 0.01576995 -0.01416999 0.03504997 0.01227998 -0.01705998 0.03504997 0.007789969 -0.01855999 0.03504997 0.00266999 -0.01855999 0.03504997 -0.00266999 -0.01705998 0.03504997 -0.007789969 -0.01416999 0.03504997 -0.01227998 -0.005279958 0.03504997 -0.01798999 0 0.03504997 -0.01874995 0.005279958 0.03504997 -0.01798999 0.01014 0.03504997 -0.01576995 0.01416999 0.03504997 -0.01227998 0.01705998 0.03504997 -0.007789969 0.001609981 0.03494995 -0.01717996 -0.003309965 0.03504997 -0.01692998 -0.003309965 0.03494995 -0.01692998 0.001759946 0.03494995 -0.01713997 0.001969993 0.03494995 -0.01708996 0.001609981 0.03504997 -0.01717996 0.004629969 0.03494995 -0.01644998 0.006399989 0.03494995 -0.01601999 0.007199943 0.03494995 -0.01555997 0.007989943 0.03494995 -0.0151 0.006399989 0.03504997 -0.01601999 0.009659945 0.03494995 -0.01413995 0.01066994 0.03494995 -0.01354998 0.01066994 0.03504997 -0.01354998 0.01512998 0.03494995 -0.007909953 0.01104998 0.03494995 -0.01314997 0.01406997 0.03504997 -0.009979963 0.01406997 0.03494995 -0.009979963 0.01695996 0.03494995 -0.002209961 0.01631999 0.03494995 -0.005589962 0.01631999 0.03504997 -0.005589962 0.01652997 0.03494995 -0.004479944 -0.007969975 0.03494995 -0.01529997 -0.007969975 0.03504997 -0.01529997 -0.009269952 0.03494995 -0.01454997 -0.01002997 0.03494995 0.01388996 -0.01088994 0.03494995 0.01314997 -0.01299995 0.03494995 0.01133996 -0.01299995 0.03504997 0.01133996 -0.01378995 0.03494995 0.01010996 -0.01567995 0.03494995 0.007189989 -0.01567995 0.03504997 0.007189989 -0.01626998 0.03494995 0.005199968 -0.01706999 0.03494995 0.002459943 -0.01706999 0.03494995 0.002019941 -0.01706999 0.03494995 9.7e-4 -0.01706999 0.03494995 6.9e-4 -0.01706999 0.03504997 0.002459943 -0.01706999 0.03494995 -0.002209961 -0.01706999 0.03494995 -0.002459943 -0.01706999 0.03504997 -0.002459943 -0.01647996 0.03494995 -0.004479944 -0.01567995 0.03494995 -0.007189989 -0.01567995 0.03504997 -0.007189989 -0.01521998 0.03494995 -0.007909953 -0.01299995 0.03504997 -0.01133996 -0.01299995 0.03494995 -0.01133996 -0.01002997 0.03494995 -0.01388996 -0.01088994 0.03494995 -0.01314997 -0.009269952 0.03504997 -0.01454997 -0.009269952 0.03494995 0.01454997 -0.009269952 0.03504997 0.01454997 0.01718997 0.03494995 9.7e-4 0.01699 0.03494995 0.002019941 0.01638996 0.03494995 0.005199968 0.01631999 0.03494995 0.005589962 0.01631999 0.03504997 0.005589962 0.01104998 0.03494995 0.01314997 0.01406997 0.03494995 0.009979963 0.01406997 0.03504997 0.009979963 0.01394999 0.03494995 0.01010996 0.01066994 0.03494995 0.01354998 0.009659945 0.03494995 0.01413995 0.01066994 0.03504997 0.01354998 0.007199943 0.03494995 0.01555997 0.006399989 0.03494995 0.01601999 0.006399989 0.03504997 0.01601999 0.004629969 0.03494995 0.01644998 0.001969993 0.03494995 0.01708996 0.001759946 0.03494995 0.01713997 0.001609981 0.03494995 0.01717996 0.001609981 0.03504997 0.01717996 -0.003309965 0.03494995 0.01692998 -0.007969975 0.03504997 0.01529997 -0.007969975 0.03494995 0.01529997 -0.003309965 0.03504997 0.01692998 0.01722997 0.03504997 7.5e-4 0.01722997 0.03494995 7.5e-4 0.01722997 0.03494995 -7.5e-4 0.01722997 0.03504997 -7.5e-4 -0.02063995 0.005949974 0.006999969 -0.02213996 0.005949974 0.004869997 -0.02213996 0.005949974 -0.004869997 -0.02263998 0.005949974 -0.003999948 -0.02263998 0.005949974 0 -0.02263998 0.005949974 0.003999948 -0.02249997 0.005949974 -0.004499971 -0.02249997 0.005949974 0.004499971 -0.01838999 0.005949974 -0.01014 -0.01510995 0.005949974 -0.01458996 -0.01510995 0.005949974 0.01458996 -0.01077997 0.005949974 -0.01801997 -0.01077997 0.005949974 0.01801997 -0.005709946 0.005949974 -0.02020996 -0.005709946 0.005949974 0.02020996 -2.5e-4 0.005949974 -0.02099996 -2.5e-4 0.005949974 0.02099996 0 0.005949974 -0.02096998 0 0.005949974 0.02096998 0.005239963 0.005949974 -0.02033996 0.005239963 0.005949974 0.02033996 0.01036 0.005949974 -0.01826995 0.01036 0.005949974 0.01826995 0.01475995 0.005949974 -0.01493996 0.01475995 0.005949974 0.01493996 0.01814997 0.005949974 -0.01056998 0.01814997 0.005949974 0.01056998 0.02026998 0.005949974 -0.005479991 0.02099996 0.005949974 0 0.02026998 0.005949974 0.005479991 -0.02499997 -0.03504997 -0.023 -0.02499997 -0.03504997 0.023 -0.02472996 -0.03504997 -0.02399998 -0.02472996 -0.03504997 0.02399998 -0.02399998 -0.03504997 -0.02472996 -0.02399998 -0.03504997 0.02472996 -0.02363997 0.003949999 -0.02164 -0.02363997 0.003949999 0.02164 -0.02363997 0.00544995 -0.02164 -0.02363997 0.00544995 0.02164 -0.02357 0.005699992 -0.02164 -0.02357 0.005699992 0.02164 -0.02338999 0.005879998 -0.02164 -0.02338999 0.005879998 0.02164 -0.02336996 0.003959953 0.02263998 -0.02336996 0.00544995 -0.02263998 -0.02336996 0.00544995 0.02263998 -0.02336996 0.003959953 -0.02263998 -0.02331 0.005699992 -0.02260994 -0.02331 0.005699992 0.02260994 -0.02314996 0.005879998 -0.02250999 -0.02314996 0.005879998 0.02250999 -0.02313995 0.005949974 -0.02164 -0.02313995 0.005949974 0 -0.02313995 0.005949974 0.02164 -0.023 -0.03504997 -0.02499997 -0.023 -0.03504997 0.02499997 -0.02293998 0.005949974 -0.02238994 -0.02293998 0.005949974 0.02238994 0 -0.03504997 0 -0.02263998 0.003959953 0.02336996 -0.02263998 0.003959953 -0.02336996 -0.02263998 0.00544995 -0.02336996 -0.02263998 0.00544995 0.02336996 -0.02260994 0.005699992 -0.02331 -0.02260994 0.005699992 0.02331 -0.02250999 0.005879998 -0.02314996 -0.02250999 0.005879998 0.02314996 0 0.005949974 -0.02313995 -0.02164 0.005949974 -0.02313995 -0.02238994 0.005949974 -0.02293998 -0.02238994 0.005949974 0.02293998 -0.02164 0.003949999 -0.02363997 -0.02164 0.003949999 0.02363997 -0.02164 0.00544995 -0.02363997 -0.02164 0.00544995 0.02363997 -0.02164 0.005699992 -0.02357 -0.02164 0.005699992 0.02357 -0.02164 0.005879998 -0.02338999 -0.02164 0.005879998 0.02338999 -0.02164 0.005949974 0.02313995 -0.005709946 0.005949974 -0.02020996 -0.01077997 0.005949974 -0.01801997 -0.01510995 0.005949974 -0.01458996 -0.01838999 0.005949974 -0.01014 -0.02213996 0.005949974 -0.004869997 0 0.005949974 0.02313995 0.02164 0.003949999 -0.02363997 0.02164 0.003949999 0.02363997 0.02164 0.00544995 -0.02363997 0.02164 0.00544995 0.02363997 0.02164 0.005699992 -0.02357 0.02164 0.005699992 0.02357 0.02164 0.005879998 -0.02338999 0.02164 0.005879998 0.02338999 0.02164 0.005949974 -0.02313995 0.02164 0.005949974 0.02313995 0.02238994 0.005949974 -0.02293998 0.02238994 0.005949974 0.02293998 0.02250999 0.005879998 -0.02314996 0.02250999 0.005879998 0.02314996 0.02260994 0.005699992 -0.02331 0.02260994 0.005699992 0.02331 0.02263998 0.003959953 -0.02336996 0.02263998 0.003959953 0.02336996 0.02263998 0.00544995 -0.02336996 0.02263998 0.00544995 0.02336996 0.02293998 0.005949974 -0.02238994 0.02293998 0.005949974 0.02238994 0.023 -0.03504997 -0.02499997 0.023 -0.03504997 0.02499997 0.02313995 0.005949974 -0.02164 0.02313995 0.005949974 0 0.02313995 0.005949974 0.02164 0.02314996 0.005879998 -0.02250999 0.02314996 0.005879998 0.02250999 0.02331 0.005699992 -0.02260994 0.02331 0.005699992 0.02260994 0.02336996 0.003959953 -0.02263998 0.02336996 0.003959953 0.02263998 0.02336996 0.00544995 -0.02263998 0.02336996 0.00544995 0.02263998 0.02338999 0.005879998 -0.02164 0.02338999 0.005879998 0.02164 0.02357 0.005699992 -0.02164 0.02357 0.005699992 0.02164 0.02363997 0.003949999 -0.02164 0.02363997 0.003949999 0.02164 0.02363997 0.00544995 -0.02164 0.02363997 0.00544995 0.02164 0.02399998 -0.03504997 -0.02472996 0.02399998 -0.03504997 0.02472996 0.02472996 -0.03504997 -0.02399998 0.02472996 -0.03504997 0.02399998 0.02499997 -0.03504997 -0.023 0.02499997 -0.03504997 0.023 0 0.03504997 0 -0.02213996 0.005949974 0.004869997 -0.02063995 0.005949974 0.006999969 -0.01979994 0.005949974 0.006999969 -0.01838999 0.005949974 0.01014 -0.02113997 0.005949974 0.006869971 -0.02149999 0.005949974 0.006499946 -0.02164 0.005949974 0.005999982 -0.02164 0.005949974 0.004999995 -0.02263998 0.005949974 -0.003999948 -0.02263998 0.005949974 0.003999948 -0.02249997 0.005949974 -0.004499971 -0.02249997 0.005949974 0.004499971 -0.01838999 0.005949974 -0.01014 -0.01510995 0.005949974 -0.01458996 -0.01510995 0.005949974 0.01458996 -0.01077997 0.005949974 -0.01801997 -0.01077997 0.005949974 0.01801997 -0.005709946 0.005949974 -0.02020996 -0.005709946 0.005949974 0.02020996 -2.5e-4 0.005949974 -0.02099996 -2.5e-4 0.005949974 0.02099996 0 0.005949974 -0.02096998 0 0.005949974 0.02096998 0.005239963 0.005949974 -0.02033996 0.005239963 0.005949974 0.02033996 0.01036 0.005949974 -0.01826995 0.01036 0.005949974 0.01826995 0.01475995 0.005949974 -0.01493996 0.01475995 0.005949974 0.01493996 0.01814997 0.005949974 -0.01056998 0.01814997 0.005949974 0.01056998 0.02026998 0.005949974 -0.005479991 0.02099996 0.005949974 0 0.02026998 0.005949974 0.005479991 -0.005709946 0.005949974 -0.02020996 -0.01077997 0.005949974 -0.01801997 -0.01510995 0.005949974 -0.01458996 -0.01838999 0.005949974 -0.01014 -0.01979994 0.005949974 0.006999969 -0.01838999 0.005949974 0.01014 -0.02113997 0.005949974 0.006869971 -0.02149999 0.005949974 0.006499946 -0.02164 0.005949974 0.005999982 -0.02164 0.005949974 0.004999995 -0.02263998 0.005949974 -0.003999948 -0.02263998 0.005949974 0.003999948 -0.02249997 0.005949974 -0.004499971 -0.02249997 0.005949974 0.004499971 -0.01838999 0.005949974 -0.01014 -0.01510995 0.005949974 -0.01458996 -0.01510995 0.005949974 0.01458996 -0.01077997 0.005949974 -0.01801997 -0.01077997 0.005949974 0.01801997 -0.005709946 0.005949974 -0.02020996 -0.005709946 0.005949974 0.02020996 -2.5e-4 0.005949974 -0.02099996 -2.5e-4 0.005949974 0.02099996 0 0.005949974 -0.02096998 0 0.005949974 0.02096998 0.005239963 0.005949974 -0.02033996 0.005239963 0.005949974 0.02033996 0.01036 0.005949974 -0.01826995 0.01036 0.005949974 0.01826995 0.01475995 0.005949974 -0.01493996 0.01475995 0.005949974 0.01493996 0.01814997 0.005949974 -0.01056998 0.01814997 0.005949974 0.01056998 0.02026998 0.005949974 -0.005479991 0.02099996 0.005949974 0 0.02026998 0.005949974 0.005479991 -0.005709946 0.005949974 -0.02020996 -0.01077997 0.005949974 -0.01801997 -0.01510995 0.005949974 -0.01458996 -0.01838999 0.005949974 -0.01014 -0.02063995 0.005949974 0.006999969 -0.02213996 0.005949974 0.004869997 -0.02213996 0.005949974 -0.004869997 -0.01979994 0.005949974 0.006999969 -0.01838999 0.005949974 0.01014 -0.02113997 0.005949974 0.006869971 -0.02149999 0.005949974 0.006499946 -0.02164 0.005949974 0.005999982 -0.02164 0.005949974 0.004999995 -0.02263998 0.005949974 -0.003999948 -0.02263998 0.005949974 0.003999948 -0.02249997 0.005949974 -0.004499971 -0.02249997 0.005949974 0.004499971 -0.01838999 0.005949974 -0.01014 -0.01510995 0.005949974 -0.01458996 -0.01510995 0.005949974 0.01458996 -0.01077997 0.005949974 -0.01801997 -0.01077997 0.005949974 0.01801997 -0.005709946 0.005949974 -0.02020996 -0.005709946 0.005949974 0.02020996 -2.5e-4 0.005949974 -0.02099996 -2.5e-4 0.005949974 0.02099996 0 0.005949974 -0.02096998 0 0.005949974 0.02096998 0.005239963 0.005949974 -0.02033996 0.005239963 0.005949974 0.02033996 0.01036 0.005949974 -0.01826995 0.01036 0.005949974 0.01826995 0.01475995 0.005949974 -0.01493996 0.01475995 0.005949974 0.01493996 0.01814997 0.005949974 -0.01056998 0.01814997 0.005949974 0.01056998 0.02026998 0.005949974 -0.005479991 0.02099996 0.005949974 0 0.02026998 0.005949974 0.005479991 -0.005709946 0.005949974 -0.02020996 -0.01077997 0.005949974 -0.01801997 -0.01510995 0.005949974 -0.01458996 -0.01838999 0.005949974 -0.01014 -0.00945729 0.003627836 -0.001710772 0 -0.01554995 0.02431994 0 0.005949974 0 + + + + + + + + + + 0 -1 0 0 -1 0 -0.9492978 0 -0.3143782 -0.9492978 0 0.3143782 -0.7785766 0.001171708 0.6275485 -0.7808654 0.001171231 0.6246982 -0.6209343 -0.001221954 0.7838616 -0.6453004 -0.01542252 0.7637733 -0.3964945 -0.0151537 0.9179121 -0.4893132 0.006718158 0.8720822 -0.4938785 0.006718337 0.8695049 -0.1431924 -0.008457064 0.9896588 -0.316222 0.006060898 0.9486659 -0.3172233 0.0060606 0.9483315 0.2392156 0.007879972 0.9709345 0.119358 -0.01385879 0.9927546 0.0559594 0.00282979 0.9984291 0.1191433 0.00413686 0.9928685 0.05255794 0.004160761 0.9986092 -0.1333157 -0.004680752 0.9910625 0.2450903 0.007883667 0.9694681 0.3747907 -0.01294112 0.9270192 0.4188861 0.001862525 0.9080369 0.4327281 0.001863181 0.9015226 0.6034716 -0.002766609 0.7973797 0.5845207 -0.01302987 0.8112742 0.7900453 -0.01468151 0.6128727 0.7272006 0.007067918 0.6863886 0.7263449 0.007068157 0.6872941 0.9823358 0.002611696 0.1871086 0.9289886 -0.004128932 0.3700852 0.9230861 -0.009820222 0.3844679 0.8414472 0.006709396 0.5402976 0.8421885 0.006709873 0.5391413 0.9819628 0.002612411 0.1890563 0.9911401 -0.01446169 0.1320315 0.9999719 0.007499694 0 0.9999719 0.007499694 0 0.9911401 -0.01446169 -0.1320315 0.9819628 0.002612411 -0.1890563 0.9823358 0.002611696 -0.1871086 0.9231205 -0.004674613 -0.3844823 0.9289375 -0.01127177 -0.3700649 0.7900453 -0.01468151 -0.6128727 0.8421885 0.006709873 -0.5391413 0.8414472 0.006709396 -0.5402976 0.4327281 0.001863181 -0.9015226 0.5845689 -0.002225697 -0.8113411 0.6034404 -0.0105375 -0.7973385 0.7263449 0.007068157 -0.6872941 0.7272006 0.007067918 -0.6863886 0.4188861 0.001862525 -0.9080369 0.3747907 -0.01294112 -0.9270192 0.2450903 0.007883667 -0.9694681 0.2392156 0.007879972 -0.9709345 0.119358 -0.01385879 -0.9927546 0.0559594 0.00282979 -0.9984291 0.1191433 0.00413686 -0.9928685 0.05255794 0.004160761 -0.9986092 -0.1431956 -0.005152344 -0.989681 -0.1333114 -0.009266734 -0.9910309 -0.3964945 -0.0151537 -0.9179121 -0.3172233 0.0060606 -0.9483315 -0.316222 0.006060898 -0.9486659 -0.7808654 0.001171231 -0.6246982 -0.6453768 -8.88654e-4 -0.7638639 -0.6208926 -0.01165908 -0.783809 -0.4938785 0.006718337 -0.8695049 -0.4893132 0.006718158 -0.8720822 -0.7785766 0.001171708 -0.6275485 -0.8049004 -0.01266139 -0.5932749 -0.881016 0.007450222 -0.4730277 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 -0.9471516 0.1680965 0.2732169 -0.407418 0.1514139 -0.9006023 -0.9422059 0.2770094 -0.1884511 -0.9113164 0.1482697 -0.3840813 -0.9315509 0.1626105 -0.3252239 -0.7991091 -0.3146805 -0.5122509 -0.9081746 0.2506373 -0.3352608 -0.9111543 0.1456485 -0.3854666 -0.928664 0.2243673 -0.2953684 -0.925579 0.2859641 -0.2480482 -0.9177774 0.2868903 0.2745518 -0.9178981 0.2856691 0.2754201 -0.9143468 0.1813663 0.3620446 -0.9384292 0.1466302 0.31281 -0.9311535 0.1683419 0.3234411 -0.901751 0.1467134 0.4065961 -0.9103941 0.1680585 0.3780726 -0.912325 0.3225979 0.2521777 -0.9188216 0.2869244 0.2710005 -0.9848498 0.1048805 0.138097 -0.9578264 0.2873474 0 -0.9559739 0.2861407 -0.06509518 -0.9987523 -0.04993659 0 -0.9210147 0.2770513 -0.2738146 -0.4861897 0.1523008 -0.8604789 -0.4091901 0.1777053 -0.8949773 -0.3149025 0.1457877 -0.9378605 -0.1278769 0.1498839 -0.9803991 -0.309273 0.1512408 -0.9388697 -0.141013 0.1688628 -0.9755002 -0.1303948 0.1630746 -0.977959 -0.4837509 0.1474936 -0.8626881 -0.636475 0.163087 -0.7538581 -0.645197 0.1696269 -0.744948 -0.7708169 0.1599442 -0.6166515 -0.6459589 0.159875 -0.746443 -0.7711567 0.1450923 -0.6198915 -0.8274903 0.1763324 -0.533073 -0.8709936 0.1562899 -0.4657721 -0.9149418 0.1555567 -0.3724025 -0.7441748 0.5367867 -0.3975726 -0.9384292 0.1466302 -0.3128098 -0.9364062 0.1603595 0.3121352 -0.8722791 0.1474033 0.4662632 -0.8271023 0.1767897 0.5335236 -0.7664864 0.1686882 0.6197121 -0.8297607 0.1690638 0.5318973 -0.7716946 0.1450895 0.6192225 -0.6450954 0.1696101 0.7450398 -0.6363618 0.1663306 0.7532449 -0.64563 0.1662972 0.7453235 -0.6361207 0.1630551 0.754164 -0.4856274 0.1477051 0.8615968 -0.4099487 0.177209 0.8947284 -0.2937462 0.1736751 0.9399735 -0.4077602 0.1746891 0.8962228 -0.3145152 0.1452308 0.9380769 -0.1418845 0.1683772 0.9754577 -0.1341822 0.1666406 0.976845 -0.1389042 0.1666364 0.9761855 -0.1267469 0.1627997 0.9784843 0.1395421 0.1371724 0.980669 0.05338537 0.1733645 0.9834097 0.07274723 0.1735997 0.9821257 0.1416881 0.1761806 0.9741073 0.2381073 0.1455035 0.9602779 0.4082419 0.1680009 0.8972816 0.4154286 0.1666471 0.8942303 0.4107152 0.1666655 0.8964015 0.4143497 0.165222 0.894995 0.6486326 0.1363442 0.7487897 0.575868 0.1693211 0.7998164 0.575499 0.1693159 0.8000832 0.6442187 0.1772168 0.7440273 0.7189208 0.1454344 0.6797072 0.8300612 0.16697 0.5320899 0.8296917 0.1670521 0.5326398 0.8285282 0.1670665 0.5344434 0.8312138 0.1651425 0.5308593 0.9521918 0.1337416 0.2746708 0.9171259 0.1644181 0.3631072 0.914055 0.1643574 0.3707966 0.9438654 0.1778166 0.2783871 0.9717582 0.1459009 0.1854698 0.9860588 0.1663975 0 0.9860587 0.1663975 0 0.9860587 0.1663975 0 0.9860587 0.1663975 0 0.9500489 0.1327823 -0.2824464 0.9697747 0.1601643 -0.1840775 0.9693279 0.1601721 -0.1864089 0.9447124 0.1775989 -0.2756393 0.830715 0.1654286 -0.5315507 0.8288937 0.166745 -0.533977 0.7189707 0.1454441 -0.6796524 0.6466634 0.1530798 -0.747257 0.717962 0.1537514 -0.6788895 0.6443232 0.1772074 -0.743939 0.5763537 0.1462174 -0.8040131 0.4070715 0.1568021 -0.8998366 0.5925795 0.1567866 -0.7901059 0.4147536 0.1656929 -0.8947209 0.4098841 0.1681987 -0.8964955 0.2399455 0.1457665 -0.9597803 0.1279237 0.1474865 -0.9807565 0.2369926 0.1489789 -0.9600207 0.1408129 0.1768286 -0.9741167 0.05614864 0.1468989 -0.9875566 0.05065917 0.1469421 -0.987847 -0.1424711 -3.79589e-4 -0.9897989 -0.129338 0 -0.9916005 -0.4158082 0 -0.9094523 -0.4154945 -2.07829e-4 -0.9095956 -0.4121701 0 -0.911107 -0.6546844 0 -0.7559022 -0.6546447 -3.01789e-5 -0.7559368 -0.6543759 0 -0.7561693 -0.840663 0 -0.5415588 -0.8408741 2.12565e-4 -0.5412307 -0.8418785 0 -0.5396671 -0.9599732 0 -0.280092 -0.9596633 -5.69179e-4 -0.2811512 -0.9585365 0 -0.2849697 -1 0 0 -1 0 0 -1 0 0 -0.9591508 0 0.2828954 -0.9596631 -8.33003e-4 0.2811512 -0.9608235 0 0.2771607 -0.8403387 0 0.5420618 -0.840874 -4.25545e-4 0.5412307 -0.8418794 0 0.5396656 -0.6545795 0 0.7559933 -0.6546447 -3.46783e-5 0.7559368 -0.6547469 0 0.7558482 -0.4165412 0 0.9091168 -0.4154945 4.29833e-4 0.9095956 -0.4141279 0 0.9102187 -0.1439396 0 0.9895865 -0.142471 5.09058e-4 0.9897989 -0.1408738 0 0.9900277 0.1408738 0 0.9900277 0.142471 5.09058e-4 0.9897989 0.1439396 0 0.9895865 0.4141279 0 0.9102187 0.4154945 4.29833e-4 0.9095956 0.4165412 0 0.9091168 0.6547469 0 0.7558482 0.6546447 -3.46783e-5 0.7559368 0.6545795 0 0.7559933 0.8418794 0 0.5396656 0.840874 -4.25545e-4 0.5412307 0.8403387 0 0.5420618 0.9608235 0 0.2771607 0.9596631 -8.33003e-4 0.2811512 0.9591508 0 0.2828954 1 0 0 1 0 0 1 0 0 0.9585365 0 -0.2849697 0.9596633 -5.69179e-4 -0.2811512 0.9599732 0 -0.280092 0.8418785 0 -0.5396671 0.8408741 2.12565e-4 -0.5412307 0.840663 0 -0.5415588 0.6543759 0 -0.7561693 0.6546447 -3.01789e-5 -0.7559368 0.6546844 0 -0.7559022 0.4121701 0 -0.911107 0.4154945 -2.07829e-4 -0.9095956 0.4158082 0 -0.9094523 0.129338 0 -0.9916005 0.1424711 -3.79589e-4 -0.9897989 0.1430675 0 -0.9897129 -0.1430675 0 -0.9897129 -1 0 0 -1 0 0 -1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0.9838701 0.1788842 -0.007730364 0.9677938 0.2516258 -0.008649408 0.7070808 0.7070799 0.006879746 0.8947982 0.4464178 0.006871819 0.8719238 0.4895934 0.002814829 0.377206 0.9261251 -0.008792817 0.2516237 0.9677851 0 0.1293374 0.9916006 -0.9629649 0 0.269627 -0.9629649 0 0.269627 -0.251012 0.07028329 0.965429 -0.1845505 0.1845505 0.9653404 -0.07028359 0.2510112 0.9654293 -0.1942211 0.6936423 0.6936414 -0.1935422 0.6935194 0.6939541 -0.5112335 0.5112336 0.690855 -0.5112314 0.5112344 0.690856 -0.6932809 0.1941184 0.6940315 -0.7049736 0.1803423 0.6859219 -0.2607492 0.9343423 0.2429284 -0.243086 0.9349478 0.2584215 -0.682882 0.6828859 0.2594976 -0.6944488 0.6756823 0.2473751 -0.9403539 0.2405559 0.2405565 -0.9297617 0.2603295 0.2603303 -0.2516335 0.9678226 0 -0.2516335 0.9678226 0 -0.7167247 0.6973562 0 -0.7167247 0.6973562 0 -0.962965 0.2696263 0 -0.962965 0.2696263 0 -0.7167251 0 -0.6973558 -0.9629649 0 -0.269627 -0.9629649 0 -0.269627 -0.07028359 0.2510112 -0.9654293 -0.1845506 0.1845506 -0.9653404 -0.2440263 0.938564 -0.2440261 -0.2595868 0.9301772 -0.2595866 -0.6923445 0.673635 -0.2586021 -0.6852509 0.685255 -0.2466917 -0.9343009 0.2616005 -0.2421712 -0.9350127 0.2391895 -0.2618005 -0.1936007 0.6937291 -0.6937282 -0.1941202 0.693282 -0.6940299 -0.5112318 0.5112348 -0.6908552 -0.5112326 0.5112326 -0.6908563 -0.6994224 0.1789222 -0.6919503 -0.7027144 0.1967598 -0.6837237 -0.251012 0.07028329 -0.965429 0 0.1543763 -0.9880121 -0.009795784 0.2516214 -0.9677761 -0.007334709 0.722306 -0.6915347 0.00679636 0.4472005 -0.8944079 0.006780803 0.5067117 -0.8620889 -0.009076535 0.9677828 -0.2516229 0 0.9892032 -0.1465499 -0.2263051 0.7072249 0.6697902 0.3015977 0.696307 0.6513029 0.7167264 0.6973544 0 0.5183387 0.69911 -0.4925142 0.03862148 0.6995103 -0.7135781 -0.1644762 0.9669772 0.1946862 -0.1248043 0.9671578 0.2214269 0.01370066 0.9675313 0.2523798 0.06004744 0.9683741 0.2421693 0.1849305 0.9670732 0.1748434 0.1059339 0.9677575 -0.2285243 -0.1261059 0.966584 -0.2231875 -0.199501 0.9668129 -0.1596003 -0.6712515 0.704275 -0.2311238 -0.4654791 0.8727707 -0.1469718 -0.4844728 0.8612704 -0.1532949 -0.8913083 0.3450198 -0.2941612 -0.915989 0.251125 -0.3128905 -0.944593 0.09943693 -0.3128201 -0.9346077 0.1752427 0.3095133 -0.9163941 0.251105 0.3117182 -0.8494461 0.4497035 0.2760577 -0.6587777 0.7186641 0.2225626 -0.11454 0.9926847 0.03817999 -0.2079164 0.9745261 0.08408081 -0.2403051 0.9673867 0.08010166 -0.2239108 0.9672326 0.119688 -0.2239329 0.9672339 -0.1196353 -0.2369856 0.9674997 -0.08821576 -0.168695 0.984063 -0.05623167 -0.220901 0.9681158 -0.1181289 -0.195109 0.9681603 -0.1568376 -0.1642051 0.9670629 -0.194489 -0.1243403 0.9671458 -0.2217399 -0.03328311 0.9677709 -0.249623 0.01294058 0.9675522 -0.2523397 0.01371669 0.9672559 -0.2534325 0.01418453 0.9682756 -0.2494817 0.05979275 0.9683793 -0.2422114 0.1485582 0.966945 -0.2072386 0.1849181 0.9670735 -0.1748546 0.1827625 0.9676989 -0.173657 0.181624 0.9682638 -0.1716915 0.2103747 0.9683087 -0.1346127 0.2516335 0.9678226 0 0.2516335 0.9678226 0 0.2516335 0.9678227 0 0.2469634 0.9678903 -0.04687726 0.2482241 0.9675434 0.04737603 0.2343087 0.9675045 0.09504997 0.2367252 0.9670455 0.09372389 0.21423 0.9671535 0.1368191 0.1064419 0.9675605 0.2291214 0.1058055 0.9677801 0.2284879 0.1058276 0.9677543 0.2285876 0.1467888 0.9679301 0.2038734 -0.0766099 0.966454 0.245148 -0.08143335 0.9670985 0.2410164 -0.07958346 0.9681548 0.2373665 -0.03413015 0.9680389 0.2484672 -0.1947117 0.9681448 0.1574264 -0.2211804 0.9681038 0.1177042 -0.6276769 0.7031698 0.3340269 -0.6718416 0.7042246 0.2295574 -0.8316648 0.4851421 0.270131 -0.224141 0.7071188 -0.6706294 -0.08158397 0.9665949 -0.242978 -0.08118349 0.9673035 -0.240277 -0.230294 0.6945442 -0.6815959 -0.09658795 0.6949279 -0.7125629 -0.1300739 0.2494957 -0.9596003 0.05087167 0.2513077 -0.9665695 0.3019366 0.6962896 -0.6511644 0.06135189 0.9674767 -0.2454073 0.1061488 0.9675673 -0.2292293 0.3024179 0.6942894 -0.653074 0.4201316 0.6941274 -0.584531 0.5638182 0.2583763 -0.7844429 0.7015674 0.2590524 -0.6638488 0.657499 0.7065963 -0.2615662 0.6635753 0.6994388 -0.2654304 0.7016292 0.6998641 -0.133816 0.5189352 0.6991608 0.4918134 0.2101477 0.9683169 0.1349092 0.1812267 0.9682484 0.1721977 0.5147917 0.7040795 0.4891439 0.4141255 0.7046437 0.5761747 0.562515 0.2665852 0.7826297 0.4170309 0.2669032 0.8688198 0.03983807 0.6995611 0.7134614 0.01843094 0.9683725 0.2488275 0.01364505 0.9676027 0.2521088 0.03827118 0.7060714 0.7071057 -0.09523808 0.7051784 0.7026044 -0.1298174 0.2567928 0.9577082 -0.305629 0.2567279 0.916887 -0.4603919 0.7019324 0.5434429 -0.1641054 0.967066 0.194558 -0.164548 0.966937 0.1948249 -0.463243 0.6961148 0.5484799 -0.5580259 0.6967077 0.4507831 -0.8506854 0.2602313 -0.4567428 -0.2229626 0.9675791 -0.1186526 -0.6337479 0.6961472 -0.3372576 -0.6271286 0.7031058 -0.3351895 -0.8501825 0.2659004 -0.454408 -0.8554773 0.2506282 -0.4531491 -0.7517282 0.2706233 -0.6013882 -0.1978173 0.9671215 -0.159826 -0.5579887 0.6967101 -0.4508255 -0.5582559 0.6964031 -0.4509689 -0.7490752 0.2696682 -0.6051161 -0.7513393 0.2621917 -0.6055946 -0.1644515 0.9669765 -0.1947106 -0.4595423 0.7019816 -0.5440982 -0.464033 0.6961706 -0.5477408 -0.6238481 0.261821 -0.7363854 -0.621176 0.2712791 -0.7352197 -0.1242595 0.9673138 -0.221051 -0.3465486 0.7069951 -0.6164916 -0.3499536 0.7017597 -0.6205367 -0.4731478 0.2687683 -0.8389843 -0.4767771 0.2609524 -0.839397 -0.1288474 0.2567702 -0.9578452 -0.305629 0.2567279 -0.9168869 -0.3062461 0.2581284 -0.9162877 -0.3065935 0.2567667 -0.916554 -0.4726419 0.2588881 -0.8423696 0.05413478 0.2532923 -0.965874 0.05391412 0.2545722 -0.9655498 0.03948223 0.7060217 -0.7070888 -0.09333491 0.7052802 -0.7027577 -0.03303414 0.9680098 -0.2487279 -0.07829689 0.9681807 -0.2376884 0.06135183 0.9674766 -0.2454078 0.1740778 0.696309 -0.6963121 0.1739403 0.6986982 -0.6939493 0.2341818 0.2688215 -0.9342879 0.2314112 0.2534631 -0.9392579 0.5634199 0.2665578 -0.7819878 0.4170309 0.2669032 -0.8688198 0.4046592 0.2732187 -0.8726983 0.4044461 0.2603067 -0.8767347 0.2365246 0.2621741 -0.9355859 0.7046238 0.2473371 -0.6650787 0.7013934 0.2572429 -0.6647355 0.5154538 0.7040323 -0.488514 0.415661 0.7047259 -0.5749672 0.1455301 0.9686573 -0.2013059 0.15098 0.9678227 -0.2013067 0.2147524 0.9670686 -0.1366009 0.5968894 0.7068039 -0.3796725 0.6017773 0.7001448 -0.3842673 0.8154708 0.2526968 -0.5207222 0.8161497 0.2468252 -0.5224721 0.9629638 0.2696306 0 0.9449788 0.2718722 -0.1819358 0.9482918 0.2608299 -0.18086 0.9482879 0.261008 -0.1806234 0.8967889 0.2617092 -0.3567605 0.8974719 0.258296 -0.3575298 0.8130294 0.2577725 -0.5220504 0.9629638 0.2696306 0 0.9629638 0.2696306 0 0.7167264 0.6973544 0 0.70467 0.6965711 -0.1350152 0.2486808 0.9674128 -0.04764741 0.2481271 0.9675516 -0.04771661 0.9482879 0.261008 0.1806234 0.2469177 0.9678809 0.04730957 0.7014893 0.6998912 0.1344058 0.7047534 0.6966033 0.1344119 0.9482918 0.2608299 0.18086 0.9449788 0.2718721 0.1819358 0.2322279 0.9682156 0.09289127 0.6569463 0.7066604 0.2627788 0.6640112 0.699507 0.2641569 0.8976452 0.2582861 0.3571012 0.8966205 0.2616998 0.3571906 0.2123748 0.9678058 0.1350885 0.6024934 0.7000937 0.3832371 0.59627 0.7067469 0.3807505 0.8154708 0.2526969 0.5207222 0.8130294 0.2577725 0.5220504 0.5647161 0.2584066 0.7837867 0.7015674 0.2590524 0.6638488 0.7013934 0.2572429 0.6647355 0.7046238 0.2473371 0.6650787 0.8161497 0.2468252 0.5224721 0.4044461 0.2603067 0.8767347 0.4046592 0.2732187 0.8726983 0.3027438 0.6943063 0.6529051 0.4217932 0.6940296 0.5834496 0.1488554 0.9671839 0.2059057 0.1488695 0.9669557 0.2069647 0.06135171 0.9674767 0.2454074 0.1735082 0.6987219 0.6940336 0.1745008 0.6963297 0.6961856 0.2341818 0.2688215 0.9342879 0.2365246 0.2621741 0.9355859 -0.1291 0.2495277 0.9597235 0.05087167 0.2513077 0.9665695 0.05391412 0.2545722 0.9655498 0.05413478 0.2532923 0.965874 0.2314112 0.2534631 0.9392579 -0.3065935 0.2567667 0.916554 -0.3062461 0.2581284 0.9162877 -0.2280214 0.6946619 0.6822397 -0.09468263 0.6948394 0.7129049 -0.03354847 0.9669889 0.2526004 -0.03234249 0.9677872 0.2496837 -0.1255912 0.9665973 0.22342 -0.3491178 0.7017115 0.6210619 -0.3474251 0.7069473 0.616053 -0.4731478 0.2687683 0.8389843 -0.4726419 0.2588881 0.8423696 -0.8506854 0.2602313 0.4567428 -0.7513393 0.2621915 0.6055946 -0.7490752 0.2696682 0.6051161 -0.7517282 0.2706233 0.6013882 -0.6221522 0.2713071 0.7343835 -0.6228598 0.2618451 0.7372128 -0.4767771 0.2609524 0.839397 -0.8554773 0.2506282 0.4531491 -0.8501825 0.2659004 0.454408 -0.6330834 0.6962109 0.3383722 -0.5582225 0.6964006 0.4510145 -0.1946848 0.9681715 0.1572951 -0.1992351 0.9668231 0.15987 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0.2576645 0 -0.9662344 -0.05074721 0 -0.9987115 -0.05074721 0 -0.9987115 -0.3301701 0 -0.9439214 -0.3301701 0 -0.9439214 0.2314149 -0.04166501 -0.9719626 0.2337992 -0.0328713 -0.9717291 -0.2353472 -0.01319801 0.9718218 0.2360719 0 -0.9717356 0.498471 0 -0.8669065 0.5025548 0.05025458 -0.8630836 0.4977039 -0.0518344 -0.8657968 0.5000953 0.04980254 -0.8645372 0.5044022 0 -0.8634689 0.7249996 0 -0.6887493 0.7241208 -0.006897449 -0.6896386 0.8897777 0 -0.4563943 0.8898923 -0.008304476 -0.4560952 0.8900858 0 -0.4557931 0.7240293 0 -0.6897691 -0.9833266 0 0.1818479 -0.9818185 -0.044227 0.1845983 0.9825241 -0.002599418 -0.1861173 0.9825702 0 -0.1858918 0.6556872 0 0.7550326 -0.6556872 0 0.7550326 -0.6515577 -0.04579263 0.7572157 -0.6516571 -0.04426085 0.7572213 -0.6510875 0 0.7590027 -0.8414006 0 0.540412 -0.8395078 -0.03620713 0.54214 -0.8394931 0 0.5433704 -0.9587494 0 0.2842525 -0.9582376 0.04984301 0.2815961 -0.9599216 0 0.2802686 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -0.9598937 0 -0.2803642 -0.9588532 0.03467482 -0.281777 -0.9590831 0 -0.2831244 -0.8426965 0 -0.5383889 0.8393291 -0.04166615 0.5420246 0.8395044 0 0.5433529 0.6522963 0 0.757964 0.6490944 0.0781871 0.7566791 0.6515577 0.04579263 0.7572157 0.8899229 0 0.4561109 0.9838697 0 0.1788867 0.9821668 0.01870387 0.187079 0.9826549 -0.003704786 0.1854068 0.9822553 -0.03267395 0.1846804 0.9842713 0 0.1766641 0.8899229 0 0.4561109 0.7249996 0 0.6887493 0.7241208 -0.006897449 0.6896386 0.7232667 0.02902907 0.6899583 0.7348049 0 0.6782786 0.5044022 0 0.8634689 0.4990119 0.0604375 0.864485 0.5005733 0.02391499 0.8653637 0.498471 0 0.8669065 0.2360719 0 0.9717356 0.2353472 0.01319825 0.9718218 0.2337992 -0.03287124 0.9717291 0.2314148 -0.04166501 0.9719625 0.2576645 0 0.9662344 -0.05074721 0 0.9987115 -0.05074721 0 0.9987115 -0.3301701 0 0.9439214 0.3301701 0 -0.9439214 0 -1 0 0 -1 0 0 -1 0 0 0.03485059 -0.9993925 0.9993925 0.03485059 0 1 0 0 0 0 -1 -0.260666 0 0.9654291 -0.9654291 0 -0.260666 -0.9654291 0 -0.260666 -0.260666 0 -0.9654291 -0.9645484 0.04270619 -0.2604277 -0.9646556 0.04270696 -0.2600302 0.9654291 0 -0.260666 0.2604277 0.04270619 -0.9645484 0.7071068 0 0.7071068 0.2689354 0.9604846 -0.07171601 0.2758985 0.9581687 -0.07611 0.2031767 0.95783 -0.2031767 0.2031767 0.95783 -0.2031767 0.07389479 0.9579936 -0.2771059 0.07417577 0.9603113 -0.2688869 0.6940287 0.6940234 -0.1914564 0.6821739 0.707958 -0.1828504 0.4946855 0.7145437 -0.4946855 0.4946855 0.7145437 -0.4946855 0.1876068 0.7087336 -0.6800739 0.1862189 0.6947355 -0.694741 0.9324051 0.2610736 -0.2499225 0.9336825 0.2543331 -0.2520944 0.6852533 0.2466892 -0.6852533 0.6852534 0.2466892 -0.6852534 0.2503941 0.2542446 -0.9341641 0.2516342 0.2609541 -0.9319781 0 0 0 0 0.7071041 -0.7071095 0 0.7071041 -0.7071095 0 0.2696301 -0.9629639 0 0.2696301 -0.9629639 0.2696297 0.9629641 0 0.2696297 0.9629641 0 0.2696297 0.9629641 0 0.7071095 0.7071041 0 0.7071095 0.7071041 0 0.9629639 0.2696301 0 0.9629639 0.2696301 0 -0.07611 0.9581687 -0.2758985 -0.2031767 0.95783 -0.2031767 -0.2031767 0.95783 -0.2031767 -0.2771059 0.9579936 -0.07389479 -0.2688869 0.9603113 -0.07417577 -0.1914564 0.6940234 -0.6940287 -0.1828504 0.7079579 -0.6821739 -0.4946855 0.7145437 -0.4946855 -0.4946855 0.7145437 -0.4946855 -0.6800737 0.7087335 -0.1876068 -0.694741 0.6947355 -0.1862189 -0.2499225 0.2610736 -0.9324051 -0.2520944 0.2543331 -0.9336825 -0.6852533 0.2466892 -0.6852533 -0.6852534 0.2466892 -0.6852534 -0.9341641 0.2542446 -0.2503941 -0.9319781 0.2609541 -0.2516342 0.07171601 0.9604846 0.2689354 0.07611 0.9581687 0.2758985 0.2031767 0.95783 0.2031767 0.2031767 0.95783 0.2031767 0.2771059 0.9579936 0.07389479 0.2688869 0.9603113 0.07417577 0.1914564 0.6940234 0.6940287 0.1828504 0.7079579 0.6821739 0.4946855 0.7145437 0.4946855 0.4946855 0.7145437 0.4946855 0.6800737 0.7087335 0.1876068 0.694741 0.6947355 0.1862189 0.2499225 0.2610736 0.9324051 0.2520944 0.2543331 0.9336825 0.6852533 0.2466892 0.6852533 0.6852534 0.2466892 0.6852534 0.9341641 0.2542446 0.2503941 0.9319781 0.2609541 0.2516342 -0.2696297 0.9629641 0 -0.2696297 0.9629641 0 -0.2696297 0.9629641 0 -0.7071095 0.7071041 0 -0.7071095 0.7071041 0 -0.9629639 0.2696301 0 -0.9629639 0.2696301 0 0 0.9629641 0.2696297 0 0.9629641 0.2696297 0 0.9629641 0.2696297 0 0.7071041 0.7071095 0 0.7071041 0.7071095 0 0.2696301 0.9629639 0 0.2696301 0.9629639 -0.2689354 0.9604846 0.07171601 -0.2758985 0.9581687 0.07611 -0.2031767 0.95783 0.2031767 -0.2031767 0.95783 0.2031767 -0.07389479 0.9579936 0.2771059 -0.07417577 0.9603113 0.2688869 -0.6940287 0.6940234 0.1914564 -0.6821739 0.707958 0.1828504 -0.4946855 0.7145437 0.4946855 -0.4946855 0.7145437 0.4946855 -0.1876068 0.7087336 0.6800739 -0.1862189 0.6947355 0.694741 -0.9324051 0.2610736 0.2499225 -0.9336825 0.2543331 0.2520944 -0.6852533 0.2466892 0.6852533 -0.6852534 0.2466892 0.6852534 -0.2503941 0.2542446 0.9341641 -0.2516342 0.2609541 0.9319781 -0.9629639 0 -0.2696301 -0.9629639 0 -0.2696301 -0.7167251 0 -0.6973558 -0.7167237 -2.52567e-7 -0.6973572 -0.2516344 0 -0.9678224 -0.2516335 0 -0.9678226 -0.2516344 0 -0.9678224 -0.2516344 0 0.9678224 -0.2516344 0 0.9678224 -0.7167251 0 0.6973558 -0.7167251 0 0.6973558 -0.9629639 0 0.2696301 -0.9629639 0 0.2696301 -1 0 0 -1 0 0 0 0 1 0 0 -1 0 0 -1 -1 0 0 -1 0 0 -0.9122474 0 0.4096398 -0.8835567 -0.01679629 -0.4680228 -0.957763 0.01149314 -0.2873293 -0.957763 0.01149314 0.2873293 -0.8835567 -0.01679629 0.4680228 -0.9086417 0.007449328 0.4175103 -0.881016 0.007450222 0.4730277 -0.8049004 -0.01266139 0.5932749 -0.9122221 0.007446944 -0.4096284 -0.901296 0 -0.4332039 0 0 1 0 0 1 0 0 -1 0 0 -1 0 0 -1 -0.9190827 0.28875 -0.2681613 -0.9068856 0.3034356 -0.292379 -0.9189138 0.2091057 0.3344731 0.9175001 0.1444488 -0.3705781 0.8302804 0.1654177 -0.5322325 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 -0.2516344 0 0.9678224 0.002348303 0.6348381 0.7726417 -0.7167251 0 0.6973558 -0.7167251 0 0.6973558 -0.2516344 0 0.9678224 -0.2516344 0 0.9678224 -0.2516344 0 -0.9678224 -0.2516344 0 -0.9678224 -0.7167251 0 -0.6973558 -0.004324674 0.7071006 -0.7070997 0.003669202 0.9127396 -0.4085254 0.2344187 0.967514 -0.09468168 -0.7256583 0.6450302 -0.2394912 -0.3975354 0.9086532 0.1277299 0.2290577 0.9690912 -0.09162318 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 0 0 0 0 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 0 0 0 0 0 0 0.03485059 -0.9993925 0.9993925 0.03485059 0 -0.9993925 0.03485059 0 -0.9993925 0.03485059 0 0 0 1 0 0 1 1 0 0 0 0 -1 -1 0 0 -1 0 0 -0.7071068 0 0.7071068 -0.7071068 0 0.7071068 -0.260666 0 0.9654291 -0.9654291 0 0.260666 -0.9654291 0 0.260666 -0.9646556 0.04270696 0.2600302 -0.9645484 0.04270619 0.2604277 -0.706249 0.04924374 0.7062489 -0.7062489 0.04924374 0.7062489 -0.2604277 0.04270619 0.9645484 -0.2600302 0.04270696 0.9646556 -0.7071068 0 -0.7071068 -0.7071068 0 -0.7071068 -0.260666 0 -0.9654291 -0.2600301 0.04270696 -0.9646555 -0.2604277 0.04270619 -0.9645484 -0.7062489 0.04924374 -0.706249 -0.7062489 0.04924374 -0.7062489 0.260666 0 -0.9654291 0.7071068 0 -0.7071068 0.7071068 0 -0.7071068 0.260666 0 -0.9654291 0.9654291 0 -0.260666 0.9646556 0.04270696 -0.2600302 0.9645484 0.04270619 -0.2604277 0.706249 0.04924374 -0.7062489 0.7062489 0.04924374 -0.7062489 0.2600302 0.04270696 -0.9646556 0.2604278 0.04270619 0.9645484 0.2600301 0.04270696 0.9646556 0.9645479 0.04271709 0.2604277 0.964656 0.04269605 0.2600303 0.7062489 0.04924374 0.7062489 0.706249 0.04924374 0.7062489 0.7071068 0 0.7071068 0.9654291 0 0.260666 0.9654291 0 0.260666 0.260666 0 0.9654291 0.260666 0 0.9654291 0 0 0 0 0 0 -1.5404e-7 1 -6.36081e-7 3.24032e-7 1 5.61656e-7 6.54708e-7 1 0 -6.48629e-7 1 0 -5.82531e-7 1 2.98564e-7 4.26935e-7 1 4.96095e-7 -3.27791e-7 1 5.66667e-7 6.28108e-7 1 1.84581e-7 -1.5404e-7 1 6.36081e-7 5.49908e-7 1 -3.55121e-7 5.49908e-7 1 3.55121e-7 -4.74061e-7 1 -4.51486e-7 0 1 6.53629e-7 2.16121e-7 1 -6.17868e-7 3.24032e-7 1 -5.61656e-7 -5.82531e-7 1 -2.98564e-7 -4.74061e-7 1 4.51486e-7 4.26935e-7 1 -4.96095e-7 -3.27791e-7 1 -5.66667e-7 -6.43363e-7 1 1.20963e-7 2.16121e-7 1 6.17868e-7 6.28108e-7 1 -1.84581e-7 -6.43363e-7 1 -1.20963e-7 0 1 -6.53629e-7 0 0.9629641 -0.2696297 0 0.9629641 -0.2696297 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1872387 -0.9823144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1364855 -0.9817008 -0.1327975 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.08765232 -0.9373711 -0.3371237 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1734797 -0.9848374 0 0 0 0 0 0 0 0 0 0 -0.1734797 -0.9848374 0 0 0 0 0 0 0 0 0.9629641 -0.2696297 0 0 0 -0.07171601 0.9604846 -0.2689354 -0.08764123 -0.9899891 0.1106374 0.07545632 -0.9970984 0.01005166 -0.165484 -0.9851234 -0.04633498 0.06710433 -0.9963871 -0.05205571 -0.01855289 -0.9915714 -0.1282264 -0.1596735 -0.9861569 0.0447086 0.01166564 -0.9952132 0.09702873 0.1506127 0.98234 0.1110134 0.01357448 -0.9934884 -0.1131218 0 0 0 -0.1199531 -0.9858954 0.1167114 0.0334047 -0.9960209 0.08262425 0.07395762 -0.9967855 -0.03080356 -0.1550459 -0.986953 0.04341232 -0.04902708 -0.9923275 0.1135011 -0.05939245 -0.9717465 0.2284322 0.01359909 -0.9934894 -0.1131098 0 0 0 -0.1297165 -0.9869306 0.09561127 0.05006933 -0.9965522 0.06615769 0.07658731 -0.9970107 -0.01020228 -0.1044685 -0.9857454 -0.1318801 0.1044685 0.9857454 0.1318801 0 -0.9662557 0.2575849 -0.01562213 -0.9940313 0.1079711 -0.1443563 -0.9795069 -0.1404551 0.03801149 -0.9948446 -0.09401881 0.06233876 -0.9968829 0.04835891 -0.05876457 -0.9889584 -0.136044 -0.05089199 -0.9793348 0.195738 0.01164436 -0.9952126 0.09703755 -0.1872387 -0.9823144 0 0.05545455 -0.995769 -0.0732733 -0.1144365 -0.9871711 0.1113438 0.07075601 -0.9970582 0.02947002 -0.1506127 -0.98234 -0.1110134 0.05876457 0.9889584 0.136044 -0.1603716 -0.9844262 0.07201397 -0.01855289 -0.9915714 -0.1282265 0 0.03485065 0.9993925 0 0.03485059 0.9993926 0 0.03485053 0.9993925 0 0.03485059 0.9993926 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 -0.1707559 -0.9841526 -0.04781168 0.070692 0.9597275 0.2718927 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1790391 0.9805517 0.08039653 -0.1790391 -0.9805517 -0.08039653 0 -0.9156407 -0.4019977 + + + + + + + + + + + + + + + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +

376 0 371 0 375 0 325 1 326 1 329 1 161 2 75 2 120 2 122 3 76 3 284 3 277 4 404 4 278 4 278 5 404 5 280 5 280 6 404 6 406 6 280 7 406 7 282 7 408 8 275 8 406 8 406 9 275 9 281 9 406 10 281 10 282 10 410 11 259 11 408 11 408 12 259 12 266 12 408 13 266 13 275 13 414 14 263 14 264 14 414 15 264 15 412 15 412 16 264 16 262 16 412 17 262 17 410 17 410 18 262 18 260 18 410 19 260 19 259 19 263 20 414 20 257 20 257 21 414 21 416 21 257 22 416 22 248 22 248 23 416 23 241 23 241 24 416 24 418 24 241 25 418 25 242 25 420 26 246 26 418 26 418 27 246 27 244 27 418 28 244 28 242 28 230 29 234 29 423 29 423 30 234 30 239 30 423 31 239 31 420 31 420 32 239 32 245 32 420 33 245 33 246 33 230 34 423 34 229 34 229 35 423 35 422 35 229 36 422 36 221 36 221 37 422 37 214 37 214 38 422 38 421 38 214 39 421 39 215 39 215 40 421 40 217 40 217 41 421 41 419 41 217 42 419 42 219 42 417 43 212 43 419 43 419 44 212 44 218 44 419 45 218 45 219 45 199 46 197 46 415 46 415 47 197 47 196 47 415 48 196 48 417 48 417 49 196 49 203 49 417 50 203 50 212 50 199 51 415 51 201 51 201 52 415 52 413 52 201 53 413 53 200 53 200 54 413 54 194 54 194 55 413 55 411 55 194 56 411 56 185 56 185 57 411 57 409 57 185 58 409 58 178 58 178 59 409 59 407 59 178 60 407 60 179 60 405 61 183 61 407 61 407 62 183 62 181 62 407 63 181 63 179 63 167 64 171 64 403 64 403 65 171 65 176 65 403 66 176 66 405 66 405 67 176 67 182 67 405 68 182 68 183 68 167 69 403 69 166 69 166 70 403 70 402 70 166 71 402 71 162 71 84 72 76 72 122 72 122 73 123 73 84 73 84 74 123 74 150 74 84 75 150 75 151 75 151 76 124 76 84 76 126 77 125 77 84 77 84 78 125 78 27 78 84 79 27 79 82 79 118 80 117 80 107 80 107 81 106 81 28 81 120 82 107 82 121 82 121 83 107 83 119 83 118 84 107 84 130 84 130 85 107 85 28 85 130 86 28 86 129 86 41 87 40 87 127 87 31 88 30 88 173 88 114 89 74 89 36 89 28 90 106 90 34 90 108 91 35 91 110 91 110 92 35 92 34 92 110 93 34 93 109 93 109 94 34 94 106 94 108 95 111 95 35 95 36 96 116 96 114 96 78 97 40 97 80 97 80 98 40 98 79 98 40 99 81 99 83 99 125 100 127 100 27 100 27 101 127 101 40 101 27 102 40 102 82 102 82 103 40 103 83 103 79 104 40 104 77 104 77 105 40 105 39 105 77 106 39 106 73 106 73 107 39 107 38 107 73 108 38 108 74 108 74 109 38 109 37 109 74 110 37 110 36 110 173 111 30 111 152 111 152 112 30 112 29 112 152 113 29 113 188 113 188 114 29 114 71 114 188 115 71 115 190 115 190 116 71 116 72 116 190 117 72 117 134 117 173 118 133 118 31 118 31 119 133 119 169 119 31 120 169 120 32 120 32 121 169 121 164 121 32 122 164 122 33 122 33 123 164 123 132 123 33 124 132 124 34 124 34 125 132 125 159 125 34 126 159 126 28 126 28 127 159 127 131 127 28 128 131 128 129 128 127 129 128 129 41 129 41 130 128 130 148 130 41 131 148 131 42 131 42 132 148 132 291 132 42 133 291 133 43 133 43 134 291 134 289 134 43 135 289 135 44 135 44 136 289 136 158 136 44 137 158 137 45 137 158 138 157 138 45 138 45 139 157 139 272 139 45 140 272 140 46 140 46 141 272 141 146 141 46 142 146 142 47 142 47 143 146 143 147 143 47 144 147 144 48 144 48 145 147 145 271 145 48 146 271 146 49 146 49 147 271 147 269 147 49 148 269 148 50 148 269 149 156 149 50 149 50 150 156 150 155 150 50 151 155 151 51 151 51 152 155 152 254 152 51 153 254 153 52 153 52 154 254 154 144 154 52 155 144 155 53 155 53 156 144 156 145 156 53 157 145 157 54 157 145 158 253 158 54 158 54 159 253 159 251 159 54 160 251 160 55 160 55 161 251 161 154 161 55 162 154 162 56 162 56 163 154 163 236 163 56 164 236 164 57 164 57 165 236 165 143 165 57 166 143 166 58 166 143 167 232 167 58 167 58 168 232 168 142 168 58 169 142 169 59 169 59 170 142 170 227 170 59 171 227 171 60 171 60 172 227 172 140 172 60 173 140 173 61 173 61 174 140 174 141 174 61 175 141 175 62 175 141 176 226 176 62 176 62 177 226 177 224 177 62 178 224 178 63 178 64 179 209 179 139 179 64 180 139 180 65 180 65 181 139 181 138 181 65 182 138 182 66 182 66 183 138 183 137 183 66 184 137 184 67 184 67 185 137 185 208 185 67 186 208 186 68 186 208 187 206 187 68 187 68 188 206 188 153 188 68 189 153 189 69 189 69 190 153 190 191 190 69 191 191 191 70 191 70 192 191 192 136 192 70 193 136 193 72 193 72 194 136 194 135 194 72 195 135 195 134 195 71 196 308 196 309 196 71 197 29 197 308 197 308 198 29 198 30 198 308 199 30 199 292 199 30 200 31 200 292 200 292 201 31 201 32 201 292 202 32 202 307 202 32 203 33 203 307 203 307 204 33 204 34 204 307 205 34 205 306 205 34 206 35 206 306 206 306 207 35 207 36 207 306 208 36 208 305 208 36 209 37 209 305 209 305 210 37 210 38 210 305 211 38 211 304 211 38 212 39 212 304 212 304 213 39 213 40 213 304 214 40 214 303 214 40 215 41 215 303 215 303 216 41 216 42 216 303 217 42 217 302 217 42 218 43 218 302 218 302 219 43 219 44 219 302 220 44 220 301 220 44 221 45 221 301 221 301 222 45 222 46 222 301 223 46 223 293 223 46 224 47 224 293 224 293 225 47 225 48 225 293 226 48 226 294 226 48 227 49 227 294 227 294 228 49 228 50 228 294 229 50 229 295 229 50 230 51 230 295 230 295 231 51 231 52 231 295 232 52 232 296 232 52 233 53 233 296 233 296 234 53 234 54 234 296 235 54 235 297 235 54 236 55 236 297 236 297 237 55 237 56 237 297 238 56 238 298 238 56 239 57 239 298 239 298 240 57 240 58 240 298 241 58 241 299 241 58 242 59 242 299 242 299 243 59 243 60 243 299 244 60 244 300 244 60 245 61 245 300 245 300 246 61 246 62 246 300 247 62 247 313 247 62 248 63 248 313 248 313 249 63 249 64 249 313 250 64 250 312 250 64 251 65 251 312 251 312 252 65 252 66 252 312 253 66 253 311 253 66 254 67 254 311 254 311 255 67 255 68 255 311 256 68 256 310 256 68 257 69 257 310 257 310 258 69 258 70 258 310 259 70 259 309 259 309 260 70 260 72 260 309 261 72 261 71 261 399 262 95 262 398 262 398 263 95 263 99 263 398 264 99 264 397 264 93 265 77 265 73 265 93 266 73 266 115 266 115 267 73 267 74 267 115 268 74 268 114 268 77 269 93 269 79 269 79 270 93 270 89 270 85 271 78 271 89 271 89 272 78 272 80 272 89 273 80 273 79 273 81 274 85 274 83 274 83 275 85 275 84 275 83 276 84 276 82 276 95 277 399 277 401 277 95 278 401 278 92 278 84 279 87 279 88 279 86 280 87 280 84 280 85 281 86 281 84 281 85 282 89 282 86 282 86 283 89 283 90 283 86 284 90 284 87 284 87 285 90 285 91 285 87 286 91 286 88 286 88 287 91 287 92 287 89 288 93 288 90 288 90 289 93 289 94 289 90 290 94 290 91 290 91 291 94 291 96 291 91 292 96 292 92 292 92 293 96 293 95 293 93 294 115 294 97 294 93 295 97 295 94 295 94 296 97 296 98 296 94 297 98 297 96 297 96 298 98 298 99 298 96 299 99 299 95 299 105 300 400 300 103 300 103 301 400 301 397 301 103 302 397 302 99 302 101 303 112 303 107 303 101 304 107 304 104 304 115 305 113 305 97 305 97 306 113 306 100 306 97 307 100 307 98 307 98 308 100 308 102 308 98 309 102 309 99 309 99 310 102 310 103 310 113 311 112 311 100 311 100 312 112 312 101 312 100 313 101 313 102 313 102 314 101 314 104 314 102 315 104 315 103 315 103 316 104 316 105 316 105 317 104 317 107 317 106 318 107 318 109 318 109 319 107 319 112 319 111 320 108 320 112 320 112 321 108 321 110 321 112 322 110 322 109 322 116 323 113 323 115 323 116 324 115 324 114 324 268 325 274 325 276 325 250 326 256 326 258 326 223 327 228 327 231 327 205 328 211 328 213 328 187 329 193 329 195 329 158 330 289 330 290 330 272 331 157 331 273 331 156 332 269 332 270 332 254 333 155 333 255 333 154 334 251 334 252 334 153 335 206 335 207 335 173 336 152 336 174 336 164 337 169 337 170 337 163 338 117 338 160 338 160 339 117 339 118 339 160 340 118 340 130 340 119 341 163 341 121 341 121 342 163 342 161 342 121 343 161 343 120 343 122 344 284 344 123 344 123 345 284 345 286 345 123 346 286 346 150 346 149 347 124 347 151 347 125 348 126 348 127 348 127 349 126 349 149 349 127 350 149 350 128 350 128 351 149 351 148 351 159 352 160 352 131 352 131 353 160 353 130 353 131 354 130 354 129 354 159 355 132 355 165 355 165 356 132 356 164 356 169 357 133 357 175 357 175 358 133 358 173 358 190 359 134 359 187 359 187 360 134 360 135 360 187 361 135 361 193 361 193 362 135 362 136 362 193 363 136 363 191 363 208 364 137 364 205 364 205 365 137 365 138 365 205 366 138 366 211 366 211 367 138 367 139 367 211 368 139 368 209 368 227 369 228 369 140 369 140 370 228 370 223 370 140 371 223 371 141 371 141 372 223 372 226 372 227 373 142 373 233 373 233 374 142 374 232 374 232 375 143 375 238 375 238 376 143 376 236 376 254 377 256 377 144 377 144 378 256 378 250 378 144 379 250 379 145 379 145 380 250 380 253 380 272 381 274 381 146 381 146 382 274 382 268 382 146 383 268 383 147 383 147 384 268 384 271 384 291 385 148 385 288 385 288 386 148 386 149 386 288 387 149 387 286 387 286 388 149 388 151 388 286 389 151 389 150 389 180 390 184 390 174 390 152 391 188 391 174 391 174 392 188 392 189 392 174 393 189 393 180 393 180 394 189 394 186 394 180 395 186 395 178 395 178 396 186 396 185 396 198 397 202 397 192 397 191 398 153 398 192 398 192 399 153 399 207 399 192 400 207 400 198 400 198 401 207 401 204 401 198 402 204 402 196 402 196 403 204 403 203 403 216 404 220 404 210 404 210 405 225 405 216 405 216 406 225 406 222 406 243 407 247 407 237 407 236 408 154 408 237 408 237 409 154 409 252 409 237 410 252 410 243 410 243 411 252 411 249 411 243 412 249 412 241 412 241 413 249 413 248 413 261 414 265 414 255 414 155 415 156 415 255 415 255 416 156 416 270 416 255 417 270 417 261 417 261 418 270 418 267 418 261 419 267 419 259 419 259 420 267 420 266 420 279 421 283 421 273 421 157 422 158 422 273 422 273 423 158 423 290 423 273 424 290 424 279 424 279 425 290 425 287 425 168 426 166 426 162 426 159 427 165 427 160 427 160 428 165 428 168 428 160 429 168 429 163 429 163 430 168 430 162 430 163 431 162 431 161 431 172 432 171 432 167 432 164 433 170 433 165 433 165 434 170 434 172 434 165 435 172 435 168 435 168 436 172 436 167 436 168 437 167 437 166 437 169 438 175 438 170 438 170 439 175 439 177 439 170 440 177 440 172 440 172 441 177 441 176 441 172 442 176 442 171 442 173 443 174 443 175 443 175 444 174 444 184 444 175 445 184 445 177 445 177 446 184 446 182 446 177 447 182 447 176 447 178 448 179 448 180 448 180 449 179 449 181 449 180 450 181 450 184 450 184 451 181 451 183 451 184 452 183 452 182 452 194 453 185 453 195 453 195 454 185 454 186 454 195 455 186 455 187 455 187 456 186 456 189 456 187 457 189 457 190 457 190 458 189 458 188 458 191 459 192 459 193 459 193 460 192 460 202 460 193 461 202 461 195 461 195 462 202 462 200 462 195 463 200 463 194 463 196 464 197 464 198 464 198 465 197 465 199 465 198 466 199 466 202 466 202 467 199 467 201 467 202 468 201 468 200 468 212 469 203 469 213 469 213 470 203 470 204 470 213 471 204 471 205 471 205 472 204 472 207 472 205 473 207 473 208 473 208 474 207 474 206 474 209 475 210 475 211 475 211 476 210 476 220 476 211 477 220 477 213 477 213 478 220 478 218 478 213 479 218 479 212 479 221 480 214 480 222 480 222 481 214 481 215 481 222 482 215 482 216 482 216 483 215 483 217 483 216 484 217 484 220 484 220 485 217 485 219 485 220 486 219 486 218 486 229 487 221 487 231 487 231 488 221 488 222 488 231 489 222 489 223 489 223 490 222 490 225 490 223 491 225 491 226 491 226 492 225 492 224 492 235 493 234 493 230 493 227 494 233 494 228 494 228 495 233 495 235 495 228 496 235 496 231 496 231 497 235 497 230 497 231 498 230 498 229 498 232 499 238 499 233 499 233 500 238 500 240 500 233 501 240 501 235 501 235 502 240 502 239 502 235 503 239 503 234 503 236 504 237 504 238 504 238 505 237 505 247 505 238 506 247 506 240 506 240 507 247 507 245 507 240 508 245 508 239 508 241 509 242 509 243 509 243 510 242 510 244 510 243 511 244 511 247 511 247 512 244 512 246 512 247 513 246 513 245 513 257 514 248 514 258 514 258 515 248 515 249 515 258 516 249 516 250 516 250 517 249 517 252 517 250 518 252 518 253 518 253 519 252 519 251 519 254 520 255 520 256 520 256 521 255 521 265 521 256 522 265 522 258 522 258 523 265 523 263 523 258 524 263 524 257 524 259 525 260 525 261 525 261 526 260 526 262 526 261 527 262 527 265 527 265 528 262 528 264 528 265 529 264 529 263 529 275 530 266 530 276 530 276 531 266 531 267 531 276 532 267 532 268 532 268 533 267 533 270 533 268 534 270 534 271 534 271 535 270 535 269 535 272 536 273 536 274 536 274 537 273 537 283 537 274 538 283 538 276 538 276 539 283 539 281 539 276 540 281 540 275 540 285 541 277 541 287 541 287 542 277 542 278 542 287 543 278 543 279 543 279 544 278 544 280 544 279 545 280 545 283 545 283 546 280 546 282 546 283 547 282 547 281 547 284 548 285 548 286 548 286 549 285 549 287 549 286 550 287 550 288 550 288 551 287 551 290 551 288 552 290 552 291 552 291 553 290 553 289 553 301 554 293 554 389 554 308 555 292 555 363 555 363 556 292 556 307 556 389 557 293 557 385 557 385 558 293 558 294 558 385 559 294 559 380 559 380 560 294 560 295 560 380 561 295 561 377 561 377 562 295 562 296 562 377 563 296 563 373 563 373 564 296 564 297 564 373 565 297 565 370 565 370 566 297 566 298 566 370 567 298 567 390 567 390 568 298 568 299 568 390 569 299 569 393 569 393 570 299 570 300 570 393 571 300 571 313 571 389 572 387 572 301 572 301 573 387 573 365 573 301 574 365 574 302 574 302 575 365 575 342 575 302 576 342 576 303 576 303 577 342 577 345 577 303 578 345 578 304 578 304 579 345 579 351 579 304 580 351 580 305 580 305 581 351 581 354 581 305 582 354 582 306 582 306 583 354 583 357 583 306 584 357 584 307 584 307 585 357 585 359 585 307 586 359 586 363 586 363 587 337 587 308 587 308 588 337 588 315 588 308 589 315 589 309 589 309 590 315 590 319 590 309 591 319 591 310 591 310 592 319 592 324 592 310 593 324 593 311 593 311 594 324 594 327 594 311 595 327 595 312 595 312 596 327 596 330 596 312 597 330 597 313 597 313 598 330 598 334 598 313 599 334 599 393 599 317 600 314 600 319 600 314 601 315 601 319 601 314 602 316 602 315 602 316 603 337 603 315 603 316 604 336 604 337 604 317 605 319 605 318 605 319 606 320 606 318 606 319 607 320 607 324 607 324 608 321 608 320 608 324 609 322 609 321 609 322 610 324 610 323 610 324 611 325 611 323 611 324 612 327 612 325 612 325 613 327 613 326 613 327 614 329 614 326 614 327 615 330 615 329 615 333 616 328 616 334 616 328 617 330 617 334 617 328 618 331 618 330 618 331 619 329 619 330 619 392 620 393 620 332 620 332 621 393 621 334 621 332 622 335 622 334 622 335 623 333 623 334 623 361 624 338 624 363 624 364 625 365 625 339 625 365 626 340 626 339 626 365 627 342 627 340 627 340 628 342 628 341 628 342 629 343 629 341 629 342 630 345 630 343 630 343 631 345 631 344 631 345 632 346 632 344 632 345 633 351 633 346 633 346 634 351 634 347 634 351 635 348 635 347 635 351 636 349 636 348 636 349 637 351 637 350 637 351 638 352 638 350 638 351 639 354 639 352 639 352 640 354 640 353 640 354 641 355 641 353 641 354 642 357 642 355 642 355 643 357 643 356 643 357 644 358 644 356 644 357 645 358 645 359 645 359 646 358 646 360 646 359 647 360 647 363 647 363 648 360 648 362 648 363 649 362 649 361 649 372 650 370 650 373 650 390 651 366 651 391 651 366 652 390 652 367 652 390 653 368 653 367 653 390 654 370 654 368 654 370 655 369 655 368 655 370 656 372 656 369 656 375 657 371 657 377 657 371 658 373 658 377 658 371 659 374 659 373 659 374 660 372 660 373 660 375 661 377 661 376 661 377 662 378 662 376 662 377 663 380 663 378 663 378 664 380 664 379 664 380 665 381 665 379 665 380 666 385 666 381 666 385 667 382 667 381 667 385 668 383 668 382 668 383 669 385 669 384 669 385 670 386 670 384 670 385 671 389 671 386 671 389 672 388 672 386 672 389 673 388 673 387 673 559 708 557 708 593 708 595 708 6 787 26 787 3 787 6 788 22 788 26 788 8 789 22 789 6 789 8 790 20 790 22 790 11 791 20 791 8 791 11 792 18 792 20 792 25 793 0 793 2 793 1 794 24 794 4 794 9 795 19 795 10 795 7 796 19 796 9 796 7 797 21 797 19 797 5 798 21 798 7 798 5 799 23 799 21 799 23 800 4 800 24 800 5 801 4 801 23 801 10 802 15 802 12 802 18 803 13 803 14 803 11 804 13 804 18 804 3 805 25 805 2 805 26 806 25 806 3 806 16 807 15 807 17 807 162 808 13 808 161 808 161 809 13 809 75 809 284 810 76 810 16 810 284 811 16 811 285 811 285 812 16 812 17 812 285 813 17 813 277 813 277 814 17 814 404 814 162 815 402 815 14 815 162 816 14 816 13 816 4 817 76 817 84 817 84 818 124 818 126 818 107 819 117 819 119 819 75 820 2 820 120 820 120 821 2 821 107 821 35 822 111 822 36 822 36 823 111 823 116 823 78 824 81 824 40 824 63 825 224 825 209 825 63 826 209 826 64 826 75 827 13 827 11 827 2 828 75 828 3 828 3 829 75 829 11 829 3 830 11 830 6 830 6 831 11 831 8 831 12 832 15 832 16 832 16 833 76 833 12 833 12 834 76 834 4 834 12 835 4 835 9 835 9 836 4 836 5 836 9 837 5 837 7 837 9 838 10 838 12 838 85 839 81 839 78 839 92 840 401 840 1 840 92 841 1 841 88 841 88 842 1 842 4 842 88 843 4 843 84 843 105 844 107 844 2 844 2 845 0 845 105 845 105 846 0 846 400 846 111 847 112 847 113 847 111 848 113 848 116 848 209 849 224 849 225 849 163 850 119 850 117 850 126 851 124 851 149 851 210 852 209 852 225 852 550 859 548 859 407 859 409 859 544 860 543 860 402 860 403 860 545 868 534 868 570 868 581 868 423 869 420 869 561 869 564 869 590 919 588 919 552 919 554 919 558 920 556 920 415 920 417 920 530 921 385 921 380 921 530 922 337 922 363 922 530 923 354 923 351 923 530 924 390 924 393 924 530 925 334 925 330 925 530 926 363 926 359 926 530 927 327 927 324 927 530 928 357 928 354 928 530 929 324 929 319 929 530 930 345 930 342 930 530 931 359 931 357 931 530 932 377 932 373 932 530 933 319 933 315 933 389 934 530 934 387 934 530 935 365 935 387 935 530 936 373 936 370 936 530 937 330 937 327 937 365 938 530 938 342 938 530 939 380 939 377 939 530 940 393 940 334 940 337 941 530 941 315 941 530 942 351 942 345 942 390 943 530 943 370 943 530 944 389 944 385 944 395 947 574 947 538 947 531 947 414 948 412 948 553 948 555 948 1 949 401 949 542 949 531 949 536 950 535 950 19 950 21 950 560 951 558 951 417 951 419 951 541 952 539 952 397 952 400 952 25 953 26 953 644 953 535 954 532 954 10 954 19 954 476 955 477 955 567 955 566 955 422 956 423 956 564 956 563 956 406 957 404 957 545 957 547 957 552 958 550 958 409 958 411 958 416 959 414 959 555 959 557 959 531 960 538 960 24 960 1 960 537 961 536 961 21 961 23 961 562 962 560 962 419 962 421 962 401 963 399 963 540 963 542 963 408 964 406 964 547 964 549 964 554 965 552 965 411 965 413 965 400 966 0 966 479 966 541 966 533 967 534 967 17 967 15 967 418 968 416 968 557 968 559 968 23 969 24 969 538 969 537 969 475 970 476 970 566 970 565 970 421 971 422 971 563 971 562 971 546 972 544 972 403 972 405 972 404 973 17 973 534 973 545 973 410 974 408 974 549 974 551 974 556 975 554 975 413 975 415 975 532 976 533 976 15 976 10 976 420 977 418 977 559 977 561 977 409 978 475 978 565 978 550 978 477 979 478 979 568 979 567 979 548 980 546 980 405 980 407 980 412 981 410 981 551 981 553 981 587 982 585 982 624 982 626 982 605 983 608 983 569 983 394 983 602 984 603 984 642 984 641 984 621 985 619 985 580 985 582 985 598 986 599 986 638 986 637 986 595 987 593 987 632 987 634 987 581 988 570 988 609 988 620 988 573 989 572 989 536 989 537 989 562 990 563 990 599 990 598 990 582 991 580 991 544 991 546 991 566 992 567 992 603 992 602 992 394 993 569 993 533 993 532 993 551 994 549 994 585 994 587 994 396 995 577 995 541 995 479 995 592 996 590 996 554 996 556 996 561 997 559 997 595 997 597 997 537 998 538 998 574 998 573 998 584 999 582 999 546 999 548 999 571 1000 394 1000 532 1000 535 1000 553 1001 551 1001 587 1001 589 1001 594 1002 592 1002 556 1002 558 1002 564 1003 561 1003 597 1003 600 1003 580 1004 579 1004 543 1004 544 1004 565 1005 566 1005 602 1005 601 1005 569 1006 570 1006 534 1006 533 1006 586 1007 584 1007 548 1007 550 1007 555 1008 553 1008 589 1008 591 1008 550 1009 565 1009 601 1009 586 1009 596 1010 594 1010 558 1010 560 1010 577 1011 575 1011 539 1011 541 1011 644 1012 22 1012 20 1012 563 1013 564 1013 600 1013 599 1013 547 1014 545 1014 581 1014 583 1014 567 1015 568 1015 604 1015 603 1015 572 1016 571 1016 535 1016 536 1016 588 1017 586 1017 550 1017 552 1017 531 1018 542 1018 578 1018 395 1018 557 1019 555 1019 591 1019 593 1019 598 1020 596 1020 560 1020 562 1020 542 1021 540 1021 576 1021 578 1021 549 1022 547 1022 583 1022 585 1022 607 1023 616 1023 577 1023 396 1023 631 1024 629 1024 590 1024 592 1024 597 1025 595 1025 634 1025 636 1025 623 1026 621 1026 582 1026 584 1026 610 1027 605 1027 394 1027 571 1027 589 1028 587 1028 626 1028 628 1028 573 1029 574 1029 613 1029 612 1029 633 1030 631 1030 592 1030 594 1030 611 1031 610 1031 571 1031 572 1031 600 1032 597 1032 636 1032 639 1032 619 1033 618 1033 579 1033 580 1033 601 1034 602 1034 641 1034 640 1034 608 1035 609 1035 570 1035 569 1035 625 1036 623 1036 584 1036 586 1036 591 1037 589 1037 628 1037 630 1037 612 1038 611 1038 572 1038 573 1038 586 1039 601 1039 640 1039 625 1039 635 1040 633 1040 594 1040 596 1040 616 1041 614 1041 575 1041 577 1041 599 1042 600 1042 639 1042 638 1042 583 1043 581 1043 620 1043 622 1043 603 1044 604 1044 643 1044 642 1044 627 1045 625 1045 586 1045 588 1045 607 1046 25 1046 644 1046 395 1047 578 1047 617 1047 606 1047 593 1048 591 1048 630 1048 632 1048 637 1049 635 1049 596 1049 598 1049 578 1050 576 1050 615 1050 617 1050 585 1051 583 1051 622 1051 624 1051 606 1052 613 1052 574 1052 395 1052 629 1053 627 1053 588 1053 590 1053 396 1054 25 1054 607 1054 644 1055 615 1055 398 1055 398 1056 615 1056 576 1056 614 1057 398 1057 575 1057 398 1058 540 1058 399 1058 644 1059 398 1059 614 1059 398 1060 576 1060 540 1060 539 1061 398 1061 397 1061 575 1063 398 1063 539 1063 622 1065 620 1065 644 1065 638 1066 639 1066 644 1066 644 1067 614 1067 616 1067 644 1068 633 1068 635 1068 625 1069 644 1069 640 1069 644 1070 611 1070 612 1070 630 1071 628 1071 644 1071 642 1072 643 1072 644 1072 644 1073 625 1073 627 1073 479 1074 25 1074 396 1074 606 1075 617 1075 644 1075 632 1076 630 1076 644 1076 644 1077 635 1077 637 1077 617 1078 615 1078 644 1078 624 1079 622 1079 644 1079 644 1080 613 1080 606 1080 644 1081 627 1081 629 1081 0 1082 25 1082 479 1082 620 1083 609 1083 644 1083 634 1084 632 1084 644 1084 637 1085 638 1085 644 1085 644 1086 619 1086 621 1086 641 1087 642 1087 644 1087 644 1088 608 1088 605 1088 626 1089 624 1089 644 1089 644 1090 616 1090 607 1090 644 1091 629 1091 631 1091 636 1092 634 1092 644 1092 644 1093 621 1093 623 1093 644 1094 605 1094 610 1094 628 1095 626 1095 644 1095 612 1096 613 1096 644 1096 644 1097 631 1097 633 1097 644 1098 610 1098 611 1098 639 1099 636 1099 644 1099 644 1100 618 1100 619 1100 640 1101 641 1101 644 1101 644 1102 609 1102 608 1102 644 1103 623 1103 625 1103 26 1128 22 1128 644 1128 644 1129 18 1129 20 1129 543 1130 14 1130 402 1130 478 1131 14 1131 568 1131 568 1132 14 1132 604 1132 579 1133 14 1133 543 1133 604 1134 14 1134 643 1134 618 1135 14 1135 579 1135 643 1136 14 1136 644 1136 644 1137 14 1137 618 1137 18 1138 14 1138 644 1138

+
+ + + + 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 +

453 674 526 674 528 674 453 675 503 675 524 675 453 676 449 676 503 676 503 677 449 677 466 677 529 678 528 678 520 678 523 679 521 679 522 679 483 680 481 680 468 680 467 681 469 681 457 681 430 682 432 682 439 682 439 683 441 683 430 683 466 684 456 684 468 684 426 685 424 685 441 685 441 686 424 686 430 686 520 687 514 687 522 687 497 688 524 688 503 688 498 689 515 689 500 689 505 690 516 690 501 690 501 691 516 691 508 691 501 692 508 692 491 692 491 693 508 693 493 693 491 694 493 694 489 694 489 695 493 695 487 695 516 696 518 696 508 696 508 697 518 697 510 697 508 698 510 698 493 698 493 699 510 699 495 699 493 700 495 700 487 700 487 701 495 701 485 701 518 702 522 702 510 702 510 703 522 703 514 703 510 704 514 704 495 704 495 705 514 705 499 705 495 706 499 706 485 706 485 707 499 707 483 707 472 709 487 709 485 709 472 710 485 710 470 710 470 711 485 711 483 711 470 712 483 712 468 712 506 713 507 713 517 713 516 714 505 714 506 714 506 715 517 715 516 715 516 716 517 716 519 716 516 717 519 717 518 717 518 718 519 718 523 718 518 719 523 719 522 719 464 720 472 720 460 720 464 721 460 721 451 721 451 722 460 722 444 722 451 723 444 723 446 723 446 724 444 724 436 724 472 725 470 725 460 725 460 726 470 726 458 726 460 727 458 727 444 727 444 728 458 728 442 728 444 729 442 729 436 729 436 730 442 730 434 730 470 731 468 731 458 731 458 732 468 732 456 732 458 733 456 733 442 733 442 734 456 734 439 734 442 735 439 735 434 735 434 736 439 736 432 736 490 737 488 737 492 737 492 738 488 738 494 738 492 739 494 739 502 739 502 740 494 740 509 740 502 741 509 741 507 741 507 742 509 742 517 742 488 743 486 743 494 743 494 744 486 744 496 744 494 745 496 745 509 745 509 746 496 746 511 746 509 747 511 747 517 747 517 748 511 748 519 748 486 749 484 749 496 749 496 750 484 750 500 750 496 751 500 751 511 751 511 752 500 752 515 752 511 753 515 753 519 753 519 754 515 754 523 754 447 755 446 755 436 755 437 756 448 756 447 756 447 757 436 757 437 757 437 758 436 758 434 758 437 759 434 759 435 759 435 760 434 760 432 760 435 761 432 761 433 761 480 762 474 762 473 762 488 763 490 763 480 763 480 764 473 764 488 764 488 765 473 765 471 765 488 766 471 766 486 766 486 767 471 767 469 767 486 768 469 768 484 768 448 769 437 769 452 769 452 770 437 770 445 770 452 771 445 771 465 771 465 772 445 772 461 772 465 773 461 773 474 773 474 774 461 774 473 774 437 775 435 775 445 775 445 776 435 776 443 776 445 777 443 777 461 777 461 778 443 778 459 778 461 779 459 779 473 779 473 780 459 780 471 780 435 781 433 781 443 781 443 782 433 782 440 782 443 783 440 783 459 783 459 784 440 784 457 784 459 785 457 785 471 785 471 786 457 786 469 786 529 853 527 853 453 853 450 854 429 854 453 854 528 855 529 855 453 855 429 856 427 856 453 856 525 857 504 857 453 857 504 858 450 858 453 858 453 861 425 861 424 861 453 862 428 862 449 862 453 863 426 863 428 863 453 864 424 864 426 864 527 865 525 865 453 865 453 866 524 866 526 866 427 867 425 867 453 867 503 870 466 870 481 870 529 871 520 871 521 871 424 872 425 872 431 872 424 873 431 873 430 873 469 874 467 874 484 874 484 875 467 875 482 875 522 876 521 876 520 876 468 877 481 877 466 877 432 878 430 878 433 878 433 879 430 879 431 879 440 880 438 880 457 880 457 881 438 881 454 881 457 882 454 882 467 882 438 883 440 883 431 883 431 884 440 884 433 884 438 885 431 885 425 885 438 886 425 886 427 886 438 887 427 887 454 887 454 888 427 888 429 888 454 889 429 889 450 889 454 890 450 890 467 890 456 891 455 891 439 891 439 892 455 892 441 892 455 893 456 893 466 893 455 894 466 894 449 894 455 895 449 895 428 895 455 896 428 896 441 896 441 897 428 897 426 897 481 898 483 898 499 898 514 899 512 899 499 899 499 900 512 900 497 900 499 901 497 901 481 901 512 902 514 902 520 902 512 903 520 903 528 903 512 904 528 904 526 904 512 905 526 905 497 905 497 906 526 906 524 906 497 907 503 907 481 907 525 908 498 908 504 908 504 909 498 909 482 909 529 910 521 910 527 910 527 911 521 911 513 911 498 912 525 912 527 912 498 913 527 913 513 913 498 914 513 914 515 914 515 915 513 915 523 915 523 916 513 916 521 916 498 917 500 917 482 917 482 918 500 918 484 918 462 945 489 945 487 945 462 946 487 946 472 946 472 1062 463 1062 462 1062 463 1064 472 1064 464 1064 645 1104 450 1104 504 1104 504 1105 482 1105 645 1105 482 1106 467 1106 645 1106 467 1107 450 1107 645 1107 646 1108 452 1108 465 1108 489 1109 462 1109 646 1109 646 1110 506 1110 505 1110 646 1111 465 1111 474 1111 463 1112 464 1112 646 1112 447 1113 448 1113 646 1113 646 1114 492 1114 502 1114 646 1115 490 1115 492 1115 646 1116 502 1116 507 1116 646 1117 448 1117 452 1117 646 1118 507 1118 506 1118 446 1119 447 1119 646 1119 462 1120 463 1120 646 1120 501 1121 491 1121 646 1121 505 1122 501 1122 646 1122 451 1123 446 1123 646 1123 646 1124 480 1124 490 1124 646 1125 474 1125 480 1125 491 1126 489 1126 646 1126 464 1127 451 1127 646 1127

+
+
+ 1 +
+
+ + + + 7.481132 -6.50764 5.343665 + 0 0 1 46.69194 + 0 1 0 0.619768 + 1 0 0 63.5593 + 1 1 1 + + + + 4.076245 1.005454 5.903862 + 0 0 1 106.9363 + 0 1 0 3.163707 + 1 0 0 37.26105 + 1 1 1 + + + + 0 0 0 + 0 0 1 0 + 0 1 0 0 + 1 0 0 90.00001 + 1 1 1 + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/Coordinates b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/Coordinates new file mode 100644 index 000000000..6fba9d215 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/Coordinates @@ -0,0 +1,20 @@ +========================================= +Location Coordinates (x,y,z) +========================================= + +Chassis : -0.045 0 0.148 +Top : -0.045 0 0.234 + +Swivel : -0.185 0 0.055 +Center Hubcap : -0.211 0 0.037 +Center Wheel : -0.211 0 0.038 + +Right Hubcap : 0 0.158 0.091 +Right Wheel : 0 0.158 0.091 + +Left Hubcap : 0 -0.158 0.091 +Left Wheel : 0 -0.158 0.091 + +Front Sonar : -0.2 0 0.209 +Back Sonar : 0.109 0 0.209 + diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/back_rim.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/back_rim.stl new file mode 100644 index 000000000..09587a535 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/back_rim.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/back_sonar.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/back_sonar.stl new file mode 100644 index 000000000..9153bc5eb Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/back_sonar.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/center_hubcap.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/center_hubcap.stl new file mode 100644 index 000000000..c9400f7d2 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/center_hubcap.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/center_wheel.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/center_wheel.stl new file mode 100644 index 000000000..c8b857dc5 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/center_wheel.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/chassis.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/chassis.stl new file mode 100644 index 000000000..13aa2cf73 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/chassis.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/front_rim.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/front_rim.stl new file mode 100644 index 000000000..c3074d5c0 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/front_rim.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/front_sonar.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/front_sonar.stl new file mode 100644 index 000000000..82b9ce0d9 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/front_sonar.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/left_hubcap.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/left_hubcap.stl new file mode 100644 index 000000000..01bd2f93f Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/left_hubcap.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/left_wheel.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/left_wheel.stl new file mode 100644 index 000000000..31137e2d5 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/left_wheel.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/right_hubcap.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/right_hubcap.stl new file mode 100644 index 000000000..ac3f36f93 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/right_hubcap.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/right_wheel.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/right_wheel.stl new file mode 100644 index 000000000..c518c0eb5 Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/right_wheel.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/swivel.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/swivel.stl new file mode 100644 index 000000000..03797a26a Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/swivel.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/top.stl b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/top.stl new file mode 100644 index 000000000..302ed5f4b Binary files /dev/null and b/gazebo_plugins/test/multi_robot_scenario/meshes/p3dx/top.stl differ diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/camera/camera.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/camera/camera.xacro new file mode 100644 index 000000000..8755051be --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/camera/camera.xacro @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30.0 + + 1.3962634 + + 800 + 800 + R8G8B8 + + + 0.02 + 300 + + + gaussian + + 0.0 + 0.007 + + + + + true + 0.0 + ${name} + image_raw + camera_info + ${name} + 0.07 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo.xacro new file mode 100644 index 000000000..1e20f0905 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo.xacro @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 + + + + + 1 + 2.0944 + -2.0944 + 683 + + + + 0.08 + 5 + 0.01 + + + + + + ${name}/scan + ${name} + + + + 1 + 30 + true + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo_gpu.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo_gpu.xacro new file mode 100644 index 000000000..68c65960f --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/laser/hokuyo_gpu.xacro @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 + 1 + 30 + true + + + + + 1 + 2.0944 + -2.0944 + + + 683 + + + + 0.10 + 140.0 + 0.01 + + + gaussian + + 0.0 + 0.01 + + + + + ${name}/scan + ${name} + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/materials.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/materials.xacro new file mode 100644 index 000000000..311c3cdd8 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/materials.xacro @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/battery_block.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/battery_block.xacro new file mode 100644 index 000000000..7881c8e86 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/battery_block.xacro @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/inertia_tensors.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/inertia_tensors.xacro new file mode 100644 index 000000000..c7649ea01 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/inertia_tensors.xacro @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx.xacro new file mode 100644 index 000000000..9b1fd95bd --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx.xacro @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_body.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_body.xacro new file mode 100644 index 000000000..4b2163480 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_body.xacro @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_chassis.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_chassis.xacro new file mode 100644 index 000000000..ec3c233a9 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_chassis.xacro @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_plugins.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_plugins.xacro new file mode 100644 index 000000000..7b5f860c4 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_plugins.xacro @@ -0,0 +1,39 @@ + + + + + + + + chassis_swivel_joint, swivel_wheel_joint, left_hub_joint, right_hub_joint + 10.0 + true + + + + + + + + Debug + + false + true + true + left_hub_joint + right_hub_joint + 0.3 + 0.18 + 20 + 1.8 + cmd_vel + odom + odom + world + base_link + 10.0 + + + + + diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_sonar.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_sonar.xacro new file mode 100644 index 000000000..5d0dc3efa --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_sonar.xacro @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_swivel.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_swivel.xacro new file mode 100644 index 000000000..f4530e276 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_swivel.xacro @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_wheel.xacro b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_wheel.xacro new file mode 100644 index 000000000..b323befb8 --- /dev/null +++ b/gazebo_plugins/test/multi_robot_scenario/xacro/p3dx/pioneer3dx_wheel.xacro @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/test_worlds/gazebo_ros_block_laser.world b/gazebo_plugins/test/test_worlds/gazebo_ros_block_laser.world index 68b765d12..905b3fc5a 100644 --- a/gazebo_plugins/test/test_worlds/gazebo_ros_block_laser.world +++ b/gazebo_plugins/test/test_worlds/gazebo_ros_block_laser.world @@ -36,7 +36,6 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 1.0 0.0 @@ -54,10 +53,12 @@ 0.05 0.05 0.05 + true 100.0 @@ -143,7 +144,6 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 1.0 0.0 @@ -161,10 +161,12 @@ 0.05 0.05 0.05 + true 100.0 @@ -245,7 +247,6 @@ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 1.0 0.0 @@ -260,14 +261,16 @@ 0.0 0.1 0.0 0.0 0.0 0.0 - pr2/gripper_v0/l_finger_tip.stl + pr2/gripper_v0/l_finger_tip.stl 3 3 3 + true 100.0 @@ -276,7 +279,7 @@ 250 - pr2/gripper_v0/l_finger_tip.stl + pr2/gripper_v0/l_finger_tip.stl 3 3 3 @@ -311,7 +314,7 @@ 0.0 -0.1 0.0 0.0 0.0 0.0 - pr2/gripper_v0/l_finger_tip.dae + pr2/gripper_v0/l_finger_tip.dae 3 3 3 @@ -323,7 +326,7 @@ 250 - pr2/gripper_v0/l_finger_tip.dae + pr2/gripper_v0/l_finger_tip.dae 3 3 3 @@ -366,7 +369,6 @@ -0.1 -0.5 -0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 1.0 0.0 @@ -384,10 +386,12 @@ 0.1 0.25 0.5 + true 100.0 @@ -434,7 +438,6 @@ 0.0 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 1.0 0.0 @@ -452,10 +455,12 @@ 0.05 + true 100.0 @@ -502,7 +507,6 @@ 0.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 1.0 0.0 @@ -521,10 +525,12 @@ 0.5 + true 100.0 @@ -588,7 +594,7 @@ - chair/models/Chair.stl + chair/models/Chair.stl 0.0254 0.0254 0.0254 @@ -621,7 +627,7 @@ - chair/models/Chair.dae + chair/models/Chair.dae 0.0254 0.0254 0.0254 diff --git a/gazebo_plugins/test/tricycle_drive/launch/.directory b/gazebo_plugins/test/tricycle_drive/launch/.directory new file mode 100644 index 000000000..b0371cd66 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/launch/.directory @@ -0,0 +1,4 @@ +[Dolphin] +Timestamp=2013,11,4,9,14,4 +Version=3 +ViewMode=2 diff --git a/gazebo_plugins/test/tricycle_drive/launch/tricycle.gazebo.launch b/gazebo_plugins/test/tricycle_drive/launch/tricycle.gazebo.launch new file mode 100644 index 000000000..1673b7882 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/launch/tricycle.gazebo.launch @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/launch/tricycle.rviz b/gazebo_plugins/test/tricycle_drive/launch/tricycle.rviz new file mode 100644 index 000000000..49c0fc84f --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/launch/tricycle.rviz @@ -0,0 +1,237 @@ +Panels: + - Class: rviz/Displays + Help Height: 84 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /Marker1 + - /Marker1/Namespaces1 + - /LaserScan1 + Splitter Ratio: 0.590385 + Tree Height: 690 + - Class: rviz/Selection + Name: Selection + - Class: rviz/Tool Properties + Expanded: + - /2D Pose Estimate1 + - /2D Nav Goal1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.588679 + - Class: rviz/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: "" +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.03 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + base_link: + Value: true + r1/base_link: + Value: true + r1/chassis: + Value: true + r1/front_steering: + Value: true + r1/front_wheel: + Value: true + r1/left_wheel: + Value: true + r1/odom: + Value: true + r1/right_wheel: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: true + Tree: + base_link: + r1/odom: + r1/base_link: + r1/chassis: + {} + r1/front_steering: + r1/front_wheel: + {} + r1/left_wheel: + {} + r1/right_wheel: + {} + Update Interval: 0 + Value: true + - Class: rviz/Marker + Enabled: true + Marker Topic: visualization_marker + Name: Marker + Namespaces: + {} + Queue Size: 100 + Value: true + - Alpha: 1 + Class: rviz/RobotModel + Collision Enabled: false + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + chassis: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_steering: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Name: RobotModel + Robot Description: r1/robot_description + TF Prefix: r1 + Update Interval: 0 + Value: true + Visual Enabled: true + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 0 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: LaserScan + Position Transformer: XYZ + Queue Size: 10 + Selectable: true + Size (Pixels): 3 + Size (m): 0.01 + Style: Flat Squares + Topic: /r1/front_laser/scan + Use Fixed Frame: true + Use rainbow: true + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: r1/base_link + Frame Rate: 30 + Name: root + Tools: + - Class: rviz/Interact + Hide Inactive Objects: true + - Class: rviz/MoveCamera + - Class: rviz/Select + - Class: rviz/FocusCamera + - Class: rviz/Measure + - Class: rviz/SetInitialPose + Topic: /initialpose + - Class: rviz/SetGoal + Topic: /move_base_simple/goal + - Class: rviz/PublishPoint + Single click: true + Topic: /clicked_point + Value: true + Views: + Current: + Class: rviz/Orbit + Distance: 7.43455 + Enable Stereo Rendering: + Stereo Eye Separation: 0.06 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0.351517 + Y: 0.0334811 + Z: 0.722431 + Name: Current View + Near Clip Distance: 0.01 + Pitch: 0.234797 + Target Frame: + Value: Orbit (rviz) + Yaw: 4.99819 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 1054 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd00000004000000000000010f0000036bfc020000000bfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c00610079007301000000450000034c000000ee00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d0065007200610100000397000000190000001900000019fb0000000c00430061006d00650072006103000003360000023100000250000001b3fb0000000c00430061006d00650072006101000002c5000000c80000000000000000000000010000010f0000036bfc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a0056006900650077007301000000450000036b000000c100fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000068e00000046fc0100000002fb0000000800540069006d006501000000000000068e0000038b00fffffffb0000000800540069006d00650100000000000004500000000000000000000004640000036b00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1678 + X: 1920 + Y: 0 diff --git a/gazebo_plugins/test/tricycle_drive/launch/tricycle.urdf.launch b/gazebo_plugins/test/tricycle_drive/launch/tricycle.urdf.launch new file mode 100644 index 000000000..c909ff523 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/launch/tricycle.urdf.launch @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/launch/tricycle_drive_scenario.launch b/gazebo_plugins/test/tricycle_drive/launch/tricycle_drive_scenario.launch new file mode 100644 index 000000000..e3a48b5be --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/launch/tricycle_drive_scenario.launch @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/launch/tricycle_rviz.launch b/gazebo_plugins/test/tricycle_drive/launch/tricycle_rviz.launch new file mode 100644 index 000000000..d2d5b2d8e --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/launch/tricycle_rviz.launch @@ -0,0 +1,6 @@ + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/xacro/.directory b/gazebo_plugins/test/tricycle_drive/xacro/.directory new file mode 100644 index 000000000..b41f2a18a --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/.directory @@ -0,0 +1,3 @@ +[Dolphin] +Timestamp=2013,10,18,16,23,17 +ViewMode=2 diff --git a/gazebo_plugins/test/tricycle_drive/xacro/materials.xacro b/gazebo_plugins/test/tricycle_drive/xacro/materials.xacro new file mode 100644 index 000000000..f260fff42 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/materials.xacro @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/inertia_tensors.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/inertia_tensors.xacro new file mode 100644 index 000000000..15874715a --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/inertia_tensors.xacro @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle.xacro new file mode 100644 index 000000000..81119279e --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle.xacro @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_body.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_body.xacro new file mode 100644 index 000000000..6c9371ca7 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_body.xacro @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_chassis.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_chassis.xacro new file mode 100644 index 000000000..1feeaf799 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_chassis.xacro @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_plugins.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_plugins.xacro new file mode 100644 index 000000000..ef5494e27 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/tricycle_plugins.xacro @@ -0,0 +1,36 @@ + + + + + + + + Debug + + false + true + true + front_steering_joint + front_wheel_joint + left_wheel_joint + right_wheel_joint + 0.135 + 0.135 + 0.548 + cmd_vel + odom + odom + encoder + base_link + 10.0 + 1.8 + 5.0 + 0.05 + 20 + 0.4 + 0.02 + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/wheel.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/wheel.xacro new file mode 100644 index 000000000..691aa0c0c --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/wheel.xacro @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_plugins/test/tricycle_drive/xacro/tricycle/wheel_actuated.xacro b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/wheel_actuated.xacro new file mode 100644 index 000000000..0acacc810 --- /dev/null +++ b/gazebo_plugins/test/tricycle_drive/xacro/tricycle/wheel_actuated.xacro @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gazebo_ros/CHANGELOG.rst b/gazebo_ros/CHANGELOG.rst index bc432e6b6..5ed8b310e 100644 --- a/gazebo_ros/CHANGELOG.rst +++ b/gazebo_ros/CHANGELOG.rst @@ -2,13 +2,99 @@ Changelog for package gazebo_ros ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.4.6 (2014-09-01) +------------------ +* Merge pull request `#232 `_ from ros-simulation/fix_get_physics_properties_non_ode + Fix get physics properties non ode +* Merge pull request `#183 `_ from ros-simulation/issue_182 + Fix STL iterator errors, misc. cppcheck (`#182 `_) +* check physics engine type before calling set_physics_properties and get_physics_properteis +* check physics engine type before calling set_physics_properties and get_physics_properteis +* Fixes for calling GetParam() with different physic engines. +* 2.3.6 +* Update changelogs for the upcoming release +* Fixed boost any cast +* Removed a few warnings +* Update for hydro + gazebo 1.9 +* Fix build with gazebo4 and indigo +* Fix STL iterator errors, misc. cppcheck (`#182 `_) + There were some errors in STL iterators. + Initialized values of member variables in constructor. + Removed an unused variable (model_name). +* Contributors: Carlos Agüero, John Hsu, Jose Luis Rivero, Nate Koenig, Steven Peters, hsu, osrf + +2.4.5 (2014-08-18) +------------------ +* Port fix_build branch for indigo-devel + See pull request `#221 `_ +* Contributors: Jose Luis Rivero + +2.4.4 (2014-07-18) +------------------ +* Fix repo names in package.xml's +* fix issue `#198 `_ + Operator ``==`` is not recognized by sh scripts. +* Add verbose parameter + Add verbose parameter for --verbose gazebo flag +* added osx support for gazebo start scripts +* Contributors: Arn-O, Jon Binney, Markus Achtelik, Vincenzo Comito + +2.4.3 (2014-05-12) +------------------ +* added osx support for gazebo start scripts +* Remove gazebo_ros dependency on gazebo_plugins +* Contributors: Markus Achtelik, Steven Peters + +2.4.2 (2014-03-27) +------------------ +* merging from hydro-devel +* bump patch version for indigo-devel to 2.4.1 +* merging from indigo-devel after 2.3.4 release +* "2.4.0" +* catkin_generate_changelog +* Contributors: John Hsu + +2.4.1 (2013-11-13) +------------------ + +2.3.5 (2014-03-26) +------------------ +* gazebo_ros: [less-than-minor] fix newlines +* gazebo_ros: remove assignment to self + If this is needed for any twisted reason, it should be made clear + anyway. Assuming this line is harmless and removing it because it + generates cppcheck warnings. +* Contributors: Paul Mathieu + +2.3.4 (2013-11-13) +------------------ +* rerelease because sdformat became libsdformat, but we also based change on 2.3.4 in hydro-devel. +* remove debug statement +* fix sdf spawn with initial pose +* fix sdf spawn with initial pose +* Merge branch 'hydro-devel' into ``spawn_model_pose_fix`` +* fix indentation +* Merge pull request `#142 `_ from hsu/hydro-devel + fix issue `#38 `_, gui segfault on model deletion +* Merge pull request `#140 `_ from ``v4hn/spawn_model_sleep`` + replace time.sleep by rospy.Rate.sleep +* fix spawn initial pose. When model has a non-zero initial pose and user specified initial model spawn pose, add the two. +* fix issue `#38 `_, gui segfault on model deletion by removing an obsolete call to set selected object state to "normal". +* replace time.sleep by rospy.Rate.sleep + time was not even imported, so I don't know + why this could ever have worked... +* Add time import + When using the -wait option the script fails because is missing the time import +* Use pre-increment for iterators +* Fix iterator erase() problems + 2.4.0 (2013-10-14) ------------------ 2.3.3 (2013-10-10) ------------------ * Cleaned up unnecessary debug output that was recently added -* Fixed issue where catkin_find returns more than one library if it is installed from both source and debian +* Fixed issue where ``catkin_find`` returns more than one library if it is installed from both source and debian 2.3.2 (2013-09-19) ------------------ diff --git a/gazebo_ros/CMakeLists.txt b/gazebo_ros/CMakeLists.txt index 6595c14b2..1c2ab2a51 100644 --- a/gazebo_ros/CMakeLists.txt +++ b/gazebo_ros/CMakeLists.txt @@ -49,7 +49,6 @@ catkin_package( message_generation std_msgs gazebo_msgs - gazebo_plugins DEPENDS TinyXML diff --git a/gazebo_ros/launch/empty_world.launch b/gazebo_ros/launch/empty_world.launch index 2e02d7bcc..45b11270f 100644 --- a/gazebo_ros/launch/empty_world.launch +++ b/gazebo_ros/launch/empty_world.launch @@ -6,6 +6,7 @@ + @@ -18,12 +19,14 @@ + + + args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) $(arg world_name)" /> diff --git a/gazebo_ros/package.xml b/gazebo_ros/package.xml index abc42de64..96d5de47c 100644 --- a/gazebo_ros/package.xml +++ b/gazebo_ros/package.xml @@ -1,7 +1,7 @@ gazebo_ros - 2.4.0 + 2.4.6 Provides ROS plugins that offer message and service publishers for interfacing with Gazebo through ROS. Formally simulator_gazebo/gazebo @@ -13,8 +13,8 @@ Apache 2.0 http://gazebosim.org/wiki/Tutorials#ROS_Integration - https://github.com/osrf/gazebo_ros_pkgs/issues - https://github.com/osrf/gazebo_ros_pkgs + https://github.com/ros-simulation/gazebo_ros_pkgs/issues + https://github.com/ros-simulation/gazebo_ros_pkgs John Hsu Nate Koenig @@ -25,7 +25,6 @@ cmake_modules gazebo gazebo_msgs - gazebo_plugins roslib roscpp tf @@ -40,7 +39,6 @@ gazebo gazebo_msgs - gazebo_plugins roslib roscpp tf diff --git a/gazebo_ros/scripts/debug b/gazebo_ros/scripts/debug index f9a58f8d7..37cd902de 100755 --- a/gazebo_ros/scripts/debug +++ b/gazebo_ros/scripts/debug @@ -1,16 +1,21 @@ #!/bin/sh final="$@" +EXT=so +if [ $(uname) == "Darwin" ]; then + EXT=dylib +fi + # add ros path plugin if it does not already exist in the passed in arguments -if [ `expr "$final" : '.*libgazebo_ros_paths_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_paths_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.$EXT`" fi # add ros api plugin if it does not already exist in the passed in arguments -if [ `expr "$final" : '.*libgazebo\_ros\_api\_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_api_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.$EXT`" fi setup_path=$(pkg-config --variable=prefix gazebo)/share/gazebo/ diff --git a/gazebo_ros/scripts/gazebo b/gazebo_ros/scripts/gazebo index 1ea3788b4..d994be4c9 100755 --- a/gazebo_ros/scripts/gazebo +++ b/gazebo_ros/scripts/gazebo @@ -1,19 +1,24 @@ #!/bin/sh final="$@" +EXT=so +if [ $(uname) = "Darwin" ]; then + EXT=dylib +fi + # add ros path plugin if it does not already exist in the passed in arguments -if [ `expr "$final" : '.*libgazebo_ros_paths_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_paths_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.$EXT`" fi # add ros api plugin if it does not already exist in the passed in arguments -if [ `expr "$final" : '.*libgazebo\_ros\_api\_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_api_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.$EXT`" fi -client_final="-g `catkin_find --first-only libgazebo_ros_paths_plugin.so`" +client_final="-g `catkin_find --first-only libgazebo_ros_paths_plugin.$EXT`" # Combine the commands setup_path=$(pkg-config --variable=prefix gazebo)/share/gazebo/ diff --git a/gazebo_ros/scripts/gdbrun b/gazebo_ros/scripts/gdbrun index 04fc9d69c..9a503846c 100755 --- a/gazebo_ros/scripts/gdbrun +++ b/gazebo_ros/scripts/gdbrun @@ -1,6 +1,6 @@ #!/bin/bash extra_text="" -if [ "$1" == "--break-main" ]; then +if [ "$1" = "--break-main" ]; then extra_text="break main" shift fi diff --git a/gazebo_ros/scripts/gzclient b/gazebo_ros/scripts/gzclient index fe5ee86aa..b56c7a9b6 100755 --- a/gazebo_ros/scripts/gzclient +++ b/gazebo_ros/scripts/gzclient @@ -1,10 +1,15 @@ #!/bin/sh final="$@" +EXT=so +if [ $(uname) = "Darwin" ]; then + EXT=dylib +fi + # add ros plugin if does not exist -if [ `expr "$final" : '.*libgazebo_ros_paths_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_paths_plugin\.$EXT.*"` -eq 0 ] then - final="$final -g `catkin_find --first-only libgazebo_ros_paths_plugin.so`" + final="$final -g `catkin_find --first-only libgazebo_ros_paths_plugin.$EXT`" fi # Combine the commands diff --git a/gazebo_ros/scripts/gzserver b/gazebo_ros/scripts/gzserver index 5f60a4692..c45a5658a 100755 --- a/gazebo_ros/scripts/gzserver +++ b/gazebo_ros/scripts/gzserver @@ -1,16 +1,21 @@ #!/bin/sh final="$@" +EXT=so +if [ $(uname) = "Darwin" ]; then + EXT=dylib +fi + # add ros path plugin if it does not already exist in the passed in arguments -if [ `expr "$final" : '.*libgazebo_ros_paths_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_paths_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.$EXT`" fi # add ros api plugin if it does not already exist in the passed in arguments -if [ `expr "$final" : '.*libgazebo\_ros\_api\_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_api_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.$EXT`" fi setup_path=$(pkg-config --variable=prefix gazebo)/share/gazebo/ diff --git a/gazebo_ros/scripts/perf b/gazebo_ros/scripts/perf index 71ec5b01f..85b63b30f 100755 --- a/gazebo_ros/scripts/perf +++ b/gazebo_ros/scripts/perf @@ -1,15 +1,20 @@ #!/bin/sh final="$@" +EXT=so +if [ $(uname) = "Darwin" ]; then + EXT=dylib +fi + # add ros plugin if does not exist -if [ `expr "$final" : '.*libgazebo_ros_paths_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_paths_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_paths_plugin.$EXT`" fi -if [ `expr "$final" : '.*libgazebo\_ros\_api\_plugin\.so.*'` -eq 0 ] +if [ `expr "$final" : ".*libgazebo_ros_api_plugin\.$EXT.*"` -eq 0 ] then - final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.so`" + final="$final -s `catkin_find --first-only libgazebo_ros_api_plugin.$EXT`" fi setup_path=$(pkg-config --variable=prefix gazebo)/share/gazebo/ diff --git a/gazebo_ros/scripts/spawn_model b/gazebo_ros/scripts/spawn_model index 1b12418c3..d1e94fca9 100755 --- a/gazebo_ros/scripts/spawn_model +++ b/gazebo_ros/scripts/spawn_model @@ -18,7 +18,7 @@ # Author: John Hsu, Dave Coleman # -import rospy, sys, os +import rospy, sys, os, time import string import warnings @@ -198,8 +198,9 @@ class SpawnModel(): if not self.wait_for_model == "": rospy.Subscriber("%s/model_states"%(self.gazebo_namespace), ModelStates, self.checkForModel) + r= rospy.Rate(10) while not rospy.is_shutdown() and not self.wait_for_model_exists: - time.sleep(0.1) + r.sleep() if rospy.is_shutdown(): sys.exit(0) diff --git a/gazebo_ros/src/gazebo_ros_api_plugin.cpp b/gazebo_ros/src/gazebo_ros_api_plugin.cpp index 81b5dd259..4decd7e63 100644 --- a/gazebo_ros/src/gazebo_ros_api_plugin.cpp +++ b/gazebo_ros/src/gazebo_ros_api_plugin.cpp @@ -21,6 +21,7 @@ */ #include +#include #include "gazebo_ros_api_plugin.h" namespace gazebo @@ -30,7 +31,9 @@ GazeboRosApiPlugin::GazeboRosApiPlugin() : physics_reconfigure_initialized_(false), world_created_(false), stop_(false), - plugin_loaded_(false) + plugin_loaded_(false), + pub_link_states_connection_count_(0), + pub_model_states_connection_count_(0) { robot_namespace_.clear(); } @@ -83,14 +86,16 @@ GazeboRosApiPlugin::~GazeboRosApiPlugin() for (std::vector::iterator iter=force_joint_jobs_.begin();iter!=force_joint_jobs_.end();) { delete (*iter); - force_joint_jobs_.erase(iter); + iter = force_joint_jobs_.erase(iter); } + force_joint_jobs_.clear(); ROS_DEBUG_STREAM_NAMED("api_plugin","ForceJointJobs deleted"); for (std::vector::iterator iter=wrench_body_jobs_.begin();iter!=wrench_body_jobs_.end();) { delete (*iter); - wrench_body_jobs_.erase(iter); + iter = wrench_body_jobs_.erase(iter); } + wrench_body_jobs_.clear(); lock_.unlock(); ROS_DEBUG_STREAM_NAMED("api_plugin","WrenchBodyJobs deleted"); @@ -117,9 +122,9 @@ void GazeboRosApiPlugin::Load(int argc, char** argv) ROS_ERROR("Something other than this gazebo_ros_api plugin started ros::init(...), command line arguments may not be parsed properly."); // check if the ros master is available - required - while(!ros::master::check()) + while(!ros::master::check()) { - ROS_WARN_STREAM_NAMED("api_plugin","No ROS master - start roscore to continue..."); + ROS_WARN_STREAM_NAMED("api_plugin","No ROS master - start roscore to continue..."); // wait 0.5 second usleep(500*1000); // can't use ROS Time here b/c node handle is not yet initialized @@ -522,9 +527,6 @@ bool GazeboRosApiPlugin::spawnURDFModel(gazebo_msgs::SpawnModel::Request &req, // get name space for the corresponding model plugins robot_namespace_ = req.robot_namespace; - // incoming robot name - std::string model_name = req.model_name; - // incoming robot model string std::string model_xml = req.model_xml; @@ -647,20 +649,20 @@ bool GazeboRosApiPlugin::spawnSDFModel(gazebo_msgs::SpawnModel::Request &req, if (isSDF(model_xml)) { updateSDFAttributes(gazebo_model_xml, model_name, initial_xyz, initial_q); - + // Walk recursively through the entire SDF, locate plugin tags and // add robotNamespace as a child with the correct namespace - if (!this->robot_namespace_.empty()) + if (!this->robot_namespace_.empty()) { // Get root element for SDF TiXmlNode* model_tixml = gazebo_model_xml.FirstChild("sdf"); - model_tixml = (!model_tixml) ? + model_tixml = (!model_tixml) ? gazebo_model_xml.FirstChild("gazebo") : model_tixml; - if (model_tixml) + if (model_tixml) { walkChildAddRobotNamespace(model_tixml); - } - else + } + else { ROS_WARN("Unable to add robot namespace to xml"); } @@ -670,18 +672,18 @@ bool GazeboRosApiPlugin::spawnSDFModel(gazebo_msgs::SpawnModel::Request &req, { updateURDFModelPose(gazebo_model_xml, initial_xyz, initial_q); updateURDFName(gazebo_model_xml, model_name); - + // Walk recursively through the entire URDF, locate plugin tags and // add robotNamespace as a child with the correct namespace - if (!this->robot_namespace_.empty()) + if (!this->robot_namespace_.empty()) { // Get root element for URDF TiXmlNode* model_tixml = gazebo_model_xml.FirstChild("robot"); - if (model_tixml) + if (model_tixml) { walkChildAddRobotNamespace(model_tixml); - } - else + } + else { ROS_WARN("Unable to add robot namespace to xml"); } @@ -731,8 +733,6 @@ bool GazeboRosApiPlugin::deleteModel(gazebo_msgs::DeleteModel::Request &req, clearJointForces(joints[i]->GetName()); } - // clear entity from selection @todo: need to clear links if selected individually - gazebo::event::Events::setSelectedEntity(req.model_name, "normal"); // send delete model request gazebo::msgs::Request *msg = gazebo::msgs::CreateRequest("entity_delete",req.model_name); request_pub_->Publish(*msg,true); @@ -1087,27 +1087,50 @@ bool GazeboRosApiPlugin::setPhysicsProperties(gazebo_msgs::SetPhysicsProperties: world_->SetPaused(true); // supported updates - gazebo::physics::PhysicsEnginePtr ode_pe = (world_->GetPhysicsEngine()); - ode_pe->SetMaxStepSize(req.time_step); - ode_pe->SetRealTimeUpdateRate(req.max_update_rate); - ode_pe->SetGravity(gazebo::math::Vector3(req.gravity.x,req.gravity.y,req.gravity.z)); - - // stuff only works in ODE right now - ode_pe->SetAutoDisableFlag(req.ode_config.auto_disable_bodies); - ode_pe->SetSORPGSPreconIters(req.ode_config.sor_pgs_precon_iters); - ode_pe->SetSORPGSIters(req.ode_config.sor_pgs_iters); - ode_pe->SetSORPGSW(req.ode_config.sor_pgs_w); - ode_pe->SetWorldCFM(req.ode_config.cfm); - ode_pe->SetWorldERP(req.ode_config.erp); - ode_pe->SetContactSurfaceLayer(req.ode_config.contact_surface_layer); - ode_pe->SetContactMaxCorrectingVel(req.ode_config.contact_max_correcting_vel); - ode_pe->SetMaxContacts(req.ode_config.max_contacts); + gazebo::physics::PhysicsEnginePtr pe = (world_->GetPhysicsEngine()); + pe->SetMaxStepSize(req.time_step); + pe->SetRealTimeUpdateRate(req.max_update_rate); + pe->SetGravity(gazebo::math::Vector3(req.gravity.x,req.gravity.y,req.gravity.z)); + + if (world_->GetPhysicsEngine()->GetType() == "ode") + { + // stuff only works in ODE right now + pe->SetAutoDisableFlag(req.ode_config.auto_disable_bodies); +#if GAZEBO_MAJOR_VERSION >= 3 + pe->SetParam("precon_iters", req.ode_config.sor_pgs_precon_iters); + pe->SetParam("iters", req.ode_config.sor_pgs_iters); + pe->SetParam("sor", req.ode_config.sor_pgs_w); + pe->SetParam("cfm", req.ode_config.cfm); + pe->SetParam("erp", req.ode_config.erp); + pe->SetParam("contact_surface_layer", + req.ode_config.contact_surface_layer); + pe->SetParam("contact_max_correcting_vel", + req.ode_config.contact_max_correcting_vel); + pe->SetParam("max_contacts", req.ode_config.max_contacts); +#else + pe->SetSORPGSPreconIters(req.ode_config.sor_pgs_precon_iters); + pe->SetSORPGSIters(req.ode_config.sor_pgs_iters); + pe->SetSORPGSW(req.ode_config.sor_pgs_w); + pe->SetWorldCFM(req.ode_config.cfm); + pe->SetWorldERP(req.ode_config.erp); + pe->SetContactSurfaceLayer(req.ode_config.contact_surface_layer); + pe->SetContactMaxCorrectingVel(req.ode_config.contact_max_correcting_vel); + pe->SetMaxContacts(req.ode_config.max_contacts); +#endif - world_->SetPaused(is_paused); + world_->SetPaused(is_paused); - res.success = true; - res.status_message = "physics engine updated"; - return true; + res.success = true; + res.status_message = "physics engine updated"; + } + else + { + /// \TODO: add support for simbody, dart and bullet physics properties. + ROS_ERROR("ROS set_physics_properties service call does not yet support physics engine [%s].", world_->GetPhysicsEngine()->GetType().c_str()); + res.success = false; + res.status_message = "Physics engine [" + world_->GetPhysicsEngine()->GetType() + "]: set_physics_properties not supported."; + } + return res.success; } bool GazeboRosApiPlugin::getPhysicsProperties(gazebo_msgs::GetPhysicsProperties::Request &req, @@ -1123,19 +1146,49 @@ bool GazeboRosApiPlugin::getPhysicsProperties(gazebo_msgs::GetPhysicsProperties: res.gravity.z = gravity.z; // stuff only works in ODE right now - res.ode_config.auto_disable_bodies = world_->GetPhysicsEngine()->GetAutoDisableFlag(); - res.ode_config.sor_pgs_precon_iters = world_->GetPhysicsEngine()->GetSORPGSPreconIters(); - res.ode_config.sor_pgs_iters = world_->GetPhysicsEngine()->GetSORPGSIters(); - res.ode_config.sor_pgs_w = world_->GetPhysicsEngine()->GetSORPGSW(); - res.ode_config.contact_surface_layer = world_->GetPhysicsEngine()->GetContactSurfaceLayer(); - res.ode_config.contact_max_correcting_vel = world_->GetPhysicsEngine()->GetContactMaxCorrectingVel(); - res.ode_config.cfm = world_->GetPhysicsEngine()->GetWorldCFM(); - res.ode_config.erp = world_->GetPhysicsEngine()->GetWorldERP(); - res.ode_config.max_contacts = world_->GetPhysicsEngine()->GetMaxContacts(); + if (world_->GetPhysicsEngine()->GetType() == "ode") + { + res.ode_config.auto_disable_bodies = + world_->GetPhysicsEngine()->GetAutoDisableFlag(); +#if GAZEBO_MAJOR_VERSION >= 3 + res.ode_config.sor_pgs_precon_iters = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("precon_iters")); + res.ode_config.sor_pgs_iters = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("iters")); + res.ode_config.sor_pgs_w = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("sor")); + res.ode_config.contact_surface_layer = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("contact_surface_layer")); + res.ode_config.contact_max_correcting_vel = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("contact_max_correcting_vel")); + res.ode_config.cfm = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("cfm")); + res.ode_config.erp = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("erp")); + res.ode_config.max_contacts = boost::any_cast( + world_->GetPhysicsEngine()->GetParam("max_contacts")); +#else + res.ode_config.sor_pgs_precon_iters = world_->GetPhysicsEngine()->GetSORPGSPreconIters(); + res.ode_config.sor_pgs_iters = world_->GetPhysicsEngine()->GetSORPGSIters(); + res.ode_config.sor_pgs_w = world_->GetPhysicsEngine()->GetSORPGSW(); + res.ode_config.contact_surface_layer = world_->GetPhysicsEngine()->GetContactSurfaceLayer(); + res.ode_config.contact_max_correcting_vel = world_->GetPhysicsEngine()->GetContactMaxCorrectingVel(); + res.ode_config.cfm = world_->GetPhysicsEngine()->GetWorldCFM(); + res.ode_config.erp = world_->GetPhysicsEngine()->GetWorldERP(); + res.ode_config.max_contacts = world_->GetPhysicsEngine()->GetMaxContacts(); +#endif - res.success = true; - res.status_message = "GetPhysicsProperties: got properties"; - return true; + res.success = true; + res.status_message = "GetPhysicsProperties: got properties"; + } + else + { + /// \TODO: add support for simbody, dart and bullet physics properties. + ROS_ERROR("ROS get_physics_properties service call does not yet support physics engine [%s].", world_->GetPhysicsEngine()->GetType().c_str()); + res.success = false; + res.status_message = "Physics engine [" + world_->GetPhysicsEngine()->GetType() + "]: get_physics_properties not supported."; + } + return res.success; } bool GazeboRosApiPlugin::setJointProperties(gazebo_msgs::SetJointProperties::Request &req, @@ -1159,6 +1212,26 @@ bool GazeboRosApiPlugin::setJointProperties(gazebo_msgs::SetJointProperties::Req { for(unsigned int i=0;i< req.ode_joint_config.damping.size();i++) joint->SetDamping(i,req.ode_joint_config.damping[i]); +#if GAZEBO_MAJOR_VERSION >= 4 + for(unsigned int i=0;i< req.ode_joint_config.hiStop.size();i++) + joint->SetParam("hi_stop",i,req.ode_joint_config.hiStop[i]); + for(unsigned int i=0;i< req.ode_joint_config.loStop.size();i++) + joint->SetParam("lo_stop",i,req.ode_joint_config.loStop[i]); + for(unsigned int i=0;i< req.ode_joint_config.erp.size();i++) + joint->SetParam("erp",i,req.ode_joint_config.erp[i]); + for(unsigned int i=0;i< req.ode_joint_config.cfm.size();i++) + joint->SetParam("cfm",i,req.ode_joint_config.cfm[i]); + for(unsigned int i=0;i< req.ode_joint_config.stop_erp.size();i++) + joint->SetParam("stop_erp",i,req.ode_joint_config.stop_erp[i]); + for(unsigned int i=0;i< req.ode_joint_config.stop_cfm.size();i++) + joint->SetParam("stop_cfm",i,req.ode_joint_config.stop_cfm[i]); + for(unsigned int i=0;i< req.ode_joint_config.fudge_factor.size();i++) + joint->SetParam("fudge_factor",i,req.ode_joint_config.fudge_factor[i]); + for(unsigned int i=0;i< req.ode_joint_config.fmax.size();i++) + joint->SetParam("fmax",i,req.ode_joint_config.fmax[i]); + for(unsigned int i=0;i< req.ode_joint_config.vel.size();i++) + joint->SetParam("vel",i,req.ode_joint_config.vel[i]); +#else for(unsigned int i=0;i< req.ode_joint_config.hiStop.size();i++) joint->SetAttribute("hi_stop",i,req.ode_joint_config.hiStop[i]); for(unsigned int i=0;i< req.ode_joint_config.loStop.size();i++) @@ -1177,6 +1250,7 @@ bool GazeboRosApiPlugin::setJointProperties(gazebo_msgs::SetJointProperties::Req joint->SetAttribute("fmax",i,req.ode_joint_config.fmax[i]); for(unsigned int i=0;i< req.ode_joint_config.vel.size();i++) joint->SetAttribute("vel",i,req.ode_joint_config.vel[i]); +#endif res.success = true; res.status_message = "SetJointProperties: properties set"; @@ -1323,7 +1397,7 @@ bool GazeboRosApiPlugin::clearJointForces(std::string joint_name) while(search) { search = false; - for (std::vector::iterator iter=force_joint_jobs_.begin();iter!=force_joint_jobs_.end();iter++) + for (std::vector::iterator iter=force_joint_jobs_.begin();iter!=force_joint_jobs_.end();++iter) { if ((*iter)->joint->GetName() == joint_name) { @@ -1351,7 +1425,7 @@ bool GazeboRosApiPlugin::clearBodyWrenches(std::string body_name) while(search) { search = false; - for (std::vector::iterator iter=wrench_body_jobs_.begin();iter!=wrench_body_jobs_.end();iter++) + for (std::vector::iterator iter=wrench_body_jobs_.begin();iter!=wrench_body_jobs_.end();++iter) { //ROS_ERROR("search %s %s",(*iter)->body->GetScopedName().c_str(), body_name.c_str()); if ((*iter)->body->GetScopedName() == body_name) @@ -1497,7 +1571,6 @@ void GazeboRosApiPlugin::transformWrench( gazebo::math::Vector3 &target_force, g target_torque = target_to_reference.rot.RotateVector(reference_torque); // target force is the refence force rotated by the target->reference transform - target_force = target_force; target_torque = target_torque + target_to_reference.pos.Cross(target_force); } @@ -1661,10 +1734,10 @@ void GazeboRosApiPlugin::wrenchBodySchedulerSlot() { // remove from queue once expires delete (*iter); - wrench_body_jobs_.erase(iter); + iter = wrench_body_jobs_.erase(iter); } else - iter++; + ++iter; } lock_.unlock(); } @@ -1691,10 +1764,10 @@ void GazeboRosApiPlugin::forceJointSchedulerSlot() (*iter)->duration.toSec() >= 0.0) { // remove from queue once expires - force_joint_jobs_.erase(iter); + iter = force_joint_jobs_.erase(iter); } else - iter++; + ++iter; } lock_.unlock(); } @@ -1875,7 +1948,7 @@ void GazeboRosApiPlugin::physicsReconfigureThread() physics_reconfigure_set_client_ = nh_->serviceClient("/gazebo/set_physics_properties"); physics_reconfigure_get_client_ = nh_->serviceClient("/gazebo/get_physics_properties"); - // Wait until the rest of this plugin is loaded and the services are being offered + // Wait until the rest of this plugin is loaded and the services are being offered physics_reconfigure_set_client_.waitForExistence(); physics_reconfigure_get_client_.waitForExistence(); @@ -1904,7 +1977,7 @@ void GazeboRosApiPlugin::stripXmlDeclaration(std::string &model_xml) void GazeboRosApiPlugin::updateSDFAttributes(TiXmlDocument &gazebo_model_xml, std::string model_name, gazebo::math::Vector3 initial_xyz, gazebo::math::Quaternion initial_q) { - // This function can handle both regular SDF files and SDFs that are used with the + // This function can handle both regular SDF files and SDFs that are used with the // Gazebo Model Database TiXmlElement* pose_element; // This is used by both reguar and database SDFs @@ -1929,75 +2002,135 @@ void GazeboRosApiPlugin::updateSDFAttributes(TiXmlDocument &gazebo_model_xml, st } // replace with user specified name model_tixml->SetAttribute("name",model_name); - - // Check for the pose element - pose_element = model_tixml->FirstChildElement("pose"); - - // Create the pose element if it doesn't exist - if (!pose_element) - { - pose_element = new TiXmlElement("pose"); - model_tixml->LinkEndChild(pose_element); - } - - // Pose is set at bottom of function } else { // Check SDF for world element TiXmlElement* world_tixml = gazebo_tixml->FirstChildElement("world"); if (!world_tixml) - { + { ROS_WARN("Could not find or element in sdf, so name and initial position cannot be applied"); return; } - // Check SDF for required include element - TiXmlElement* include_tixml = world_tixml->FirstChildElement("include"); - if (!include_tixml) - { + // If not element, check SDF for required include element + model_tixml = world_tixml->FirstChildElement("include"); + if (!model_tixml) + { ROS_WARN("Could not find element in sdf, so name and initial position cannot be applied"); return; } // Check for name element - TiXmlElement* name_tixml = include_tixml->FirstChildElement("name"); + TiXmlElement* name_tixml = model_tixml->FirstChildElement("name"); if (!name_tixml) - { + { // Create the name element name_tixml = new TiXmlElement("name"); - include_tixml->LinkEndChild(name_tixml); - } + model_tixml->LinkEndChild(name_tixml); + } // Set the text within the name element TiXmlText* text = new TiXmlText(model_name); - name_tixml->LinkEndChild( text ); + name_tixml->LinkEndChild( text ); + } - // Check for the pose element - pose_element = include_tixml->FirstChildElement("pose"); - // Create the pose element if it doesn't exist - if (!pose_element) - { - pose_element = new TiXmlElement("pose"); - include_tixml->LinkEndChild(pose_element); - } - // Pose is set at bottom of function - } + // Check for the pose element + pose_element = model_tixml->FirstChildElement("pose"); + gazebo::math::Pose model_pose; - // Set the pose value for both SDFs types here + // Create the pose element if it doesn't exist + // Remove it if it exists, since we are inserting a new one if (pose_element) { + // save pose_element in math::Pose and remove child + model_pose = this->parsePose(pose_element->GetText()); + model_tixml->RemoveChild(pose_element); + } + + // Set and link the pose element after adding initial pose + { + // add pose_element Pose to initial pose + gazebo::math::Pose new_model_pose = model_pose + gazebo::math::Pose(initial_xyz, initial_q); + // Create the string of 6 numbers std::ostringstream pose_stream; - gazebo::math::Vector3 initial_rpy = initial_q.GetAsEuler(); // convert to Euler angles for Gazebo XML - pose_stream << initial_xyz.x << " " << initial_xyz.y << " " << initial_xyz.z << " " - << initial_rpy.x << " " << initial_rpy.y << " " << initial_rpy.z; + gazebo::math::Vector3 model_rpy = new_model_pose.rot.GetAsEuler(); // convert to Euler angles for Gazebo XML + pose_stream << new_model_pose.pos.x << " " << new_model_pose.pos.y << " " << new_model_pose.pos.z << " " + << model_rpy.x << " " << model_rpy.y << " " << model_rpy.z; // Add value to pose element - TiXmlText* text = new TiXmlText(pose_stream.str()); - pose_element->LinkEndChild( text ); + TiXmlText* text = new TiXmlText(pose_stream.str()); + TiXmlElement* new_pose_element = new TiXmlElement("pose"); + new_pose_element->LinkEndChild(text); + model_tixml->LinkEndChild(new_pose_element); } +} +gazebo::math::Pose GazeboRosApiPlugin::parsePose(const std::string &str) +{ + std::vector pieces; + std::vector vals; + + boost::split(pieces, str, boost::is_any_of(" ")); + for (unsigned int i = 0; i < pieces.size(); ++i) + { + if (pieces[i] != "") + { + try + { + vals.push_back(boost::lexical_cast(pieces[i].c_str())); + } + catch(boost::bad_lexical_cast &e) + { + sdferr << "xml key [" << str + << "][" << i << "] value [" << pieces[i] + << "] is not a valid double from a 3-tuple\n"; + return gazebo::math::Pose(); + } + } + } + + if (vals.size() == 6) + return gazebo::math::Pose(vals[0], vals[1], vals[2], vals[3], vals[4], vals[5]); + else + { + ROS_ERROR("Beware: failed to parse string [%s] as gazebo::math::Pose, returning zeros.", str.c_str()); + return gazebo::math::Pose(); + } +} + +gazebo::math::Vector3 GazeboRosApiPlugin::parseVector3(const std::string &str) +{ + std::vector pieces; + std::vector vals; + + boost::split(pieces, str, boost::is_any_of(" ")); + for (unsigned int i = 0; i < pieces.size(); ++i) + { + if (pieces[i] != "") + { + try + { + vals.push_back(boost::lexical_cast(pieces[i].c_str())); + } + catch(boost::bad_lexical_cast &e) + { + sdferr << "xml key [" << str + << "][" << i << "] value [" << pieces[i] + << "] is not a valid double from a 3-tuple\n"; + return gazebo::math::Vector3(); + } + } + } + + if (vals.size() == 3) + return gazebo::math::Vector3(vals[0], vals[1], vals[2]); + else + { + ROS_ERROR("Beware: failed to parse string [%s] as gazebo::math::Vector3, returning zeros.", str.c_str()); + return gazebo::math::Vector3(); + } } void GazeboRosApiPlugin::updateURDFModelPose(TiXmlDocument &gazebo_model_xml, gazebo::math::Vector3 initial_xyz, gazebo::math::Quaternion initial_q) @@ -2015,17 +2148,28 @@ void GazeboRosApiPlugin::updateURDFModelPose(TiXmlDocument &gazebo_model_xml, ga model_tixml->LinkEndChild(origin_key); } + gazebo::math::Vector3 xyz; + gazebo::math::Vector3 rpy; if (origin_key->Attribute("xyz")) + { + xyz = this->parseVector3(origin_key->Attribute("xyz")); origin_key->RemoveAttribute("xyz"); + } if (origin_key->Attribute("rpy")) + { + rpy = this->parseVector3(origin_key->Attribute("rpy")); origin_key->RemoveAttribute("rpy"); + } + + // add xyz, rpy to initial pose + gazebo::math::Pose model_pose = gazebo::math::Pose(xyz, rpy) + gazebo::math::Pose(initial_xyz, initial_q); std::ostringstream xyz_stream; - xyz_stream << initial_xyz.x << " " << initial_xyz.y << " " << initial_xyz.z; + xyz_stream << model_pose.pos.x << " " << model_pose.pos.y << " " << model_pose.pos.z; std::ostringstream rpy_stream; - gazebo::math::Vector3 initial_rpy = initial_q.GetAsEuler(); // convert to Euler angles for Gazebo XML - rpy_stream << initial_rpy.x << " " << initial_rpy.y << " " << initial_rpy.z; + gazebo::math::Vector3 model_rpy = model_pose.rot.GetAsEuler(); // convert to Euler angles for Gazebo XML + rpy_stream << model_rpy.x << " " << model_rpy.y << " " << model_rpy.z; origin_key->SetAttribute("xyz",xyz_stream.str()); origin_key->SetAttribute("rpy",rpy_stream.str()); @@ -2079,20 +2223,20 @@ void GazeboRosApiPlugin::walkChildAddRobotNamespace(TiXmlNode* robot_xml) } } -bool GazeboRosApiPlugin::spawnAndConform(TiXmlDocument &gazebo_model_xml, std::string model_name, +bool GazeboRosApiPlugin::spawnAndConform(TiXmlDocument &gazebo_model_xml, std::string model_name, gazebo_msgs::SpawnModel::Response &res) { // push to factory iface std::ostringstream stream; stream << gazebo_model_xml; std::string gazebo_model_xml_string = stream.str(); - //ROS_DEBUG("Gazebo Model XML\n\n%s\n\n ",gazebo_model_xml_string.c_str()); + ROS_DEBUG("Gazebo Model XML\n\n%s\n\n ",gazebo_model_xml_string.c_str()); // publish to factory topic gazebo::msgs::Factory msg; gazebo::msgs::Init(msg, "spawn_model"); msg.set_sdf( gazebo_model_xml_string ); - + //ROS_ERROR("attempting to spawn model name [%s] [%s]", model_name.c_str(),gazebo_model_xml_string.c_str()); // FIXME: should use entity_info or add lock to World::receiveMutex @@ -2132,11 +2276,11 @@ bool GazeboRosApiPlugin::spawnAndConform(TiXmlDocument &gazebo_model_xml, std::s { //boost::recursive_mutex::scoped_lock lock(*world->GetMRMutex()); - if (world_->GetModel(model_name)) + if (world_->GetModel(model_name)) break; } - ROS_DEBUG_STREAM_ONCE_NAMED("api_plugin","Waiting for " << timeout - ros::Time::now() + ROS_DEBUG_STREAM_ONCE_NAMED("api_plugin","Waiting for " << timeout - ros::Time::now() << " for model " << model_name << " to spawn"); usleep(2000); diff --git a/gazebo_ros/src/gazebo_ros_api_plugin.h b/gazebo_ros/src/gazebo_ros_api_plugin.h index 7305bbf5a..76adbf3df 100644 --- a/gazebo_ros/src/gazebo_ros_api_plugin.h +++ b/gazebo_ros/src/gazebo_ros_api_plugin.h @@ -1,28 +1,23 @@ /* - * Gazebo - Outdoor Multi-Robot Simulator - * Copyright (C) 2003 - * Nate Koenig & Andrew Howard + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - */ - -/* Desc: External interfaces for Gazebo +*/ +/* + * Desc: External interfaces for Gazebo * Author: Nate Koenig, John Hsu, Dave Coleman * Date: 25 Apr 2010 - * SVN: $Id: main.cc 8598 2010-03-22 21:59:24Z hsujohnhsu $ */ #ifndef __GAZEBO_ROS_API_PLUGIN_HH__ @@ -251,11 +246,11 @@ class GazeboRosApiPlugin : public SystemPlugin void updateSDFAttributes(TiXmlDocument &gazebo_model_xml, std::string model_name, gazebo::math::Vector3 initial_xyz, gazebo::math::Quaternion initial_q); - /// \brief Update the model name and pose of the URDF file before sending to Gazebo + /// \brief Update the model pose of the URDF file before sending to Gazebo void updateURDFModelPose(TiXmlDocument &gazebo_model_xml, gazebo::math::Vector3 initial_xyz, gazebo::math::Quaternion initial_q); - /// \brief + /// \brief Update the model name of the URDF file before sending to Gazebo void updateURDFName(TiXmlDocument &gazebo_model_xml, std::string model_name); /// \brief @@ -289,6 +284,12 @@ class GazeboRosApiPlugin : public SystemPlugin /// \brief Connect to Gazebo via its plugin interface, get a pointer to the world, start events void loadGazeboRosApiPlugin(std::string world_name); + /// \brief convert xml to Pose + gazebo::math::Pose parsePose(const std::string &str); + + /// \brief convert xml to Pose + gazebo::math::Vector3 parseVector3(const std::string &str); + // track if the desconstructor event needs to occur bool plugin_loaded_; diff --git a/gazebo_ros/src/gazebo_ros_paths_plugin.cpp b/gazebo_ros/src/gazebo_ros_paths_plugin.cpp index 38362e55f..8bff3f4ed 100644 --- a/gazebo_ros/src/gazebo_ros_paths_plugin.cpp +++ b/gazebo_ros/src/gazebo_ros_paths_plugin.cpp @@ -1,38 +1,19 @@ -/********************************************************************* - * Software License Agreement (BSD License) +/* + * Copyright (C) 2012-2014 Open Source Robotics Foundation * - * Copyright (c) 2013, Open Source Robotics Foundation - * All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of the Open Source Robotics Foundation - * nor the names of its contributors may be - * used to endorse or promote products derived - * from this software without specific prior written permission. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *********************************************************************/ - +*/ /* * Author: John Hsu, Nate Koenig, Dave Coleman * Desc: External interfaces for Gazebo diff --git a/gazebo_ros_control/CHANGELOG.rst b/gazebo_ros_control/CHANGELOG.rst index c19477eb8..ee034b9ca 100644 --- a/gazebo_ros_control/CHANGELOG.rst +++ b/gazebo_ros_control/CHANGELOG.rst @@ -2,6 +2,91 @@ Changelog for package gazebo_ros_control ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.4.6 (2014-09-01) +------------------ +* Update default_robot_hw_sim.cpp +* Reduced changes +* Fix to work with gazebo3 +* Fix build with gazebo4 and indigo +* Update package.xml + Add new maintainer. +* Contributors: Adolfo Rodriguez Tsouroukdissian, Jose Luis Rivero, Nate Koenig, hsu + +2.4.5 (2014-08-18) +------------------ +* Fix typo: GAZEBO_VERSION_MAJOR -> GAZEBO_MAJOR_VERSION +* Port fix_build branch for indigo-devel + See pull request `#221 `_ +* Contributors: Jose Luis Rivero, Steven Peters + +2.4.4 (2014-07-18) +------------------ +* Update package.xml + Add new maintainer. +* Should fix build error for binary releases. + See: http://www.ros.org/debbuild/indigo.html?q=gazebo_ros_control +* Updated package.xml +* gazebo_ros_control: default_robot_hw_sim: Suppressing pid error message + Depends on `ros-controls/control_toolbox#21 `_ +* Revert 4776545, as it belongs in indigo-devel. +* Fix repo names in package.xml's +* gazebo_ros_control: default_robot_hw_sim: Suppressing pid error message, depends on `ros-controls/control_toolbox#21 `_ +* gazebo_ros_control: Add dependency on angles +* gazebo_ros_control: Add build-time dependency on gazebo + This fixes a regression caused by a889ef8b768861231a67b78781514d834f631b8e +* Contributors: Adolfo Rodriguez Tsouroukdissian, Alexander Bubeck, Dave Coleman, Jon Binney, Jonathan Bohren, Scott K Logan + +2.4.3 (2014-05-12) +------------------ +* Compatibility with Indigo's ros_control. + Also fixes `#184 `_. +* Remove build-time dependency on gazebo_ros. +* Fix broken build due to wrong rosconsole macro use +* Contributors: Adolfo Rodriguez Tsouroukdissian + +2.4.2 (2014-03-27) +------------------ +* merging from hydro-devel +* bump patch version for indigo-devel to 2.4.1 +* merging from indigo-devel after 2.3.4 release +* Merge branch 'hydro-devel' of github.com:ros-simulation/gazebo_ros_pkgs into indigo-devel +* "2.4.0" +* catkin_generate_changelog +* Contributors: John Hsu + +2.4.1 (2013-11-13) +------------------ + +2.3.5 (2014-03-26) +------------------ +* Removed some debugging code. +* joint->SetAngle() and joint->SetVelocity() are now used to control + position-controlled joints and velocity-controlled joints that do not + have PID gain values stored on the Parameter Server. +* Position-controlled and velocity-controlled joints now use PID controllers + instead of calling SetAngle() or SetVelocity(). readSim() now longer calls + angles::shortest_angular_distance() when a joint is prismatic. + PLUGINLIB_EXPORT_CLASS is now used to register the plugin. +* gazebo_ros_control now depends on control_toolbox. +* Added support for the position hardware interface. Completed support for the + velocity hardware interface. +* Removed the "support more hardware interfaces" line. +* Contributors: Jim Rothrock + +2.3.4 (2013-11-13) +------------------ +* rerelease because sdformat became libsdformat, but we also based change on 2.3.4 in hydro-devel. +* Merge pull request `#144 `_ from meyerj/fix-125 + Fixed `#125 `_: ``gazebo_ros_control``: controlPeriod greater than the simulation period causes unexpected results +* Merge pull request `#134 `_ from meyerj/gazebo-ros-control-use-model-nh + ``gazebo_ros_control``: Use the model NodeHandle to get the ``robot_description`` parameter +* ``gazebo_ros_control``: added GazeboRosControlPlugin::Reset() method that resets the timestamps on world reset +* ``gazebo_ros_control``: call writeSim() for each Gazebo world update independent of the control period +* ``gazebo_ros_pkgs``: use GetMaxStepSize() for the Gazebo simulation period +* ``gazebo_ros_control``: use the model NodeHandle to get the ``robot_description`` parameter +* Add missing ``run_depend`` to urdf in ``gazebo_ros_control`` +* Remove dependency to meta-package ``ros_controllers`` + 2.4.0 (2013-10-14) ------------------ diff --git a/gazebo_ros_control/CMakeLists.txt b/gazebo_ros_control/CMakeLists.txt index 3969d1e8d..3bd395a3d 100644 --- a/gazebo_ros_control/CMakeLists.txt +++ b/gazebo_ros_control/CMakeLists.txt @@ -4,13 +4,14 @@ project(gazebo_ros_control) # Load catkin and all dependencies required for this package find_package(catkin REQUIRED COMPONENTS roscpp - gazebo_ros + control_toolbox controller_manager hardware_interface transmission_interface pluginlib joint_limits_interface urdf + angles ) # Depend on system install of Gazebo @@ -19,11 +20,11 @@ find_package(gazebo REQUIRED) catkin_package( CATKIN_DEPENDS roscpp - gazebo_ros controller_manager pluginlib transmission_interface INCLUDE_DIRS include + LIBRARIES ${PROJECT_NAME} default_robot_hw_sim DEPENDS gazebo ) diff --git a/gazebo_ros_control/README.md b/gazebo_ros_control/README.md index 036198b33..01ccb5935 100644 --- a/gazebo_ros_control/README.md +++ b/gazebo_ros_control/README.md @@ -10,5 +10,4 @@ controller manager and connects it to a Gazebo model. ## Future Direction - - Implement tranmissions - - In the default plugin support more hardware interfaces + - Implement transmissions diff --git a/gazebo_ros_control/include/gazebo_ros_control/default_robot_hw_sim.h b/gazebo_ros_control/include/gazebo_ros_control/default_robot_hw_sim.h new file mode 100644 index 000000000..ea65641d3 --- /dev/null +++ b/gazebo_ros_control/include/gazebo_ros_control/default_robot_hw_sim.h @@ -0,0 +1,139 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2013, Open Source Robotics Foundation + * Copyright (c) 2013, The Johns Hopkins University + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the Open Source Robotics Foundation + * nor the names of its contributors may be + * used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + +/* Author: Dave Coleman, Johnathan Bohren + Desc: Hardware Interface for any simulated robot in Gazebo +*/ + +#ifndef _GAZEBO_ROS_CONTROL___DEFAULT_ROBOT_HW_SIM_H_ +#define _GAZEBO_ROS_CONTROL___DEFAULT_ROBOT_HW_SIM_H_ + +// ros_control +#include +#include +#include +#include +#include +#include +#include + +// Gazebo +#include +#include +#include + +// ROS +#include +#include +#include + +// gazebo_ros_control +#include + +// URDF +#include + + + +namespace gazebo_ros_control +{ + +class DefaultRobotHWSim : public gazebo_ros_control::RobotHWSim +{ +public: + + virtual bool initSim( + const std::string& robot_namespace, + ros::NodeHandle model_nh, + gazebo::physics::ModelPtr parent_model, + const urdf::Model *const urdf_model, + std::vector transmissions); + + virtual void readSim(ros::Time time, ros::Duration period); + + virtual void writeSim(ros::Time time, ros::Duration period); + +protected: + // Methods used to control a joint. + enum ControlMethod {EFFORT, POSITION, POSITION_PID, VELOCITY, VELOCITY_PID}; + + // Register the limits of the joint specified by joint_name and joint_handle. The limits are + // retrieved from joint_limit_nh. If urdf_model is not NULL, limits are retrieved from it also. + // Return the joint's type, lower position limit, upper position limit, and effort limit. + void registerJointLimits(const std::string& joint_name, + const hardware_interface::JointHandle& joint_handle, + const ControlMethod ctrl_method, + const ros::NodeHandle& joint_limit_nh, + const urdf::Model *const urdf_model, + int *const joint_type, double *const lower_limit, + double *const upper_limit, double *const effort_limit); + + unsigned int n_dof_; + + hardware_interface::JointStateInterface js_interface_; + hardware_interface::EffortJointInterface ej_interface_; + hardware_interface::PositionJointInterface pj_interface_; + hardware_interface::VelocityJointInterface vj_interface_; + + joint_limits_interface::EffortJointSaturationInterface ej_sat_interface_; + joint_limits_interface::EffortJointSoftLimitsInterface ej_limits_interface_; + joint_limits_interface::PositionJointSaturationInterface pj_sat_interface_; + joint_limits_interface::PositionJointSoftLimitsInterface pj_limits_interface_; + joint_limits_interface::VelocityJointSaturationInterface vj_sat_interface_; + joint_limits_interface::VelocityJointSoftLimitsInterface vj_limits_interface_; + + std::vector joint_names_; + std::vector joint_types_; + std::vector joint_lower_limits_; + std::vector joint_upper_limits_; + std::vector joint_effort_limits_; + std::vector joint_control_methods_; + std::vector pid_controllers_; + std::vector joint_position_; + std::vector joint_velocity_; + std::vector joint_effort_; + std::vector joint_effort_command_; + std::vector joint_position_command_; + std::vector joint_velocity_command_; + + std::vector sim_joints_; +}; + +typedef boost::shared_ptr DefaultRobotHWSimPtr; + +} + +#endif // #ifndef __GAZEBO_ROS_CONTROL_PLUGIN_DEFAULT_ROBOT_HW_SIM_H_ diff --git a/gazebo_ros_control/include/gazebo_ros_control/gazebo_ros_control_plugin.h b/gazebo_ros_control/include/gazebo_ros_control/gazebo_ros_control_plugin.h index e9a9fdfa3..320b5fc8c 100644 --- a/gazebo_ros_control/include/gazebo_ros_control/gazebo_ros_control_plugin.h +++ b/gazebo_ros_control/include/gazebo_ros_control/gazebo_ros_control_plugin.h @@ -72,6 +72,9 @@ class GazeboRosControlPlugin : public gazebo::ModelPlugin // Called by the world update start event void Update(); + // Called on world reset + virtual void Reset(); + // Get the URDF XML from the parameter server std::string getURDF(std::string param_name) const; @@ -81,7 +84,6 @@ class GazeboRosControlPlugin : public gazebo::ModelPlugin protected: // Node Handles - ros::NodeHandle nh_; // no namespace ros::NodeHandle model_nh_; // namespaces to robot name // Pointer to the model @@ -114,7 +116,8 @@ class GazeboRosControlPlugin : public gazebo::ModelPlugin // Timing ros::Duration control_period_; - ros::Time last_sim_time_ros_; + ros::Time last_update_sim_time_ros_; + ros::Time last_write_sim_time_ros_; }; diff --git a/gazebo_ros_control/package.xml b/gazebo_ros_control/package.xml index 01f5864e9..44d12ade3 100644 --- a/gazebo_ros_control/package.xml +++ b/gazebo_ros_control/package.xml @@ -1,16 +1,16 @@ gazebo_ros_control - 2.4.0 + 2.4.6 gazebo_ros_control Jonathan Bohren - Dave Coleman + Adolfo Rodriguez Tsouroukdissian BSD http://ros.org/wiki/gazebo_ros_control - https://github.com/osrf/gazebo_ros_pkgs/issues - https://github.com/osrf/gazebo_ros_pkgs + https://github.com/ros-simulation/gazebo_ros_pkgs/issues + https://github.com/ros-simulation/gazebo_ros_pkgs Jonathan Bohren Dave Coleman @@ -18,19 +18,24 @@ catkin roscpp - gazebo_ros + gazebo + control_toolbox controller_manager pluginlib transmission_interface joint_limits_interface urdf + angles - roscpp + roscpp + gazebo gazebo_ros + control_toolbox controller_manager pluginlib - ros_controllers transmission_interface + urdf + angles diff --git a/gazebo_ros_control/src/default_robot_hw_sim.cpp b/gazebo_ros_control/src/default_robot_hw_sim.cpp index c4b4332b8..e7eb7b762 100644 --- a/gazebo_ros_control/src/default_robot_hw_sim.cpp +++ b/gazebo_ros_control/src/default_robot_hw_sim.cpp @@ -38,265 +38,414 @@ Desc: Hardware Interface for any simulated robot in Gazebo */ -#ifndef _GAZEBO_ROS_CONTROL___DEFAULT_ROBOT_HW_SIM_H_ -#define _GAZEBO_ROS_CONTROL___DEFAULT_ROBOT_HW_SIM_H_ -// ros_control -#include -#include -#include -#include -#include -#include +#include -// Gazebo -#include -#include -#include -// ROS -#include -#include -#include +namespace +{ -// gazebo_ros_control -#include +double clamp(const double val, const double min_val, const double max_val) +{ + return std::min(std::max(val, min_val), max_val); +} -// URDF -#include +} namespace gazebo_ros_control { -class DefaultRobotHWSim : public gazebo_ros_control::RobotHWSim + +bool DefaultRobotHWSim::initSim( + const std::string& robot_namespace, + ros::NodeHandle model_nh, + gazebo::physics::ModelPtr parent_model, + const urdf::Model *const urdf_model, + std::vector transmissions) { -public: - - bool initSim( - const std::string& robot_namespace, - ros::NodeHandle model_nh, - gazebo::physics::ModelPtr parent_model, - const urdf::Model *const urdf_model, - std::vector transmissions) + // getJointLimits() searches joint_limit_nh for joint limit parameters. The format of each + // parameter's name is "joint_limits/". An example is "joint_limits/axle_joint". + const ros::NodeHandle joint_limit_nh(model_nh, robot_namespace); + + // Resize vectors to our DOF + n_dof_ = transmissions.size(); + joint_names_.resize(n_dof_); + joint_types_.resize(n_dof_); + joint_lower_limits_.resize(n_dof_); + joint_upper_limits_.resize(n_dof_); + joint_effort_limits_.resize(n_dof_); + joint_control_methods_.resize(n_dof_); + pid_controllers_.resize(n_dof_); + joint_position_.resize(n_dof_); + joint_velocity_.resize(n_dof_); + joint_effort_.resize(n_dof_); + joint_effort_command_.resize(n_dof_); + joint_position_command_.resize(n_dof_); + joint_velocity_command_.resize(n_dof_); + + // Initialize values + for(unsigned int j=0; j < n_dof_; j++) { - // getJointLimits() searches joint_limit_nh for joint limit parameters. The format of each - // parameter's name is "joint_limits/". An example is "joint_limits/axle_joint". - const ros::NodeHandle joint_limit_nh(model_nh, robot_namespace); - - // Resize vectors to our DOF - n_dof_ = transmissions.size(); - joint_names_.resize(n_dof_); - joint_position_.resize(n_dof_); - joint_velocity_.resize(n_dof_); - joint_effort_.resize(n_dof_); - joint_effort_command_.resize(n_dof_); - joint_velocity_command_.resize(n_dof_); - - // Initialize values - for(unsigned int j=0; j < n_dof_; j++) + // Check that this transmission has one joint + if(transmissions[j].joints_.size() == 0) { - // Check that this transmission has one joint - if(transmissions[j].joints_.size() == 0) - { - ROS_WARN_STREAM_NAMED("default_robot_hw_sim","Transmission " << transmissions[j].name_ - << " has no associated joints."); - continue; - } - else if(transmissions[j].joints_.size() > 1) - { - ROS_WARN_STREAM_NAMED("default_robot_hw_sim","Transmission " << transmissions[j].name_ - << " has more than one joint. Currently the default robot hardware simulation " - << " interface only supports one."); - continue; - } + ROS_WARN_STREAM_NAMED("default_robot_hw_sim","Transmission " << transmissions[j].name_ + << " has no associated joints."); + continue; + } + else if(transmissions[j].joints_.size() > 1) + { + ROS_WARN_STREAM_NAMED("default_robot_hw_sim","Transmission " << transmissions[j].name_ + << " has more than one joint. Currently the default robot hardware simulation " + << " interface only supports one."); + continue; + } - // Check that this transmission has one actuator - if(transmissions[j].actuators_.size() == 0) - { - ROS_WARN_STREAM_NAMED("default_robot_hw_sim","Transmission " << transmissions[j].name_ - << " has no associated actuators."); - continue; - } - else if(transmissions[j].actuators_.size() > 1) - { - ROS_WARN_STREAM_NAMED("default_robot_hw_sim","Transmission " << transmissions[j].name_ - << " has more than one actuator. Currently the default robot hardware simulation " - << " interface only supports one."); - continue; - } + std::vector joint_interfaces = transmissions[j].joints_[0].hardware_interfaces_; + if (joint_interfaces.empty() && + !(transmissions[j].actuators_.empty()) && + !(transmissions[j].actuators_[0].hardware_interfaces_.empty())) + { + // TODO: Deprecate HW interface specification in actuators in ROS J + joint_interfaces = transmissions[j].actuators_[0].hardware_interfaces_; + ROS_WARN_STREAM_NAMED("default_robot_hw_sim", "The element of tranmission " << + transmissions[j].name_ << " should be nested inside the element, not . " << + "The transmission will be properly loaded, but please update " << + "your robot model to remain compatible with future versions of the plugin."); + } + if (joint_interfaces.empty()) + { + ROS_WARN_STREAM_NAMED("default_robot_hw_sim", "Joint " << transmissions[j].joints_[0].name_ << + " of transmission " << transmissions[j].name_ << " does not specify any hardware interface. " << + "Not adding it to the robot hardware simulation."); + continue; + } + else if (joint_interfaces.size() > 1) + { + ROS_WARN_STREAM_NAMED("default_robot_hw_sim", "Joint " << transmissions[j].joints_[0].name_ << + " of transmission " << transmissions[j].name_ << " specifies multiple hardware interfaces. " << + "Currently the default robot hardware simulation interface only supports one. Using the first entry!"); + //continue; + } - // Add data from transmission - joint_names_[j] = transmissions[j].joints_[0].name_; - joint_position_[j] = 1.0; - joint_velocity_[j] = 0.0; - joint_effort_[j] = 1.0; // N/m for continuous joints - joint_effort_command_[j] = 0.0; - joint_velocity_command_[j] = 0.0; + // Add data from transmission + joint_names_[j] = transmissions[j].joints_[0].name_; + joint_position_[j] = 1.0; + joint_velocity_[j] = 0.0; + joint_effort_[j] = 1.0; // N/m for continuous joints + joint_effort_command_[j] = 0.0; + joint_position_command_[j] = 0.0; + joint_velocity_command_[j] = 0.0; - const std::string& hardware_interface = transmissions[j].actuators_[0].hardware_interface_; + const std::string& hardware_interface = joint_interfaces.front(); - // Debug - ROS_DEBUG_STREAM_NAMED("default_robot_hw_sim","Loading joint '" << joint_names_[j] - << "' of type '" << hardware_interface << "'"); + // Debug + ROS_DEBUG_STREAM_NAMED("default_robot_hw_sim","Loading joint '" << joint_names_[j] + << "' of type '" << hardware_interface << "'"); - // Create joint state interface for all joints - js_interface_.registerHandle(hardware_interface::JointStateHandle( - joint_names_[j], &joint_position_[j], &joint_velocity_[j], &joint_effort_[j])); + // Create joint state interface for all joints + js_interface_.registerHandle(hardware_interface::JointStateHandle( + joint_names_[j], &joint_position_[j], &joint_velocity_[j], &joint_effort_[j])); - // Decide what kind of command interface this actuator/joint has - if(hardware_interface == "EffortJointInterface") - { - // Create effort joint interface - hardware_interface::JointHandle joint_handle(js_interface_.getHandle(joint_names_[j]), + // Decide what kind of command interface this actuator/joint has + hardware_interface::JointHandle joint_handle; + if(hardware_interface == "EffortJointInterface") + { + // Create effort joint interface + joint_control_methods_[j] = EFFORT; + joint_handle = hardware_interface::JointHandle(js_interface_.getHandle(joint_names_[j]), &joint_effort_command_[j]); - ej_interface_.registerHandle(joint_handle); - registerEffortJointLimits(joint_names_[j], joint_handle, joint_limit_nh, urdf_model); - } - else if(hardware_interface == "VelocityJointInterface") - { - // Create velocity joint interface - vj_interface_.registerHandle(hardware_interface::JointHandle( - js_interface_.getHandle(joint_names_[j]),&joint_velocity_command_[j])); - } - else - { - ROS_FATAL_STREAM_NAMED("default_robot_hw_sim","No matching hardware interface found for '" - << hardware_interface ); - return false; - } + ej_interface_.registerHandle(joint_handle); + } + else if(hardware_interface == "PositionJointInterface") + { + // Create position joint interface + joint_control_methods_[j] = POSITION; + joint_handle = hardware_interface::JointHandle(js_interface_.getHandle(joint_names_[j]), + &joint_position_command_[j]); + pj_interface_.registerHandle(joint_handle); + } + else if(hardware_interface == "VelocityJointInterface") + { + // Create velocity joint interface + joint_control_methods_[j] = VELOCITY; + joint_handle = hardware_interface::JointHandle(js_interface_.getHandle(joint_names_[j]), + &joint_velocity_command_[j]); + vj_interface_.registerHandle(joint_handle); + } + else + { + ROS_FATAL_STREAM_NAMED("default_robot_hw_sim","No matching hardware interface found for '" + << hardware_interface ); + return false; } - // Register interfaces - registerInterface(&js_interface_); - registerInterface(&ej_interface_); - registerInterface(&vj_interface_); + // Get the gazebo joint that corresponds to the robot joint. + //ROS_DEBUG_STREAM_NAMED("default_robot_hw_sim", "Getting pointer to gazebo joint: " + // << joint_names_[j]); + gazebo::physics::JointPtr joint = parent_model->GetJoint(joint_names_[j]); + if (!joint) + { + ROS_ERROR_STREAM("This robot has a joint named \"" << joint_names_[j] + << "\" which is not in the gazebo model."); + return false; + } + sim_joints_.push_back(joint); - // Get the gazebo joints that correspond to the robot joints - for(unsigned int j=0; j < n_dof_; j++) + registerJointLimits(joint_names_[j], joint_handle, joint_control_methods_[j], + joint_limit_nh, urdf_model, + &joint_types_[j], &joint_lower_limits_[j], &joint_upper_limits_[j], + &joint_effort_limits_[j]); + if (joint_control_methods_[j] != EFFORT) { - //ROS_DEBUG_STREAM_NAMED("default_robot_hw_sim", "Getting pointer to gazebo joint: " - // << joint_names_[j]); - gazebo::physics::JointPtr joint = parent_model->GetJoint(joint_names_[j]); - if (joint) + // Initialize the PID controller. If no PID gain values are found, use joint->SetAngle() or + // joint->SetVelocity() to control the joint. + const ros::NodeHandle nh(model_nh, robot_namespace + "/gazebo_ros_control/pid_gains/" + + joint_names_[j]); + if (pid_controllers_[j].init(nh, true)) { - sim_joints_.push_back(joint); + switch (joint_control_methods_[j]) + { + case POSITION: + joint_control_methods_[j] = POSITION_PID; + break; + case VELOCITY: + joint_control_methods_[j] = VELOCITY_PID; + break; + } } else { - ROS_ERROR_STREAM("This robot has a joint named \"" << joint_names_[j] - << "\" which is not in the gazebo model."); - return false; + // joint->SetMaxForce() must be called if joint->SetAngle() or joint->SetVelocity() are + // going to be called. joint->SetMaxForce() must *not* be called if joint->SetForce() is + // going to be called. + joint->SetMaxForce(0, joint_effort_limits_[j]); } } - - return true; } - void readSim(ros::Time time, ros::Duration period) + // Register interfaces + registerInterface(&js_interface_); + registerInterface(&ej_interface_); + registerInterface(&pj_interface_); + registerInterface(&vj_interface_); + + return true; +} + +void DefaultRobotHWSim::readSim(ros::Time time, ros::Duration period) +{ + for(unsigned int j=0; j < n_dof_; j++) { - for(unsigned int j=0; j < n_dof_; j++) + // Gazebo has an interesting API... + if (joint_types_[j] == urdf::Joint::PRISMATIC) + { + joint_position_[j] = sim_joints_[j]->GetAngle(0).Radian(); + } + else { - // Gazebo has an interesting API... - // \todo If the joint is a slider joint, do not call shortest_angular_distance(). joint_position_[j] += angles::shortest_angular_distance(joint_position_[j], sim_joints_[j]->GetAngle(0).Radian()); - joint_velocity_[j] = sim_joints_[j]->GetVelocity(0); - joint_effort_[j] = sim_joints_[j]->GetForce((unsigned int)(0)); } + joint_velocity_[j] = sim_joints_[j]->GetVelocity(0); + joint_effort_[j] = sim_joints_[j]->GetForce((unsigned int)(0)); } +} - void writeSim(ros::Time time, ros::Duration period) +void DefaultRobotHWSim::writeSim(ros::Time time, ros::Duration period) +{ + ej_sat_interface_.enforceLimits(period); + ej_limits_interface_.enforceLimits(period); + pj_sat_interface_.enforceLimits(period); + pj_limits_interface_.enforceLimits(period); + vj_sat_interface_.enforceLimits(period); + vj_limits_interface_.enforceLimits(period); + + for(unsigned int j=0; j < n_dof_; j++) { - ej_sat_interface_.enforceLimits(period); - ej_limits_interface_.enforceLimits(period); + switch (joint_control_methods_[j]) + { + case EFFORT: + { + const double effort = joint_effort_command_[j]; + sim_joints_[j]->SetForce(0, effort); + } + break; + + case POSITION: +#if GAZEBO_MAJOR_VERSION >= 4 + sim_joints_[j]->SetPosition(0, joint_position_command_[j]); +#else + sim_joints_[j]->SetAngle(0, joint_position_command_[j]); +#endif + break; + + case POSITION_PID: + { + double error; + switch (joint_types_[j]) + { + case urdf::Joint::REVOLUTE: + angles::shortest_angular_distance_with_limits(joint_position_[j], + joint_position_command_[j], + joint_lower_limits_[j], + joint_upper_limits_[j], + error); + break; + case urdf::Joint::CONTINUOUS: + error = angles::shortest_angular_distance(joint_position_[j], + joint_position_command_[j]); + break; + default: + error = joint_position_command_[j] - joint_position_[j]; + } + + const double effort_limit = joint_effort_limits_[j]; + const double effort = clamp(pid_controllers_[j].computeCommand(error, period), + -effort_limit, effort_limit); + sim_joints_[j]->SetForce(0, effort); + } + break; + + case VELOCITY: + sim_joints_[j]->SetVelocity(0, joint_velocity_command_[j]); + break; + + case VELOCITY_PID: + const double error = joint_velocity_command_[j] - joint_velocity_[j]; + const double effort_limit = joint_effort_limits_[j]; + const double effort = clamp(pid_controllers_[j].computeCommand(error, period), + -effort_limit, effort_limit); + sim_joints_[j]->SetForce(0, effort); + break; + } + } +} - // \todo check if this joint is using a position, velocity, or effort hardware interface - // and set gazebo accordingly - for(unsigned int j=0; j < n_dof_; j++) + +// Register the limits of the joint specified by joint_name and joint_handle. The limits are +// retrieved from joint_limit_nh. If urdf_model is not NULL, limits are retrieved from it also. +// Return the joint's type, lower position limit, upper position limit, and effort limit. +void DefaultRobotHWSim::registerJointLimits(const std::string& joint_name, + const hardware_interface::JointHandle& joint_handle, + const ControlMethod ctrl_method, + const ros::NodeHandle& joint_limit_nh, + const urdf::Model *const urdf_model, + int *const joint_type, double *const lower_limit, + double *const upper_limit, double *const effort_limit) +{ + *joint_type = urdf::Joint::UNKNOWN; + *lower_limit = -std::numeric_limits::max(); + *upper_limit = std::numeric_limits::max(); + *effort_limit = std::numeric_limits::max(); + + joint_limits_interface::JointLimits limits; + bool has_limits = false; + joint_limits_interface::SoftJointLimits soft_limits; + bool has_soft_limits = false; + + if (urdf_model != NULL) + { + const boost::shared_ptr urdf_joint = urdf_model->getJoint(joint_name); + if (urdf_joint != NULL) { - // Gazebo has an interesting API... - sim_joints_[j]->SetForce(0,joint_effort_command_[j]); - - // Output debug every nth msg - if( !(j % 10) && false) - { - ROS_DEBUG_STREAM_NAMED("robot_hw_sim","SetForce " << joint_effort_command_[j]); - } + *joint_type = urdf_joint->type; + // Get limits from the URDF file. + if (joint_limits_interface::getJointLimits(urdf_joint, limits)) + has_limits = true; + if (joint_limits_interface::getSoftJointLimits(urdf_joint, soft_limits)) + has_soft_limits = true; } } + // Get limits from the parameter server. + if (joint_limits_interface::getJointLimits(joint_name, joint_limit_nh, limits)) + has_limits = true; + + if (!has_limits) + return; -private: - // Register the limits of the joint specified by joint_name and joint_handle. The limits are - // retrieved from joint_limit_nh. If urdf_model is not NULL, limits are retrieved from it also. - void registerEffortJointLimits(const std::string& joint_name, - const hardware_interface::JointHandle& joint_handle, - const ros::NodeHandle& joint_limit_nh, - const urdf::Model *const urdf_model) + if (*joint_type == urdf::Joint::UNKNOWN) { - joint_limits_interface::JointLimits limits; - bool has_limits = false; - joint_limits_interface::SoftJointLimits soft_limits; - bool has_soft_limits = false; + // Infer the joint type. - if (urdf_model != NULL) + if (limits.has_position_limits) { - const boost::shared_ptr urdf_joint = urdf_model->getJoint(joint_name); - if (urdf_joint != NULL) - { - // Get limits from the URDF file. - if (joint_limits_interface::getJointLimits(urdf_joint, limits)) - has_limits = true; - if (joint_limits_interface::getSoftJointLimits(urdf_joint, soft_limits)) - has_soft_limits = true; - } + *joint_type = urdf::Joint::REVOLUTE; } - // Get limits from the parameter server. - if (joint_limits_interface::getJointLimits(joint_name, joint_limit_nh, limits)) - has_limits = true; - - if (has_limits) + else { - if (has_soft_limits) - { - const joint_limits_interface::EffortJointSoftLimitsHandle - limits_handle(joint_handle, limits, soft_limits); - ej_limits_interface_.registerHandle(limits_handle); - } + if (limits.angle_wraparound) + *joint_type = urdf::Joint::CONTINUOUS; else - { - const joint_limits_interface::EffortJointSaturationHandle sat_handle(joint_handle, limits); - ej_sat_interface_.registerHandle(sat_handle); - } + *joint_type = urdf::Joint::PRISMATIC; } } - unsigned int n_dof_; - - hardware_interface::JointStateInterface js_interface_; - hardware_interface::EffortJointInterface ej_interface_; - hardware_interface::VelocityJointInterface vj_interface_; - - joint_limits_interface::EffortJointSaturationInterface ej_sat_interface_; - joint_limits_interface::EffortJointSoftLimitsInterface ej_limits_interface_; - - std::vector joint_names_; - std::vector joint_position_; - std::vector joint_velocity_; - std::vector joint_effort_; - std::vector joint_effort_command_; - std::vector joint_velocity_command_; + if (limits.has_position_limits) + { + *lower_limit = limits.min_position; + *upper_limit = limits.max_position; + } + if (limits.has_effort_limits) + *effort_limit = limits.max_effort; - std::vector sim_joints_; -}; + if (has_soft_limits) + { + switch (ctrl_method) + { + case EFFORT: + { + const joint_limits_interface::EffortJointSoftLimitsHandle + limits_handle(joint_handle, limits, soft_limits); + ej_limits_interface_.registerHandle(limits_handle); + } + break; + case POSITION: + { + const joint_limits_interface::PositionJointSoftLimitsHandle + limits_handle(joint_handle, limits, soft_limits); + pj_limits_interface_.registerHandle(limits_handle); + } + break; + case VELOCITY: + { + const joint_limits_interface::VelocityJointSoftLimitsHandle + limits_handle(joint_handle, limits, soft_limits); + vj_limits_interface_.registerHandle(limits_handle); + } + break; + } + } + else + { + switch (ctrl_method) + { + case EFFORT: + { + const joint_limits_interface::EffortJointSaturationHandle + sat_handle(joint_handle, limits); + ej_sat_interface_.registerHandle(sat_handle); + } + break; + case POSITION: + { + const joint_limits_interface::PositionJointSaturationHandle + sat_handle(joint_handle, limits); + pj_sat_interface_.registerHandle(sat_handle); + } + break; + case VELOCITY: + { + const joint_limits_interface::VelocityJointSaturationHandle + sat_handle(joint_handle, limits); + vj_sat_interface_.registerHandle(sat_handle); + } + break; + } + } +} -typedef boost::shared_ptr DefaultRobotHWSimPtr; } -// \todo PLUGINLIB_DECLARE_CLASS has been deprecated. Replace it with PLUGINLIB_EXPORT_CLASS. -PLUGINLIB_DECLARE_CLASS(gazebo_ros_control, - DefaultRobotHWSim, - gazebo_ros_control::DefaultRobotHWSim, - gazebo_ros_control::RobotHWSim) - -#endif // #ifndef __GAZEBO_ROS_CONTROL_PLUGIN_DEFAULT_ROBOT_HW_SIM_H_ +PLUGINLIB_EXPORT_CLASS(gazebo_ros_control::DefaultRobotHWSim, gazebo_ros_control::RobotHWSim) diff --git a/gazebo_ros_control/src/gazebo_ros_control_plugin.cpp b/gazebo_ros_control/src/gazebo_ros_control_plugin.cpp index 093334b97..120432e38 100644 --- a/gazebo_ros_control/src/gazebo_ros_control_plugin.cpp +++ b/gazebo_ros_control/src/gazebo_ros_control_plugin.cpp @@ -111,7 +111,7 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element } // Get the Gazebo simulation period - ros::Duration gazebo_period(parent_model_->GetWorld()->GetPhysicsEngine()->GetUpdatePeriod()); + ros::Duration gazebo_period(parent_model_->GetWorld()->GetPhysicsEngine()->GetMaxStepSize()); // Decide the plugin control period if(sdf_->HasElement("controlPeriod")) @@ -140,7 +140,6 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element // Get parameters/settings for controllers from ROS param server model_nh_ = ros::NodeHandle(robot_namespace_); - nh_ = ros::NodeHandle(); ROS_INFO_NAMED("gazebo_ros_control", "Starting gazebo_ros_control plugin in namespace: %s", robot_namespace_.c_str()); // Read urdf from ros parameter server then @@ -149,7 +148,7 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element const std::string urdf_string = getURDF(robot_description_); if (!parseTransmissionsFromURDF(urdf_string)) { - ROS_ERROR("gazebo_ros_control", "Error parsing URDF in gazebo_ros_control plugin, plugin not active.\n"); + ROS_ERROR_NAMED("gazebo_ros_control", "Error parsing URDF in gazebo_ros_control plugin, plugin not active.\n"); return; } @@ -196,23 +195,32 @@ void GazeboRosControlPlugin::Update() // Get the simulation time and period gazebo::common::Time gz_time_now = parent_model_->GetWorld()->GetSimTime(); ros::Time sim_time_ros(gz_time_now.sec, gz_time_now.nsec); - ros::Duration sim_period = sim_time_ros - last_sim_time_ros_; + ros::Duration sim_period = sim_time_ros - last_update_sim_time_ros_; // Check if we should update the controllers if(sim_period >= control_period_) { // Store this simulation time - last_sim_time_ros_ = sim_time_ros; + last_update_sim_time_ros_ = sim_time_ros; // Update the robot simulation with the state of the gazebo model robot_hw_sim_->readSim(sim_time_ros, sim_period); // Compute the controller commands controller_manager_->update(sim_time_ros, sim_period); - - // Update the gazebo model with the result of the controller - // computation - robot_hw_sim_->writeSim(sim_time_ros, sim_period); } + + // Update the gazebo model with the result of the controller + // computation + robot_hw_sim_->writeSim(sim_time_ros, sim_time_ros - last_write_sim_time_ros_); + last_write_sim_time_ros_ = sim_time_ros; +} + +// Called on world reset +void GazeboRosControlPlugin::Reset() +{ + // Reset timing variables to not pass negative update periods to controllers on world reset + last_update_sim_time_ros_ = ros::Time(); + last_write_sim_time_ros_ = ros::Time(); } // Get the URDF XML from the parameter server @@ -224,19 +232,19 @@ std::string GazeboRosControlPlugin::getURDF(std::string param_name) const while (urdf_string.empty()) { std::string search_param_name; - if (nh_.searchParam(param_name, search_param_name)) + if (model_nh_.searchParam(param_name, search_param_name)) { ROS_INFO_ONCE_NAMED("gazebo_ros_control", "gazebo_ros_control plugin is waiting for model" " URDF in parameter [%s] on the ROS param server.", search_param_name.c_str()); - nh_.getParam(search_param_name, urdf_string); + model_nh_.getParam(search_param_name, urdf_string); } else { ROS_INFO_ONCE_NAMED("gazebo_ros_control", "gazebo_ros_control plugin is waiting for model" " URDF in parameter [%s] on the ROS param server.", robot_description_.c_str()); - nh_.getParam(param_name, urdf_string); + model_nh_.getParam(param_name, urdf_string); } usleep(100000); diff --git a/gazebo_ros_pkgs/CHANGELOG.rst b/gazebo_ros_pkgs/CHANGELOG.rst index 123f67bab..5c1762418 100644 --- a/gazebo_ros_pkgs/CHANGELOG.rst +++ b/gazebo_ros_pkgs/CHANGELOG.rst @@ -2,9 +2,43 @@ Changelog for package gazebo_ros_pkgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.4.6 (2014-09-01) +------------------ + +2.4.5 (2014-08-18) +------------------ + +2.4.4 (2014-07-18) +------------------ +* Updated package.xml +* Fix repo names in package.xml's +* Contributors: Dave Coleman, Jon Binney + +2.4.3 (2014-05-12) +------------------ + +2.4.2 (2014-03-27) +------------------ +* merging from hydro-devel +* bump patch version for indigo-devel to 2.4.1 +* merging from indigo-devel after 2.3.4 release +* "2.4.0" +* catkin_generate_changelog +* Contributors: John Hsu + +2.4.1 (2013-11-13) +------------------ +* rerelease because sdformat became libsdformat, but we also based change on 2.3.4 in hydro-devel. + 2.4.0 (2013-10-14) ------------------ +2.3.5 (2014-03-26) +------------------ + +2.3.4 (2013-11-13) +------------------ + 2.3.3 (2013-10-10) ------------------ diff --git a/gazebo_ros_pkgs/package.xml b/gazebo_ros_pkgs/package.xml index 75ee87432..19e4c2d0d 100644 --- a/gazebo_ros_pkgs/package.xml +++ b/gazebo_ros_pkgs/package.xml @@ -1,17 +1,16 @@ gazebo_ros_pkgs - 2.4.0 + 2.4.6 Interface for using ROS with the Gazebo simulator. John Hsu - Dave Coleman BSD,LGPL,Apache 2.0 http://gazebosim.org/wiki/Tutorials#ROS_Integration - https://github.com/osrf/gazebo_ros_pkgs/issues - https://github.com/osrf/gazebo_ros_pkgs + https://github.com/ros-simulation/gazebo_ros_pkgs/issues + https://github.com/ros-simulation/gazebo_ros_pkgs John Hsu, Nate Koenig, Dave Coleman>