From 61229e68e48b5e1e9f439e641de2aa3f9c3f37af Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:24:10 +0100 Subject: [PATCH 01/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6777ed..6ed37cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,4 +22,4 @@ jobs: ros-distro: humble - name: Build workspace - run: source /opt/ros/humble/setup.bash & colcon build + run: source /opt/ros/humble/setup.bash From f3aeb26ed5b1b0edf0c9b70a53f09e86ddfe00c4 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:30:27 +0100 Subject: [PATCH 02/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ed37cd..c0efe7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,4 +22,4 @@ jobs: ros-distro: humble - name: Build workspace - run: source /opt/ros/humble/setup.bash + run: ./opt/ros/humble/setup.bash From 8301d719f876402a853e879441aef3b1a8b2c5c8 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:33:47 +0100 Subject: [PATCH 03/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0efe7e..41640a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,4 +22,4 @@ jobs: ros-distro: humble - name: Build workspace - run: ./opt/ros/humble/setup.bash + run: /bin/bash /opt/ros/humble/setup.bash From 2c7972f720d379e47d3fd54e03f99630cb9b1e31 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:40:57 +0100 Subject: [PATCH 04/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41640a9..08f18a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - name: Set up ROS uses: ros-tooling/setup-ros@v0.7 with: - ros-distro: humble + required-ros-distributions: humble - name: Build workspace run: /bin/bash /opt/ros/humble/setup.bash From f35d01c3878883c35a80bfee559ae0aa68219ae6 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:44:07 +0100 Subject: [PATCH 05/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08f18a5..062b717 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,4 +22,4 @@ jobs: required-ros-distributions: humble - name: Build workspace - run: /bin/bash /opt/ros/humble/setup.bash + run: /bin/bash /opt/ros/humble/setup.bash && colcon build From 50118013501d436bf1ba089e0de945c6584f4134 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:54:16 +0100 Subject: [PATCH 06/20] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 062b717..555e886 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,4 +22,5 @@ jobs: required-ros-distributions: humble - name: Build workspace - run: /bin/bash /opt/ros/humble/setup.bash && colcon build + run: sudo apt-get update & sudo apt-get -y install ament-cmake & \ + /bin/bash /opt/ros/humble/setup.bash && colcon build From e6d002d46dcfb322069bff25543c7ec82ec9b0af Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:58:45 +0100 Subject: [PATCH 07/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 555e886..b746a35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,5 +22,5 @@ jobs: required-ros-distributions: humble - name: Build workspace - run: sudo apt-get update & sudo apt-get -y install ament-cmake & \ + run: sudo apt-get update & sudo apt-get -y install ament-cmake &&\ /bin/bash /opt/ros/humble/setup.bash && colcon build From 85397b6b20b2d12fc7db1dfb77183ad1ffa0adb1 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:09:00 +0100 Subject: [PATCH 08/20] Update main.yml --- .github/workflows/main.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b746a35..87f2475 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,14 +13,8 @@ jobs: container: image: ubuntu:jammy steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up ROS - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: humble - - - name: Build workspace - run: sudo apt-get update & sudo apt-get -y install ament-cmake &&\ - /bin/bash /opt/ros/humble/setup.bash && colcon build + - name: ROS industrial_ci + # You may pin to the exact commit or the version. + # uses: 2lambda123/industrial_ci@1425bd2140a5cad7c7b831e43c443336783cc449 + uses: 2lambda123/industrial_ci@0.10.0 + From 49ab1b7d95a10725a00e8a3de783f4d8ab4f884f Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:15:53 +0100 Subject: [PATCH 09/20] Update main.yml --- .github/workflows/main.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87f2475..7f419d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: ROS 2 Workspace Action +name: Humble Source Build # You may pin to the exact commit or the version. # uses: ros/tooling-setup-actions/setup-ros@v1 @@ -8,13 +8,17 @@ on: - ezBot-ROS_ws jobs: - build: + build_docker: runs-on: ubuntu-latest container: image: ubuntu:jammy steps: - - name: ROS industrial_ci - # You may pin to the exact commit or the version. - # uses: 2lambda123/industrial_ci@1425bd2140a5cad7c7b831e43c443336783cc449 - uses: 2lambda123/industrial_ci@0.10.0 - + - uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: humble + - run: "source /opt/ros/humble/setup.bash && ros2 run --help" + - run: "source /opt/ros/noetic/setup.bash && rosnode --help" + - uses: ros-tooling/action-ros-ci@v0.3 + with: + package-name: my_package + target-ros2-distro: humble From 8f3ede604b7f01728c1013e5cdc25cddd4941f72 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:21:13 +0100 Subject: [PATCH 10/20] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f419d9..017b6d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,9 @@ jobs: with: required-ros-distributions: humble - run: "source /opt/ros/humble/setup.bash && ros2 run --help" + shell: bash - run: "source /opt/ros/noetic/setup.bash && rosnode --help" + shell: bash - uses: ros-tooling/action-ros-ci@v0.3 with: package-name: my_package From 3823913fd1895cd533bff5cc6c43b1404faac38c Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:25:25 +0100 Subject: [PATCH 11/20] Update main.yml --- .github/workflows/main.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 017b6d2..119e21d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,26 +1,13 @@ -name: Humble Source Build -# You may pin to the exact commit or the version. -# uses: ros/tooling-setup-actions/setup-ros@v1 - +name: Build and Test on: push: branches: - ezBot-ROS_ws - jobs: - build_docker: + build-and-test: runs-on: ubuntu-latest - container: - image: ubuntu:jammy steps: - - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: humble - - run: "source /opt/ros/humble/setup.bash && ros2 run --help" - shell: bash - - run: "source /opt/ros/noetic/setup.bash && rosnode --help" - shell: bash - - uses: ros-tooling/action-ros-ci@v0.3 - with: - package-name: my_package - target-ros2-distro: humble + - name: Checking out + uses: actions/checkout@v2.3.4 + - name: Building and testing + uses: ichiro-its/ros2-ci@v1.0.0 From 9c48ccc93010a4b12eb7f8ac75cec827b4c82a62 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:34:34 +0100 Subject: [PATCH 12/20] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 119e21d..038e67a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,3 +11,5 @@ jobs: uses: actions/checkout@v2.3.4 - name: Building and testing uses: ichiro-its/ros2-ci@v1.0.0 + with: + ros2-distro: rolling From fc5dfad7f84931da37cae3312d74354717b015a6 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:36:45 +0100 Subject: [PATCH 13/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 038e67a..8aa5ce3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,4 +12,4 @@ jobs: - name: Building and testing uses: ichiro-its/ros2-ci@v1.0.0 with: - ros2-distro: rolling + ros2-distro: humble From d04444f68f8e3d2ab66db49a71b5a45bcdaf632b Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:38:50 +0100 Subject: [PATCH 14/20] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8aa5ce3..13b99b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,3 +13,4 @@ jobs: uses: ichiro-its/ros2-ci@v1.0.0 with: ros2-distro: humble + apt-packages: gazebo_ros_pkgs From d3f7908bfd4a1c297e2b0929c2f627f32b707a34 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:40:50 +0100 Subject: [PATCH 15/20] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13b99b1..9150463 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,4 +13,4 @@ jobs: uses: ichiro-its/ros2-ci@v1.0.0 with: ros2-distro: humble - apt-packages: gazebo_ros_pkgs + apt-packages: gazebo_dev From fff388ff9cc1dd3b2a52aa8ae7848f204e4c0b6b Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:45:21 +0100 Subject: [PATCH 16/20] Update main.yml --- .github/workflows/main.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9150463..6a9509f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,12 +5,15 @@ on: - ezBot-ROS_ws jobs: build-and-test: + name: Build and Test runs-on: ubuntu-latest steps: - - name: Checking out - uses: actions/checkout@v2.3.4 - - name: Building and testing - uses: ichiro-its/ros2-ci@v1.0.0 + - name: Checkout + uses: actions/checkout@v4.0.0 with: - ros2-distro: humble - apt-packages: gazebo_dev + path: workspace + + - name: Build and test workspace + uses: ichiro-its/ros2-ws-action@v1.0.0 + with: + distro: rolling From e99e127de941778cf8c3a1fee3e9ba9322dfbf78 Mon Sep 17 00:00:00 2001 From: Vincent Belpois Date: Tue, 19 Dec 2023 00:57:53 +0100 Subject: [PATCH 17/20] removed tabs --- .../include/gazebo_omni_drive.hpp | 36 +- .../include/gazebo_omni_drive_private.hpp | 232 ++--- .../src/gazebo_omni_drive.cpp | 820 +++++++++--------- 3 files changed, 544 insertions(+), 544 deletions(-) diff --git a/gazebo/omniRobot_plugin/include/gazebo_omni_drive.hpp b/gazebo/omniRobot_plugin/include/gazebo_omni_drive.hpp index d5571ad..e2bf1a6 100644 --- a/gazebo/omniRobot_plugin/include/gazebo_omni_drive.hpp +++ b/gazebo/omniRobot_plugin/include/gazebo_omni_drive.hpp @@ -7,25 +7,25 @@ namespace gazebo_omni_drive_plugins { - class GazeboOmniRosDrive : public gazebo::ModelPlugin - { - public: - /// Constructor - GazeboOmniRosDrive(); - - /// Destructor - ~GazeboOmniRosDrive(); - - protected: - // Documentation inherited - void Load(gazebo::physics::ModelPtr _model, sdf::ElementPtr _sdf) override; +class GazeboOmniRosDrive : public gazebo::ModelPlugin +{ + public: + /// Constructor + GazeboOmniRosDrive(); + + /// Destructor + ~GazeboOmniRosDrive(); + + protected: + // Documentation inherited + void Load(gazebo::physics::ModelPtr _model, sdf::ElementPtr _sdf) override; - // Documentation inherited - void Reset() override; - private: - /// Private data pointer - std::unique_ptr impl_; - }; + // Documentation inherited + void Reset() override; + private: + /// Private data pointer + std::unique_ptr impl_; +}; } // namespace gazebo_plugins diff --git a/gazebo/omniRobot_plugin/include/gazebo_omni_drive_private.hpp b/gazebo/omniRobot_plugin/include/gazebo_omni_drive_private.hpp index c6febf9..e3e84e8 100644 --- a/gazebo/omniRobot_plugin/include/gazebo_omni_drive_private.hpp +++ b/gazebo/omniRobot_plugin/include/gazebo_omni_drive_private.hpp @@ -35,171 +35,171 @@ namespace gazebo_omni_drive_plugins { - class GazeboOmniRosDrivePrivate +class GazeboOmniRosDrivePrivate +{ + public: + + /// Indicates which wheel + enum { - public: + NORTH = 0, //left rear + WEST = 1, //left front + SOUTH = 2, //right front + EAST = 3, //right rear + }; - /// Indicates which wheel - enum - { - NORTH = 0, //left rear - WEST = 1, //left front - SOUTH = 2, //right front - EAST = 3, //right rear - }; - - /// Callback to be called at every simulation iteration. - /// \param[in] _info Updated simulation info. - void OnUpdate(const gazebo::common::UpdateInfo & _info); + /// Callback to be called at every simulation iteration. + /// \param[in] _info Updated simulation info. + void OnUpdate(const gazebo::common::UpdateInfo & _info); - /// Callback when a velocity command is received. - /// \param[in] _msg Twist command message. - void OnCmdVel(const geometry_msgs::msg::Twist::SharedPtr _msg); + /// Callback when a velocity command is received. + /// \param[in] _msg Twist command message. + void OnCmdVel(const geometry_msgs::msg::Twist::SharedPtr _msg); - /// Update wheel velocities according to latest target velocities. - void UpdateWheelVelocities(); + /// Update wheel velocities according to latest target velocities. + void UpdateWheelVelocities(); - /// Publish odometry transforms - /// \param[in] _current_time Current simulation time - void PublishOdometryTf(const gazebo::common::Time & _current_time); + /// Publish odometry transforms + /// \param[in] _current_time Current simulation time + void PublishOdometryTf(const gazebo::common::Time & _current_time); - /// Publish trasforms for the wheels - /// \param[in] _current_time Current simulation time - void PublishWheelsTf(const gazebo::common::Time & _current_time); + /// Publish trasforms for the wheels + /// \param[in] _current_time Current simulation time + void PublishWheelsTf(const gazebo::common::Time & _current_time); - /// Publish odometry messages - /// \param[in] _current_time Current simulation time - void PublishOdometryMsg(const gazebo::common::Time & _current_time); + /// Publish odometry messages + /// \param[in] _current_time Current simulation time + void PublishOdometryMsg(const gazebo::common::Time & _current_time); - /// A pointer to the GazeboROS node. - gazebo_ros::Node::SharedPtr ros_node_; + /// A pointer to the GazeboROS node. + gazebo_ros::Node::SharedPtr ros_node_; - /// Subscriber to command velocities - rclcpp::Subscription::SharedPtr cmd_vel_sub_; + /// Subscriber to command velocities + rclcpp::Subscription::SharedPtr cmd_vel_sub_; - /// Odometry publisher - rclcpp::Publisher::SharedPtr odometry_pub_; + /// Odometry publisher + rclcpp::Publisher::SharedPtr odometry_pub_; - /// Connection to event called at every world iteration. - gazebo::event::ConnectionPtr update_connection_; + /// Connection to event called at every world iteration. + gazebo::event::ConnectionPtr update_connection_; - /// Distance between the wheels, in meters. - std::vector wheel_w_separation_; - std::vector wheel_l_separation_; + /// Distance between the wheels, in meters. + std::vector wheel_w_separation_; + std::vector wheel_l_separation_; - /// Diameter of wheels, in meters. - std::vector wheel_diameter_; + /// Diameter of wheels, in meters. + std::vector wheel_diameter_; - /// Maximum wheel torque, in Nm. - double max_wheel_torque_; + /// Maximum wheel torque, in Nm. + double max_wheel_torque_; - /// Maximum wheel acceleration - double max_wheel_accel_; + /// Maximum wheel acceleration + double max_wheel_accel_; - /// Desired wheel speed. - std::vector desired_wheel_speed_; + /// Desired wheel speed. + std::vector desired_wheel_speed_; - /// Speed sent to wheel. - std::vector wheel_speed_instr_;// Unless required by applicable law or agreed to in writing, software + /// Speed sent to wheel. + std::vector wheel_speed_instr_;// 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. - /// Pointers to wheel joints. - std::vector joints_; + /// Pointers to wheel joints. + std::vector joints_; - /// Pointer to model. - gazebo::physics::ModelPtr model_; + /// Pointer to model. + gazebo::physics::ModelPtr model_; - /// To broadcast TFs - std::shared_ptr transform_broadcaster_; + /// To broadcast TFs + std::shared_ptr transform_broadcaster_; - /// Protect variables accessed on callbacks. - std::mutex lock_; + /// Protect variables accessed on callbacks. + std::mutex lock_; - /// Linear velocity in X received on command (m/s). - double target_x_{0.0}; + /// Linear velocity in X received on command (m/s). + double target_x_{0.0}; - /// Linear velocity in Y received on command (m/s). - double target_y_{0.0}; + /// Linear velocity in Y received on command (m/s). + double target_y_{0.0}; - /// Angular velocity in Z received on command (rad/s). - double target_rot_{0.0}; + /// Angular velocity in Z received on command (rad/s). + double target_rot_{0.0}; - /// Update period in seconds. - double update_period_; + /// Update period in seconds. + double update_period_; - /// Last update time. - gazebo::common::Time last_update_time_; + /// Last update time. + gazebo::common::Time last_update_time_; - /// Keep encoder data. - geometry_msgs::msg::Pose2D pose_encoder_; + /// Keep encoder data. + geometry_msgs::msg::Pose2D pose_encoder_; - /// Odometry frame ID - std::string odometry_frame_; + /// Odometry frame ID + std::string odometry_frame_; - /// Odometry topic - std::string odometry_topic_; + /// Odometry topic + std::string odometry_topic_; - /// cmd topic - std::string cmd_topic_; + /// cmd topic + std::string cmd_topic_; - /// Last time the encoder was updated - gazebo::common::Time last_encoder_update_; + /// Last time the encoder was updated + gazebo::common::Time last_encoder_update_; - /// Keep latest odometry message - nav_msgs::msg::Odometry odom_; + /// Keep latest odometry message + nav_msgs::msg::Odometry odom_; - /// Robot base frame ID - std::string robot_base_frame_; + /// Robot base frame ID + std::string robot_base_frame_; - /// True to publish odometry messages. - bool publish_odom_; + /// True to publish odometry messages. + bool publish_odom_; - /// True to publish wheel-to-base transforms. - bool publish_wheel_tf_; + /// True to publish wheel-to-base transforms. + bool publish_wheel_tf_; - /// True to publish odom-to-world transforms. - bool publish_odom_tf_; + /// True to publish odom-to-world transforms. + bool publish_odom_tf_; - /// Store number of wheel pairs - unsigned int num_wheel_pairs_; + /// Store number of wheel pairs + unsigned int num_wheel_pairs_; - /// Covariance in odometry - double covariance_[3]; + /// Covariance in odometry + double covariance_[3]; - /// Has the agv model roller model. - bool isRollerModel_; + /// Has the agv model roller model. + bool isRollerModel_; - /// Get linear velocity after calculating mecanum kinematics. - struct linear_vel - { - double vel_x; - double vel_y; - double vel_th; - }; + /// Get linear velocity after calculating mecanum kinematics. + struct linear_vel + { + double vel_x; + double vel_y; + double vel_th; + }; - linear_vel cal_LineVel_; + linear_vel cal_LineVel_; - struct pid_parameter - { - double p_gain; - double i_gain; - double d_gain; - }; + struct pid_parameter + { + double p_gain; + double i_gain; + double d_gain; + }; - pid_parameter pid_lr, pid_lf, pid_rf, pid_rr; + pid_parameter pid_lr, pid_lf, pid_rf, pid_rr; - /** - * @brief PID control for wheel velocity. - * - * TODO : Update calculation if wheel velocities from mecanum to omniwheel - */ - void calkinematics(linear_vel &line_vel); - void gazebo_PID_WHEEL_(gazebo::physics::JointPtr joint, pid_parameter &pid, double vel); - }; + /** + * @brief PID control for wheel velocity. + * + * TODO : Update calculation if wheel velocities from mecanum to omniwheel + */ + void calkinematics(linear_vel &line_vel); + void gazebo_PID_WHEEL_(gazebo::physics::JointPtr joint, pid_parameter &pid, double vel); +}; } // namespace gazebo_plugins diff --git a/gazebo/omniRobot_plugin/src/gazebo_omni_drive.cpp b/gazebo/omniRobot_plugin/src/gazebo_omni_drive.cpp index 808e001..8e96de4 100644 --- a/gazebo/omniRobot_plugin/src/gazebo_omni_drive.cpp +++ b/gazebo/omniRobot_plugin/src/gazebo_omni_drive.cpp @@ -3,494 +3,494 @@ namespace gazebo_omni_drive_plugins { - GazeboOmniRosDrive::GazeboOmniRosDrive() : impl_(std::make_unique()) - { +GazeboOmniRosDrive::GazeboOmniRosDrive() : impl_(std::make_unique()) +{ - } - - GazeboOmniRosDrive::~GazeboOmniRosDrive() - { +} - } +GazeboOmniRosDrive::~GazeboOmniRosDrive() +{ + +} + +void GazeboOmniRosDrive::Load(gazebo::physics::ModelPtr _model, sdf::ElementPtr _sdf) +{ + impl_->model_ = _model; - void GazeboOmniRosDrive::Load(gazebo::physics::ModelPtr _model, sdf::ElementPtr _sdf) - { - impl_->model_ = _model; - - // Initialize ROS node - impl_->ros_node_ = gazebo_ros::Node::Get(_sdf); + // Initialize ROS node + impl_->ros_node_ = gazebo_ros::Node::Get(_sdf); - // Get QoS profiles - const gazebo_ros::QoS & qos = impl_->ros_node_->get_qos(); + // Get QoS profiles + const gazebo_ros::QoS & qos = impl_->ros_node_->get_qos(); - // Get number of wheel pairs in the model - impl_->num_wheel_pairs_ = static_cast(_sdf->Get("num_wheel_pairs", 1).first); + // Get number of wheel pairs in the model + impl_->num_wheel_pairs_ = static_cast(_sdf->Get("num_wheel_pairs", 1).first); - if (impl_->num_wheel_pairs_ < 1) - { - impl_->num_wheel_pairs_ = 1; - RCLCPP_WARN(impl_->ros_node_->get_logger(), "Drive requires at least one pair of wheels. Setting [num_wheel_pairs] to 1"); - } + if (impl_->num_wheel_pairs_ < 1) + { + impl_->num_wheel_pairs_ = 1; + RCLCPP_WARN(impl_->ros_node_->get_logger(), "Drive requires at least one pair of wheels. Setting [num_wheel_pairs] to 1"); + } - // Dynamic properties - impl_->max_wheel_accel_ = _sdf->Get("wheelAccel", 0.0).first; - impl_->max_wheel_torque_ = _sdf->Get("WheelTorque", 5.0).first; + // Dynamic properties + impl_->max_wheel_accel_ = _sdf->Get("wheelAccel", 0.0).first; + impl_->max_wheel_torque_ = _sdf->Get("WheelTorque", 5.0).first; - // Get joints and Kinematic properties - std::vector north_joints, west_joints, south_joints, east_joints; + // Get joints and Kinematic properties + std::vector north_joints, west_joints, south_joints, east_joints; - for (auto north_joint_elem = _sdf->GetElement("North"); - north_joint_elem != nullptr; - north_joint_elem = north_joint_elem->GetNextElement("North")) + for (auto north_joint_elem = _sdf->GetElement("North"); + north_joint_elem != nullptr; + north_joint_elem = north_joint_elem->GetNextElement("North")) + { + auto north_joint_name = north_joint_elem->Get(); + auto north_joint = _model->GetJoint(north_joint_name); + if (!north_joint) { - auto north_joint_name = north_joint_elem->Get(); - auto north_joint = _model->GetJoint(north_joint_name); - if (!north_joint) - { - RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", north_joint_name.c_str()); - impl_->ros_node_.reset(); - return; - } - - north_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); - north_joints.push_back(north_joint); + RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", north_joint_name.c_str()); + impl_->ros_node_.reset(); + return; } + + north_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); + north_joints.push_back(north_joint); + } - for (auto west_joint_elem = _sdf->GetElement("West"); - west_joint_elem != nullptr; - west_joint_elem = west_joint_elem->GetNextElement("West")) + for (auto west_joint_elem = _sdf->GetElement("West"); + west_joint_elem != nullptr; + west_joint_elem = west_joint_elem->GetNextElement("West")) + { + auto west_joint_name = west_joint_elem->Get(); + auto west_joint = _model->GetJoint(west_joint_name); + if (!west_joint) { - auto west_joint_name = west_joint_elem->Get(); - auto west_joint = _model->GetJoint(west_joint_name); - if (!west_joint) - { - RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", west_joint_name.c_str()); - impl_->ros_node_.reset(); - return; - } - - west_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); - west_joints.push_back(west_joint); + RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", west_joint_name.c_str()); + impl_->ros_node_.reset(); + return; } - for (auto south_joint_elem = _sdf->GetElement("South"); - south_joint_elem != nullptr; - south_joint_elem = south_joint_elem->GetNextElement("South")) + west_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); + west_joints.push_back(west_joint); + } + + for (auto south_joint_elem = _sdf->GetElement("South"); + south_joint_elem != nullptr; + south_joint_elem = south_joint_elem->GetNextElement("South")) + { + auto south_joint_name = south_joint_elem->Get(); + auto south_joint = _model->GetJoint(south_joint_name); + if (!south_joint) { - auto south_joint_name = south_joint_elem->Get(); - auto south_joint = _model->GetJoint(south_joint_name); - if (!south_joint) - { - RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", south_joint_name.c_str()); - impl_->ros_node_.reset(); - return; - } - - south_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); - south_joints.push_back(south_joint); + RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", south_joint_name.c_str()); + impl_->ros_node_.reset(); + return; } + + south_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); + south_joints.push_back(south_joint); + } - for (auto east_joint_elem = _sdf->GetElement("East"); - east_joint_elem != nullptr; - east_joint_elem = east_joint_elem->GetNextElement("East")) + for (auto east_joint_elem = _sdf->GetElement("East"); + east_joint_elem != nullptr; + east_joint_elem = east_joint_elem->GetNextElement("East")) + { + auto east_joint_name = east_joint_elem->Get(); + auto east_joint = _model->GetJoint(east_joint_name); + if (!east_joint) { - auto east_joint_name = east_joint_elem->Get(); - auto east_joint = _model->GetJoint(east_joint_name); - if (!east_joint) - { - RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", east_joint_name.c_str()); - impl_->ros_node_.reset(); - return; - } - - east_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); - east_joints.push_back(east_joint); + RCLCPP_ERROR(impl_->ros_node_->get_logger(), "Joint [%s] not found, plugin will not work.", east_joint_name.c_str()); + impl_->ros_node_.reset(); + return; } + + east_joint->SetParam("fmax", 0, impl_->max_wheel_torque_); + east_joints.push_back(east_joint); + } - unsigned int index; - for (index = 0; index < impl_->num_wheel_pairs_; ++index) + unsigned int index; + for (index = 0; index < impl_->num_wheel_pairs_; ++index) + { + impl_->joints_.push_back(north_joints[index]); + impl_->joints_.push_back(west_joints[index]); + impl_->joints_.push_back(south_joints[index]); + impl_->joints_.push_back(east_joints[index]); + } + + index = 0; + impl_->wheel_w_separation_.assign(impl_->num_wheel_pairs_, 0.34); + for (auto wheel_w_separation = _sdf->GetElement("WheelSeparationW"); + wheel_w_separation != nullptr; + wheel_w_separation = wheel_w_separation->GetNextElement("WheelSeparationW")) + { + if (index >= impl_->num_wheel_pairs_) { - impl_->joints_.push_back(north_joints[index]); - impl_->joints_.push_back(west_joints[index]); - impl_->joints_.push_back(south_joints[index]); - impl_->joints_.push_back(east_joints[index]); + RCLCPP_WARN(impl_->ros_node_->get_logger(), "Ignoring rest of specified "); + break; } - index = 0; - impl_->wheel_w_separation_.assign(impl_->num_wheel_pairs_, 0.34); - for (auto wheel_w_separation = _sdf->GetElement("WheelSeparationW"); - wheel_w_separation != nullptr; - wheel_w_separation = wheel_w_separation->GetNextElement("WheelSeparationW")) - { - if (index >= impl_->num_wheel_pairs_) - { - RCLCPP_WARN(impl_->ros_node_->get_logger(), "Ignoring rest of specified "); - break; - } - - impl_->wheel_w_separation_[index] = wheel_w_separation->Get(); - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Wheel pair %i separation width set to [%fm]", index + 1, impl_->wheel_w_separation_[index]); - index++; - } + impl_->wheel_w_separation_[index] = wheel_w_separation->Get(); + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Wheel pair %i separation width set to [%fm]", index + 1, impl_->wheel_w_separation_[index]); + index++; + } - index = 0; - impl_->wheel_l_separation_.assign(impl_->num_wheel_pairs_, 0.34); - for (auto wheel_l_separation = _sdf->GetElement("WheelSeparationL"); - wheel_l_separation != nullptr; - wheel_l_separation = wheel_l_separation->GetNextElement("WheelSeparationL")) + index = 0; + impl_->wheel_l_separation_.assign(impl_->num_wheel_pairs_, 0.34); + for (auto wheel_l_separation = _sdf->GetElement("WheelSeparationL"); + wheel_l_separation != nullptr; + wheel_l_separation = wheel_l_separation->GetNextElement("WheelSeparationL")) + { + if (index >= impl_->num_wheel_pairs_) { - if (index >= impl_->num_wheel_pairs_) - { - RCLCPP_WARN(impl_->ros_node_->get_logger(), "Ignoring rest of specified "); - break; - } - - impl_->wheel_l_separation_[index] = wheel_l_separation->Get(); - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Wheel pair %i separation legth set to [%fm]", index + 1, impl_->wheel_l_separation_[index]); - index++; + RCLCPP_WARN(impl_->ros_node_->get_logger(), "Ignoring rest of specified "); + break; } - index = 0; - impl_->wheel_diameter_.assign(impl_->num_wheel_pairs_, 0.15); - for (auto wheel_diameter = _sdf->GetElement("wheelDiameter"); - wheel_diameter != nullptr; - wheel_diameter = wheel_diameter->GetNextElement("wheelDiameter")) + impl_->wheel_l_separation_[index] = wheel_l_separation->Get(); + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Wheel pair %i separation legth set to [%fm]", index + 1, impl_->wheel_l_separation_[index]); + index++; + } + + index = 0; + impl_->wheel_diameter_.assign(impl_->num_wheel_pairs_, 0.15); + for (auto wheel_diameter = _sdf->GetElement("wheelDiameter"); + wheel_diameter != nullptr; + wheel_diameter = wheel_diameter->GetNextElement("wheelDiameter")) + { + if (index >= impl_->num_wheel_pairs_) { - if (index >= impl_->num_wheel_pairs_) - { - RCLCPP_WARN(impl_->ros_node_->get_logger(), "Ignoring rest of specified "); - break; - } - - impl_->wheel_diameter_[index] = wheel_diameter->Get(); - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Wheel pair %i diameter set to [%fm]", index + 1, impl_->wheel_diameter_[index]); - index++; + RCLCPP_WARN(impl_->ros_node_->get_logger(), "Ignoring rest of specified "); + break; } - impl_->wheel_speed_instr_.assign(4 * impl_->num_wheel_pairs_, 0); - impl_->desired_wheel_speed_.assign(4 * impl_->num_wheel_pairs_, 0); - - // Update rate - auto update_rate = _sdf->Get("odometryRate", 20.0).first; - if (update_rate > 0.0) - { - impl_->update_period_ = 1.0 / update_rate; - } - else - { - impl_->update_period_ = 0.0; - } + impl_->wheel_diameter_[index] = wheel_diameter->Get(); + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Wheel pair %i diameter set to [%fm]", index + 1, impl_->wheel_diameter_[index]); + index++; + } + + impl_->wheel_speed_instr_.assign(4 * impl_->num_wheel_pairs_, 0); + impl_->desired_wheel_speed_.assign(4 * impl_->num_wheel_pairs_, 0); + + // Update rate + auto update_rate = _sdf->Get("odometryRate", 20.0).first; + if (update_rate > 0.0) + { + impl_->update_period_ = 1.0 / update_rate; + } + else + { + impl_->update_period_ = 0.0; + } - impl_->cmd_topic_ = _sdf->Get("commandTopic", "cmd_vel").first; - impl_->last_update_time_ = _model->GetWorld()->SimTime(); - impl_->cmd_vel_sub_ = impl_->ros_node_->create_subscription(impl_->cmd_topic_, qos.get_subscription_qos(impl_->cmd_topic_, rclcpp::QoS(1)), - std::bind(&GazeboOmniRosDrivePrivate::OnCmdVel, impl_.get(), std::placeholders::_1)); - - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Subscribed to [%s]", impl_->cmd_vel_sub_->get_topic_name()); - // Odometry - impl_->odometry_frame_ = _sdf->Get("odometryFrame", "odom").first; - impl_->robot_base_frame_ = _sdf->Get("robotBaseFrame", "base_footprint").first; - - // Advertise odometry topic - impl_->publish_odom_ = _sdf->Get("publishOdom", false).first; - if(impl_->publish_odom_) + impl_->cmd_topic_ = _sdf->Get("commandTopic", "cmd_vel").first; + impl_->last_update_time_ = _model->GetWorld()->SimTime(); + impl_->cmd_vel_sub_ = impl_->ros_node_->create_subscription(impl_->cmd_topic_, qos.get_subscription_qos(impl_->cmd_topic_, rclcpp::QoS(1)), + std::bind(&GazeboOmniRosDrivePrivate::OnCmdVel, impl_.get(), std::placeholders::_1)); + + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Subscribed to [%s]", impl_->cmd_vel_sub_->get_topic_name()); + // Odometry + impl_->odometry_frame_ = _sdf->Get("odometryFrame", "odom").first; + impl_->robot_base_frame_ = _sdf->Get("robotBaseFrame", "base_footprint").first; + + // Advertise odometry topic + impl_->publish_odom_ = _sdf->Get("publishOdom", false).first; + if(impl_->publish_odom_) + { + impl_->odometry_topic_ = _sdf->Get("odometryTopic", "odom").first; + impl_->odometry_pub_ = impl_->ros_node_->create_publisher(impl_->odometry_topic_, qos.get_publisher_qos(impl_->odometry_topic_, rclcpp::QoS(1))); + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Advertise odometry on [%s]", impl_->odometry_pub_->get_topic_name()); + } + + // Create TF broadcaster if needed + impl_->publish_wheel_tf_ = _sdf->Get("publishWheelTF", false).first; + impl_->publish_odom_tf_ = _sdf->Get("publishOdomTF", false).first; + if(impl_->publish_wheel_tf_ || impl_->publish_odom_tf_) + { + impl_->transform_broadcaster_ = std::make_shared(impl_->ros_node_); + if(impl_->publish_odom_tf_) { - impl_->odometry_topic_ = _sdf->Get("odometryTopic", "odom").first; - impl_->odometry_pub_ = impl_->ros_node_->create_publisher(impl_->odometry_topic_, qos.get_publisher_qos(impl_->odometry_topic_, rclcpp::QoS(1))); - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Advertise odometry on [%s]", impl_->odometry_pub_->get_topic_name()); + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Publishing odom transforms between [%s] and [%s]", impl_->odometry_frame_.c_str(), + impl_->robot_base_frame_.c_str()); } - // Create TF broadcaster if needed - impl_->publish_wheel_tf_ = _sdf->Get("publishWheelTF", false).first; - impl_->publish_odom_tf_ = _sdf->Get("publishOdomTF", false).first; - if(impl_->publish_wheel_tf_ || impl_->publish_odom_tf_) + for (index = 0; index < impl_->num_wheel_pairs_; ++index) { - impl_->transform_broadcaster_ = std::make_shared(impl_->ros_node_); - if(impl_->publish_odom_tf_) + if(impl_->publish_wheel_tf_) { - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Publishing odom transforms between [%s] and [%s]", impl_->odometry_frame_.c_str(), - impl_->robot_base_frame_.c_str()); - } - - for (index = 0; index < impl_->num_wheel_pairs_; ++index) - { - if(impl_->publish_wheel_tf_) - { - RCLCPP_INFO(impl_->ros_node_->get_logger(), "Publishing wheel transforms between [%s], [%s] , [%s] , [%s], [%s]", - impl_->robot_base_frame_.c_str(), - impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::NORTH]->GetName().c_str(), - impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::WEST]->GetName().c_str(), - impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::SOUTH]->GetName().c_str(), - impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::EAST]->GetName().c_str()); - } + RCLCPP_INFO(impl_->ros_node_->get_logger(), "Publishing wheel transforms between [%s], [%s] , [%s] , [%s], [%s]", + impl_->robot_base_frame_.c_str(), + impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::NORTH]->GetName().c_str(), + impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::WEST]->GetName().c_str(), + impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::SOUTH]->GetName().c_str(), + impl_->joints_[2 * index + GazeboOmniRosDrivePrivate::EAST]->GetName().c_str()); } } - - impl_->isRollerModel_ = _sdf->Get("isRollerModel", true).first; - impl_->covariance_[0] = _sdf->Get("covariance_x", 0.00001).first; - impl_->covariance_[1] = _sdf->Get("covariance_y", 0.00001).first; - impl_->covariance_[2] = _sdf->Get("covariance_yaw", 0.001).first; - - // Listen to the update event (broadcast every simulation iteration) - impl_->update_connection_ = gazebo::event::Events::ConnectWorldUpdateBegin(std::bind(&GazeboOmniRosDrivePrivate::OnUpdate, impl_.get(), std::placeholders::_1)); } + + impl_->isRollerModel_ = _sdf->Get("isRollerModel", true).first; + impl_->covariance_[0] = _sdf->Get("covariance_x", 0.00001).first; + impl_->covariance_[1] = _sdf->Get("covariance_y", 0.00001).first; + impl_->covariance_[2] = _sdf->Get("covariance_yaw", 0.001).first; - void GazeboOmniRosDrive::Reset() + // Listen to the update event (broadcast every simulation iteration) + impl_->update_connection_ = gazebo::event::Events::ConnectWorldUpdateBegin(std::bind(&GazeboOmniRosDrivePrivate::OnUpdate, impl_.get(), std::placeholders::_1)); +} + +void GazeboOmniRosDrive::Reset() +{ + impl_->last_update_time_ = impl_->joints_[GazeboOmniRosDrivePrivate::NORTH]->GetWorld()->SimTime(); + for(unsigned int i = 0; i < impl_->num_wheel_pairs_; ++i) { - impl_->last_update_time_ = impl_->joints_[GazeboOmniRosDrivePrivate::NORTH]->GetWorld()->SimTime(); - for(unsigned int i = 0; i < impl_->num_wheel_pairs_; ++i) + if (impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::NORTH] && impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::WEST] && + impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::SOUTH] && impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::EAST]) { - if (impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::NORTH] && impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::WEST] && - impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::SOUTH] && impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::EAST]) - { - impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::NORTH]->SetParam("fmax", 0, impl_->max_wheel_torque_); - impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::WEST]->SetParam("fmax", 0, impl_->max_wheel_torque_); - impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::SOUTH]->SetParam("fmax", 0, impl_->max_wheel_torque_); - impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::EAST]->SetParam("fmax", 0, impl_->max_wheel_torque_); - } + impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::NORTH]->SetParam("fmax", 0, impl_->max_wheel_torque_); + impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::WEST]->SetParam("fmax", 0, impl_->max_wheel_torque_); + impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::SOUTH]->SetParam("fmax", 0, impl_->max_wheel_torque_); + impl_->joints_[2 * i + GazeboOmniRosDrivePrivate::EAST]->SetParam("fmax", 0, impl_->max_wheel_torque_); } - - impl_->pose_encoder_.x = 0; - impl_->pose_encoder_.y = 0; - impl_->pose_encoder_.theta = 0; - impl_->target_x_ = 0; - impl_->target_rot_ = 0; + } + + impl_->pose_encoder_.x = 0; + impl_->pose_encoder_.y = 0; + impl_->pose_encoder_.theta = 0; + impl_->target_x_ = 0; + impl_->target_rot_ = 0; +} + +void GazeboOmniRosDrivePrivate::OnUpdate(const gazebo::common::UpdateInfo & _info) +{ +#ifdef IGN_PROFILER_ENABLE + IGN_PROFILE("GazeboRosDiffDrivePrivate::OnUpdate"); +#endif + + double seconds_since_last_update = (_info.simTime - last_update_time_).Double(); + if(seconds_since_last_update < update_period_) + { + return; } - void GazeboOmniRosDrivePrivate::OnUpdate(const gazebo::common::UpdateInfo & _info) +#ifdef IGN_PROFILER_ENABLE + IGN_PROFILE_END(); + IGN_PROFILE_BEGIN("PublishOdometryMsg"); +#endif + if(publish_odom_) { + PublishOdometryMsg(_info.simTime); + } #ifdef IGN_PROFILER_ENABLE - IGN_PROFILE("GazeboRosDiffDrivePrivate::OnUpdate"); - #endif - - double seconds_since_last_update = (_info.simTime - last_update_time_).Double(); - if(seconds_since_last_update < update_period_) - { - return; - } + IGN_PROFILE_END(); + IGN_PROFILE_BEGIN("PublishWheelsTf"); +#endif + if(publish_wheel_tf_) + { + PublishWheelsTf(_info.simTime); + } +#ifdef IGN_PROFILER_ENABLE + IGN_PROFILE_END(); + IGN_PROFILE_BEGIN("PublishOdometryTf"); +#endif + if(publish_odom_tf_) + { + PublishOdometryTf(_info.simTime); + } +#ifdef IGN_PROFILER_ENABLE + IGN_PROFILE_END(); + IGN_PROFILE_BEGIN("UpdateWheelVelocities"); +#endif +// Update robot in case new velocities have been requested +UpdateWheelVelocities(); +#ifdef IGN_PROFILER_ENABLE + IGN_PROFILE_END(); +#endif + // Current speed + std::vector current_speed(4 * num_wheel_pairs_); + for(unsigned int i = 0; i < num_wheel_pairs_; ++i) + { + current_speed[2 * i + NORTH] = joints_[2 * i + NORTH]->GetVelocity(0); + current_speed[2 * i + WEST] = joints_[2 * i + WEST]->GetVelocity(0); + current_speed[2 * i + SOUTH] = joints_[2 * i + SOUTH]->GetVelocity(0); + current_speed[2 * i + EAST] = joints_[2 * i + EAST]->GetVelocity(0); + } - #ifdef IGN_PROFILER_ENABLE - IGN_PROFILE_END(); - IGN_PROFILE_BEGIN("PublishOdometryMsg"); - #endif - if(publish_odom_) - { - PublishOdometryMsg(_info.simTime); - } - #ifdef IGN_PROFILER_ENABLE - IGN_PROFILE_END(); - IGN_PROFILE_BEGIN("PublishWheelsTf"); - #endif - if(publish_wheel_tf_) - { - PublishWheelsTf(_info.simTime); - } - #ifdef IGN_PROFILER_ENABLE - IGN_PROFILE_END(); - IGN_PROFILE_BEGIN("PublishOdometryTf"); - #endif - if(publish_odom_tf_) - { - PublishOdometryTf(_info.simTime); - } - #ifdef IGN_PROFILER_ENABLE - IGN_PROFILE_END(); - IGN_PROFILE_BEGIN("UpdateWheelVelocities"); - #endif - // Update robot in case new velocities have been requested - UpdateWheelVelocities(); - #ifdef IGN_PROFILER_ENABLE - IGN_PROFILE_END(); - #endif - // Current speed - std::vector current_speed(4 * num_wheel_pairs_); - for(unsigned int i = 0; i < num_wheel_pairs_; ++i) + // If max_accel == 0, or target speed is reached + for(unsigned int i = 0; i < num_wheel_pairs_; ++i) + { + if(max_wheel_accel_ == 0 || + ((fabs(desired_wheel_speed_[2 * i + NORTH] - current_speed[2 * i + NORTH]) < 0.01) && + (fabs(desired_wheel_speed_[2 * i + WEST] - current_speed[2 * i + WEST]) < 0.01) && + (fabs(desired_wheel_speed_[2 * i + SOUTH] - current_speed[2 * i + SOUTH]) < 0.01) && + (fabs(desired_wheel_speed_[2 * i + EAST] - current_speed[2 * i + EAST]) < 0.01))) { - current_speed[2 * i + NORTH] = joints_[2 * i + NORTH]->GetVelocity(0); - current_speed[2 * i + WEST] = joints_[2 * i + WEST]->GetVelocity(0); - current_speed[2 * i + SOUTH] = joints_[2 * i + SOUTH]->GetVelocity(0); - current_speed[2 * i + EAST] = joints_[2 * i + EAST]->GetVelocity(0); + joints_[2 * i + NORTH]->SetParam("vel", 0, desired_wheel_speed_[2 * i + NORTH]); + joints_[2 * i + WEST]->SetParam("vel", 0, desired_wheel_speed_[2 * i + WEST]); + joints_[2 * i + SOUTH]->SetParam("vel", 0, desired_wheel_speed_[2 * i + SOUTH]); + joints_[2 * i + EAST]->SetParam("vel", 0, desired_wheel_speed_[2 * i + EAST]); } - - // If max_accel == 0, or target speed is reached - for(unsigned int i = 0; i < num_wheel_pairs_; ++i) + else { - if(max_wheel_accel_ == 0 || - ((fabs(desired_wheel_speed_[2 * i + NORTH] - current_speed[2 * i + NORTH]) < 0.01) && - (fabs(desired_wheel_speed_[2 * i + WEST] - current_speed[2 * i + WEST]) < 0.01) && - (fabs(desired_wheel_speed_[2 * i + SOUTH] - current_speed[2 * i + SOUTH]) < 0.01) && - (fabs(desired_wheel_speed_[2 * i + EAST] - current_speed[2 * i + EAST]) < 0.01))) + if(desired_wheel_speed_[2 * i + NORTH] >= current_speed[2 * i + NORTH]) { - joints_[2 * i + NORTH]->SetParam("vel", 0, desired_wheel_speed_[2 * i + NORTH]); - joints_[2 * i + WEST]->SetParam("vel", 0, desired_wheel_speed_[2 * i + WEST]); - joints_[2 * i + SOUTH]->SetParam("vel", 0, desired_wheel_speed_[2 * i + SOUTH]); - joints_[2 * i + EAST]->SetParam("vel", 0, desired_wheel_speed_[2 * i + EAST]); + wheel_speed_instr_[2 * i + NORTH] += fmin(desired_wheel_speed_[2 * i + NORTH] - current_speed[2 * i + NORTH], max_wheel_accel_ * seconds_since_last_update); } else { - if(desired_wheel_speed_[2 * i + NORTH] >= current_speed[2 * i + NORTH]) - { - wheel_speed_instr_[2 * i + NORTH] += fmin(desired_wheel_speed_[2 * i + NORTH] - current_speed[2 * i + NORTH], max_wheel_accel_ * seconds_since_last_update); - } - else - { - wheel_speed_instr_[2 * i + NORTH] += fmax(desired_wheel_speed_[2 * i + NORTH] - current_speed[2 * i + NORTH], -max_wheel_accel_ * seconds_since_last_update); - } - - if(desired_wheel_speed_[2 * i + WEST] >= current_speed[2 * i + WEST]) - { - wheel_speed_instr_[2 * i + WEST] += fmin(desired_wheel_speed_[2 * i + WEST] - current_speed[2 * i + WEST], max_wheel_accel_ * seconds_since_last_update); - } - else - { - wheel_speed_instr_[2 * i + WEST] += fmax(desired_wheel_speed_[2 * i + WEST] - current_speed[2 * i + WEST], -max_wheel_accel_ * seconds_since_last_update); - } - - if (desired_wheel_speed_[2 * i + SOUTH] > current_speed[2 * i + SOUTH]) - { - wheel_speed_instr_[2 * i + SOUTH] += fmin(desired_wheel_speed_[2 * i + SOUTH] - current_speed[2 * i + SOUTH], max_wheel_accel_ * seconds_since_last_update); - } - else - { - wheel_speed_instr_[2 * i + SOUTH] += fmax(desired_wheel_speed_[2 * i + SOUTH] - current_speed[2 * i + SOUTH], -max_wheel_accel_ * seconds_since_last_update); - } - - if (desired_wheel_speed_[2 * i + EAST] > current_speed[2 * i + EAST]) - { - wheel_speed_instr_[2 * i + EAST] += fmin(desired_wheel_speed_[2 * i + EAST] - current_speed[2 * i + EAST], max_wheel_accel_ * seconds_since_last_update); - } - else - { - wheel_speed_instr_[2 * i + EAST] += fmax(desired_wheel_speed_[2 * i + EAST] - current_speed[2 * i + EAST], -max_wheel_accel_ * seconds_since_last_update); - } - - joints_[2 * i + NORTH]->SetParam("vel", 0, wheel_speed_instr_[2 * i + NORTH]); - joints_[2 * i + WEST]->SetParam("vel", 0, wheel_speed_instr_[2 * i + WEST]); - joints_[2 * i + SOUTH]->SetParam("vel", 0, wheel_speed_instr_[2 * i + SOUTH]); - joints_[2 * i + EAST]->SetParam("vel", 0, wheel_speed_instr_[2 * i + EAST]); + wheel_speed_instr_[2 * i + NORTH] += fmax(desired_wheel_speed_[2 * i + NORTH] - current_speed[2 * i + NORTH], -max_wheel_accel_ * seconds_since_last_update); } - } - if(!isRollerModel_) - { - ignition::math::Pose3d pose = model_->WorldPose(); - float yaw = pose.Rot().Yaw(); - calkinematics(cal_LineVel_); - model_->SetLinearVel(ignition::math::Vector3d(cal_LineVel_.vel_x * cosf(yaw) - cal_LineVel_.vel_y * sinf(yaw), - cal_LineVel_.vel_y * cosf(yaw) + cal_LineVel_.vel_x * sinf(yaw), 0)); - model_->SetAngularVel(ignition::math::Vector3d(0, 0, cal_LineVel_.vel_th)); - } - - last_update_time_ = _info.simTime; - } + if(desired_wheel_speed_[2 * i + WEST] >= current_speed[2 * i + WEST]) + { + wheel_speed_instr_[2 * i + WEST] += fmin(desired_wheel_speed_[2 * i + WEST] - current_speed[2 * i + WEST], max_wheel_accel_ * seconds_since_last_update); + } + else + { + wheel_speed_instr_[2 * i + WEST] += fmax(desired_wheel_speed_[2 * i + WEST] - current_speed[2 * i + WEST], -max_wheel_accel_ * seconds_since_last_update); + } - void GazeboOmniRosDrivePrivate::UpdateWheelVelocities() - { - std::lock_guard scoped_lock(lock_); + if (desired_wheel_speed_[2 * i + SOUTH] > current_speed[2 * i + SOUTH]) + { + wheel_speed_instr_[2 * i + SOUTH] += fmin(desired_wheel_speed_[2 * i + SOUTH] - current_speed[2 * i + SOUTH], max_wheel_accel_ * seconds_since_last_update); + } + else + { + wheel_speed_instr_[2 * i + SOUTH] += fmax(desired_wheel_speed_[2 * i + SOUTH] - current_speed[2 * i + SOUTH], -max_wheel_accel_ * seconds_since_last_update); + } - double vx = target_x_; - double vy = target_y_; - double va = target_rot_; + if (desired_wheel_speed_[2 * i + EAST] > current_speed[2 * i + EAST]) + { + wheel_speed_instr_[2 * i + EAST] += fmin(desired_wheel_speed_[2 * i + EAST] - current_speed[2 * i + EAST], max_wheel_accel_ * seconds_since_last_update); + } + else + { + wheel_speed_instr_[2 * i + EAST] += fmax(desired_wheel_speed_[2 * i + EAST] - current_speed[2 * i + EAST], -max_wheel_accel_ * seconds_since_last_update); + } - for (unsigned int i = 0; i < num_wheel_pairs_; ++i) - { - desired_wheel_speed_[2 * i + NORTH] = (vx + vy - va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; - desired_wheel_speed_[2 * i + WEST] = (vx - vy - va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; - desired_wheel_speed_[2 * i + SOUTH] = (vx + vy + va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; - desired_wheel_speed_[2 * i + EAST] = (vx - vy + va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; + joints_[2 * i + NORTH]->SetParam("vel", 0, wheel_speed_instr_[2 * i + NORTH]); + joints_[2 * i + WEST]->SetParam("vel", 0, wheel_speed_instr_[2 * i + WEST]); + joints_[2 * i + SOUTH]->SetParam("vel", 0, wheel_speed_instr_[2 * i + SOUTH]); + joints_[2 * i + EAST]->SetParam("vel", 0, wheel_speed_instr_[2 * i + EAST]); } } - void GazeboOmniRosDrivePrivate::OnCmdVel(const geometry_msgs::msg::Twist::SharedPtr _msg) + if(!isRollerModel_) { - std::lock_guard scoped_lock(lock_); - target_x_ = _msg->linear.x; - target_y_ = _msg->linear.y; - target_rot_ = _msg->angular.z; + ignition::math::Pose3d pose = model_->WorldPose(); + float yaw = pose.Rot().Yaw(); + calkinematics(cal_LineVel_); + model_->SetLinearVel(ignition::math::Vector3d(cal_LineVel_.vel_x * cosf(yaw) - cal_LineVel_.vel_y * sinf(yaw), + cal_LineVel_.vel_y * cosf(yaw) + cal_LineVel_.vel_x * sinf(yaw), 0)); + model_->SetAngularVel(ignition::math::Vector3d(0, 0, cal_LineVel_.vel_th)); } - void GazeboOmniRosDrivePrivate::PublishOdometryTf(const gazebo::common::Time & _current_time) - { - geometry_msgs::msg::TransformStamped msg; - msg.header.stamp = gazebo_ros::Convert(_current_time); - msg.header.frame_id = odometry_frame_; - msg.child_frame_id = robot_base_frame_; - msg.transform.translation = - gazebo_ros::Convert(odom_.pose.pose.position); - msg.transform.rotation = odom_.pose.pose.orientation; + last_update_time_ = _info.simTime; +} - transform_broadcaster_->sendTransform(msg); - } - - void GazeboOmniRosDrivePrivate::PublishWheelsTf(const gazebo::common::Time & _current_time) - { - for (unsigned int i = 0; i < 4 * num_wheel_pairs_; ++i) - { - auto pose_wheel = joints_[i]->GetChild()->RelativePose(); +void GazeboOmniRosDrivePrivate::UpdateWheelVelocities() +{ + std::lock_guard scoped_lock(lock_); - geometry_msgs::msg::TransformStamped msg; - msg.header.stamp = gazebo_ros::Convert(_current_time); - msg.header.frame_id = joints_[i]->GetParent()->GetName(); - msg.child_frame_id = joints_[i]->GetChild()->GetName(); - msg.transform.translation = gazebo_ros::Convert(pose_wheel.Pos()); - msg.transform.rotation = gazebo_ros::Convert(pose_wheel.Rot()); + double vx = target_x_; + double vy = target_y_; + double va = target_rot_; - transform_broadcaster_->sendTransform(msg); - } + for (unsigned int i = 0; i < num_wheel_pairs_; ++i) + { + desired_wheel_speed_[2 * i + NORTH] = (vx + vy - va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; + desired_wheel_speed_[2 * i + WEST] = (vx - vy - va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; + desired_wheel_speed_[2 * i + SOUTH] = (vx + vy + va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; + desired_wheel_speed_[2 * i + EAST] = (vx - vy + va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2; } +} + +void GazeboOmniRosDrivePrivate::OnCmdVel(const geometry_msgs::msg::Twist::SharedPtr _msg) +{ + std::lock_guard scoped_lock(lock_); + target_x_ = _msg->linear.x; + target_y_ = _msg->linear.y; + target_rot_ = _msg->angular.z; +} - void GazeboOmniRosDrivePrivate::PublishOdometryMsg(const gazebo::common::Time & _current_time) +void GazeboOmniRosDrivePrivate::PublishOdometryTf(const gazebo::common::Time & _current_time) +{ + geometry_msgs::msg::TransformStamped msg; + msg.header.stamp = gazebo_ros::Convert(_current_time); + msg.header.frame_id = odometry_frame_; + msg.child_frame_id = robot_base_frame_; + msg.transform.translation = + gazebo_ros::Convert(odom_.pose.pose.position); + msg.transform.rotation = odom_.pose.pose.orientation; + + transform_broadcaster_->sendTransform(msg); +} + +void GazeboOmniRosDrivePrivate::PublishWheelsTf(const gazebo::common::Time & _current_time) +{ + for (unsigned int i = 0; i < 4 * num_wheel_pairs_; ++i) { - auto pose = model_->WorldPose(); - odom_.pose.pose.position = gazebo_ros::Convert(pose.Pos()); - odom_.pose.pose.orientation = gazebo_ros::Convert(pose.Rot()); + auto pose_wheel = joints_[i]->GetChild()->RelativePose(); - // Get velocity in odom frame - auto linear = model_->WorldLinearVel(); - odom_.twist.twist.angular.z = model_->WorldAngularVel().Z(); + geometry_msgs::msg::TransformStamped msg; + msg.header.stamp = gazebo_ros::Convert(_current_time); + msg.header.frame_id = joints_[i]->GetParent()->GetName(); + msg.child_frame_id = joints_[i]->GetChild()->GetName(); + msg.transform.translation = gazebo_ros::Convert(pose_wheel.Pos()); + msg.transform.rotation = gazebo_ros::Convert(pose_wheel.Rot()); - // Convert velocity to child_frame_id(aka base_footprint) - float yaw = pose.Rot().Yaw(); - 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 covariance - odom_.pose.covariance[0] = covariance_[0]; - odom_.pose.covariance[7] = covariance_[1]; - odom_.pose.covariance[14] = 1000000000000.0; - odom_.pose.covariance[21] = 1000000000000.0; - odom_.pose.covariance[28] = 1000000000000.0; - odom_.pose.covariance[35] = covariance_[2]; - - odom_.twist.covariance[0] = covariance_[0]; - odom_.twist.covariance[7] = covariance_[1]; - odom_.twist.covariance[14] = 1000000000000.0; - odom_.twist.covariance[21] = 1000000000000.0; - odom_.twist.covariance[28] = 1000000000000.0; - odom_.twist.covariance[35] = covariance_[2]; - - // Set header - odom_.header.frame_id = odometry_frame_; - odom_.child_frame_id = robot_base_frame_; - odom_.header.stamp = gazebo_ros::Convert(_current_time); - - // Publish - odometry_pub_->publish(odom_); + transform_broadcaster_->sendTransform(msg); } +} - void GazeboOmniRosDrivePrivate::calkinematics(linear_vel &line_vel) - { - double wheel_encoder[4]; - wheel_encoder[NORTH] = joints_[NORTH]->GetVelocity(0); - wheel_encoder[WEST] = joints_[WEST]->GetVelocity(0); - wheel_encoder[SOUTH] = joints_[SOUTH]->GetVelocity(0); - wheel_encoder[EAST] = joints_[EAST]->GetVelocity(0); +void GazeboOmniRosDrivePrivate::PublishOdometryMsg(const gazebo::common::Time & _current_time) +{ + auto pose = model_->WorldPose(); + odom_.pose.pose.position = gazebo_ros::Convert(pose.Pos()); + odom_.pose.pose.orientation = gazebo_ros::Convert(pose.Rot()); + + // Get velocity in odom frame + auto linear = model_->WorldLinearVel(); + odom_.twist.twist.angular.z = model_->WorldAngularVel().Z(); + + // Convert velocity to child_frame_id(aka base_footprint) + float yaw = pose.Rot().Yaw(); + 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 covariance + odom_.pose.covariance[0] = covariance_[0]; + odom_.pose.covariance[7] = covariance_[1]; + odom_.pose.covariance[14] = 1000000000000.0; + odom_.pose.covariance[21] = 1000000000000.0; + odom_.pose.covariance[28] = 1000000000000.0; + odom_.pose.covariance[35] = covariance_[2]; + + odom_.twist.covariance[0] = covariance_[0]; + odom_.twist.covariance[7] = covariance_[1]; + odom_.twist.covariance[14] = 1000000000000.0; + odom_.twist.covariance[21] = 1000000000000.0; + odom_.twist.covariance[28] = 1000000000000.0; + odom_.twist.covariance[35] = covariance_[2]; + + // Set header + odom_.header.frame_id = odometry_frame_; + odom_.child_frame_id = robot_base_frame_; + odom_.header.stamp = gazebo_ros::Convert(_current_time); + + // Publish + odometry_pub_->publish(odom_); +} + +void GazeboOmniRosDrivePrivate::calkinematics(linear_vel &line_vel) +{ + double wheel_encoder[4]; + wheel_encoder[NORTH] = joints_[NORTH]->GetVelocity(0); + wheel_encoder[WEST] = joints_[WEST]->GetVelocity(0); + wheel_encoder[SOUTH] = joints_[SOUTH]->GetVelocity(0); + wheel_encoder[EAST] = joints_[EAST]->GetVelocity(0); - double l = 1.0 / (2 * (wheel_w_separation_[0] + wheel_l_separation_[0])); + double l = 1.0 / (2 * (wheel_w_separation_[0] + wheel_l_separation_[0])); - line_vel.vel_x = (wheel_encoder[NORTH] + wheel_encoder[WEST] + wheel_encoder[SOUTH] + wheel_encoder[EAST]) * wheel_diameter_[0] / 2; - line_vel.vel_y = (wheel_encoder[NORTH] - wheel_encoder[WEST] + wheel_encoder[SOUTH] - wheel_encoder[EAST]) * wheel_diameter_[0] / 2; - line_vel.vel_th = (-wheel_encoder[NORTH] - wheel_encoder[WEST] + wheel_encoder[SOUTH] + wheel_encoder[EAST]) * l * wheel_diameter_[0] / 2; - } + line_vel.vel_x = (wheel_encoder[NORTH] + wheel_encoder[WEST] + wheel_encoder[SOUTH] + wheel_encoder[EAST]) * wheel_diameter_[0] / 2; + line_vel.vel_y = (wheel_encoder[NORTH] - wheel_encoder[WEST] + wheel_encoder[SOUTH] - wheel_encoder[EAST]) * wheel_diameter_[0] / 2; + line_vel.vel_th = (-wheel_encoder[NORTH] - wheel_encoder[WEST] + wheel_encoder[SOUTH] + wheel_encoder[EAST]) * l * wheel_diameter_[0] / 2; +} - GZ_REGISTER_MODEL_PLUGIN(GazeboOmniRosDrive) +GZ_REGISTER_MODEL_PLUGIN(GazeboOmniRosDrive) } // namespace gazebo_plugins \ No newline at end of file From 67b16db45b8a8b17f2c860350512f1cd5a880a5d Mon Sep 17 00:00:00 2001 From: Vincent Belpois Date: Tue, 19 Dec 2023 01:06:55 +0100 Subject: [PATCH 18/20] Attempt to fix copyright issue --- src/ezbot_descr_simul/launch/launch_sim.launch.py | 1 + src/ezbot_descr_simul/launch/rsp.launch.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ezbot_descr_simul/launch/launch_sim.launch.py b/src/ezbot_descr_simul/launch/launch_sim.launch.py index 6ef073d..07d22d2 100644 --- a/src/ezbot_descr_simul/launch/launch_sim.launch.py +++ b/src/ezbot_descr_simul/launch/launch_sim.launch.py @@ -1,3 +1,4 @@ +# copyright option3 ensma import os from ament_index_python.packages import get_package_share_directory diff --git a/src/ezbot_descr_simul/launch/rsp.launch.py b/src/ezbot_descr_simul/launch/rsp.launch.py index 1c975be..a8a268a 100644 --- a/src/ezbot_descr_simul/launch/rsp.launch.py +++ b/src/ezbot_descr_simul/launch/rsp.launch.py @@ -1,3 +1,4 @@ +# copyright option3 ensma import os from ament_index_python.packages import get_package_share_directory From c7b1020741581b26657c3dd567e63dd5e3feeb4f Mon Sep 17 00:00:00 2001 From: Vincent Belpois Date: Tue, 19 Dec 2023 01:08:22 +0100 Subject: [PATCH 19/20] removed empty file --- src/ezbot_gazebo/launch/lidar_demo.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/ezbot_gazebo/launch/lidar_demo.xml diff --git a/src/ezbot_gazebo/launch/lidar_demo.xml b/src/ezbot_gazebo/launch/lidar_demo.xml deleted file mode 100644 index e69de29..0000000 From c7a989a9a90f5d4ab3db89494d134dd11bd3f293 Mon Sep 17 00:00:00 2001 From: Vincent <46542431+VincidaB@users.noreply.github.com> Date: Tue, 19 Dec 2023 01:26:25 +0100 Subject: [PATCH 20/20] Update main.yml --- .github/workflows/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a9509f..62e2cd5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,12 @@ jobs: with: path: workspace - - name: Build and test workspace - uses: ichiro-its/ros2-ws-action@v1.0.0 + - name: Setup workspace + uses: ichiro-its/ros2-ws-action/setup@v1.0.0 with: - distro: rolling + distro: humble + + - name: Build workspace + uses: ichiro-its/ros2-ws-action/build@v1.0.0 + with: + distro: humble