diff --git a/.gitignore b/.gitignore index e0275ce..43ed185 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,3 @@ CATKIN_IGNORE *.swp log/ test/ - -# Unity -# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore diff --git a/CMakeLists.txt b/CMakeLists.txt index d391842..641c36e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(new_bcr_robot) find_package(ament_cmake REQUIRED) install(DIRECTORY launch meshes models urdf worlds rviz - DESTINATION share/${PROJECT_NAME}/ + DESTINATION share/${PROJECT_NAME}/ ) ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.sh.in") diff --git a/hooks/new_bcr_robot.sh.in b/hooks/new_bcr_robot.sh.in index 4b9e00e..84256f3 100644 --- a/hooks/new_bcr_robot.sh.in +++ b/hooks/new_bcr_robot.sh.in @@ -1,9 +1,12 @@ # Default gazebo env variables -FILE=/usr/share/gazebo/setup.bash -if test -f "$FILE"; then - source $FILE +GAZEBO_CLASSIC_SOURCE_FILE=/usr/share/gazebo/setup.bash +if test -f "$GAZEBO_CLASSIC_SOURCE_FILE"; then + source $GAZEBO_CLASSIC_SOURCE_FILE + # Adding our models to the GAZEBO_MODEL_PATH + ament_prepend_unique_value GAZEBO_MODEL_PATH "$COLCON_CURRENT_PREFIX/share/@PROJECT_NAME@/models" fi -# Adding our models to the GAZEBO_MODEL_PATH -ament_prepend_unique_value GAZEBO_MODEL_PATH "$COLCON_CURRENT_PREFIX/share/@PROJECT_NAME@/models" - +GZ_FORTRESS_DIRECTORY=/usr/share/ignition +if test -d "$GZ_FORTRESS_DIRECTORY"; then + ament_prepend_unique_value IGN_GAZEBO_RESOURCE_PATH "$COLCON_CURRENT_PREFIX/share/@PROJECT_NAME@/models" +fi \ No newline at end of file diff --git a/launch/gz.launch.py b/launch/gz.launch.py index 058f62c..999d806 100644 --- a/launch/gz.launch.py +++ b/launch/gz.launch.py @@ -84,6 +84,19 @@ def generate_launch_description(): ], ) + transform_publisher = Node( + package="tf2_ros", + executable="static_transform_publisher", + arguments = ["--x", "0.0", + "--y", "0.0", + "--z", "0.0", + "--yaw", "0.0", + "--pitch", "0.0", + "--roll", "0.0", + "--frame-id", "kinect_camera", + "--child-frame-id", "new_bcr_robot/base_link/kinect_camera"] + ) + return LaunchDescription([ DeclareLaunchArgument("use_sim_time", default_value=use_sim_time), DeclareLaunchArgument("world_file", default_value=world_file), @@ -91,5 +104,6 @@ def generate_launch_description(): DeclareLaunchArgument("y", default_value="0.0"), DeclareLaunchArgument("yaw", default_value="0.0"), robot_state_publisher, - gz_sim, gz_spawn_entity, gz_ros2_bridge + gz_sim, gz_spawn_entity, gz_ros2_bridge, + transform_publisher ]) \ No newline at end of file diff --git a/package.xml b/package.xml index 69f43e7..245fa70 100644 --- a/package.xml +++ b/package.xml @@ -1,26 +1,26 @@ - new_bcr_robot - 0.5.0 - new_bcr_robot + new_bcr_robot + 0.5.0 + new_bcr_robot - leander + leander - (C) Black Coffee Robotics + (C) Black Coffee Robotics - ament_cmake + ament_cmake - ament_index_python - launch - launch_ros - robot_state_publisher - xacro + ament_index_python + launch + launch_ros + robot_state_publisher + xacro - ament_cmake_gtest - ament_lint_auto - ament_lint_common + ament_cmake_gtest + ament_lint_auto + ament_lint_common - - ament_cmake - + + ament_cmake + \ No newline at end of file diff --git a/urdf/gazebo.xacro b/urdf/gazebo.xacro index 01037c1..469cff3 100644 --- a/urdf/gazebo.xacro +++ b/urdf/gazebo.xacro @@ -9,10 +9,10 @@ - - $(arg robot_namespace) - cmd_vel:=cmd_vel - odom:=odom + + $(arg robot_namespace) + cmd_vel:=cmd_vel + odom:=odom false 50.0 @@ -28,7 +28,6 @@ $(arg publish_wheel_odom_tf) false true - 5.0 @@ -66,7 +65,6 @@ - @@ -125,9 +123,7 @@ - - 0 0 0 0 0 0 true @@ -154,7 +150,6 @@ - diff --git a/urdf/macros.xacro b/urdf/macros.xacro index 134b3e8..2baf6c8 100644 --- a/urdf/macros.xacro +++ b/urdf/macros.xacro @@ -3,93 +3,88 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - 0.0 - - - - - - - - - - - - Gazebo/Black - - - - - - - - - - - - - - - - - - - - - - 5.0 - - - - - - - - - - - Gazebo/Black - - - - - + + + + + + + + + + + + + + + + 0.0 + + + + + + + + + + + Gazebo/Black + + + + + + + + + + + + + + + + + + + + 5.0 + + + + + + + + + + + Gazebo/Black + + + + \ No newline at end of file diff --git a/urdf/materials.xacro b/urdf/materials.xacro index 38077c2..15bf77c 100644 --- a/urdf/materials.xacro +++ b/urdf/materials.xacro @@ -1,56 +1,56 @@ - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + \ No newline at end of file