Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/humble' into code-extentions-rec…
Browse files Browse the repository at this point in the history
…ommendation
  • Loading branch information
delihus committed Oct 17, 2023
2 parents a704d14 + c92fb13 commit f2cb857
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 78 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ source install/setup.bash
ros2 launch rosbot_gazebo simulation.launch.py
```

## Testing package

### Industrial CI
```
colcon test
```

> [!NOTE]
> Command `colcon test` does not build the code. Remember to build your code after changes.
If tests finish with errors print logs:
```
colcon test-result --verbose
```

### Format python code with [Black](https://github.com/psf/black)
```
cd src/
black rosbot*
```

## Demo
Bellow you can find demos with ROSbots:
- in [rosbot-docker](https://github.com/husarion/rosbot-docker/tree/ros2) you will find a simple example how to drive ROSbot with `teleop_twist_keyboard`.
Expand Down
9 changes: 9 additions & 0 deletions rosbot/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog for package rosbot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.9.0 (2023-10-16)
------------------

0.8.5 (2023-10-11)
------------------
* Merge remote-tracking branch 'origin/test-gazebo' into test-gazebo
* Merge branch 'humble' into test-gazebo
* Contributors: Jakub Delicat, rafal-gorecki

0.8.4 (2023-09-21)
------------------
* Merge branch 'humble' into test-ekf
Expand Down
2 changes: 1 addition & 1 deletion rosbot/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbot</name>
<version>0.8.4</version>
<version>0.9.0</version>

<description>Meta package that contains all packages of Rosbot 2 2R PRO</description>
<license>Apache License 2.0</license>
Expand Down
11 changes: 11 additions & 0 deletions rosbot_bringup/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
Changelog for package rosbot_bringup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.9.0 (2023-10-16)
------------------

0.8.5 (2023-10-11)
------------------
* Merge pull request `#70 <https://github.com/husarion/rosbot_ros/issues/70>`_ from husarion/test-gazebo
Test gazebo
* Merge remote-tracking branch 'origin/test-gazebo' into test-gazebo
* Merge branch 'humble' into test-gazebo
* Contributors: Jakub Delicat, rafal-gorecki

0.8.4 (2023-09-21)
------------------
* Merge pull request `#69 <https://github.com/husarion/rosbot_ros/issues/69>`_ from husarion/test-ekf
Expand Down
4 changes: 2 additions & 2 deletions rosbot_bringup/config/ekf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ekf_filter_node:
imu0_differential: false
imu0_relative: true
imu0_remove_gravitational_acceleration: true

# [ADVANCED] The process noise covariance matrix can be difficult to tune, and can vary for each application, so it is
# exposed as a configuration parameter. This matrix represents the noise we add to the total error after each
# prediction step. The better the omnidirectional motion model matches your system, the smaller these values can be.
Expand Down Expand Up @@ -73,7 +73,7 @@ ekf_filter_node:
0.0, 0.0, 1e-9, 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, 1e-9, 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, 1e-9, 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, 1e-9, 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, 1e-8, 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, 1e-9, 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, 1e-9, 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, 1e-9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
Expand Down
2 changes: 1 addition & 1 deletion rosbot_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbot_bringup</name>
<version>0.8.4</version>
<version>0.9.0</version>
<description>ROSbot 2, 2R, PRO bringup package</description>
<license>Apache License 2.0</license>

Expand Down
28 changes: 19 additions & 9 deletions rosbot_bringup/test/bringup_test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
from rclpy.node import Node

from sensor_msgs.msg import JointState, Imu
from nav_msgs.msg import Odometry
from tf2_ros import TransformException
from tf2_ros.buffer import Buffer
from tf2_ros.transform_listener import TransformListener


class BringupTestNode(Node):
Expand All @@ -31,7 +33,7 @@ class BringupTestNode(Node):

def __init__(self, name="test_node"):
super().__init__(name)
self.odom_msg_event = Event()
self.odom_tf_event = Event()

def create_test_subscribers_and_publishers(self):
self.imu_publisher = self.create_publisher(Imu, "_imu/data_raw", 10)
Expand All @@ -40,26 +42,34 @@ def create_test_subscribers_and_publishers(self):
JointState, "_motors_response", 10
)

self.odom_sub = self.create_subscription(
Odometry, "/odometry/filtered", self.odometry_callback, 10
)
self.tf_buffer = Buffer()
self.tf_listener = TransformListener(self.tf_buffer, self)

self.timer = None

def lookup_transform_odom(self):
try:
self.tf_buffer.lookup_transform("odom", "base_link", rclpy.time.Time())
self.odom_tf_event.set()
except TransformException as ex:
self.get_logger().error(f"Could not transform odom to base_link: {ex}")

def start_node_thread(self):
self.ros_spin_thread = Thread(
target=lambda node: rclpy.spin(node), args=(self,)
)
self.ros_spin_thread.start()

def odometry_callback(self, data):
self.odom_msg_event.set()

def start_publishing_fake_hardware(self):
self.timer = self.create_timer(
1.0 / self.ROSBOT_HARDWARE_PUBLISHERS_RATE,
self.publish_fake_hardware_messages,
self.timer_callback,
)

def timer_callback(self):
self.publish_fake_hardware_messages()
self.lookup_transform_odom()

def publish_fake_hardware_messages(self):
imu_msg = Imu()
imu_msg.header.stamp = self.get_clock().now().to_msg()
Expand Down
4 changes: 2 additions & 2 deletions rosbot_bringup/test/test_diff_drive_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ def test_bringup_startup_success():
node.start_publishing_fake_hardware()

node.start_node_thread()
msgs_received_flag = node.odom_msg_event.wait(timeout=10.0)
msgs_received_flag = node.odom_tf_event.wait(timeout=10.0)
assert (
msgs_received_flag
), "Expected Odom message but it was not received. Check robot_localization!"
), "Expected odom to base_link tf but it was not received. Check robot_localization!"

finally:
rclpy.shutdown()
5 changes: 3 additions & 2 deletions rosbot_bringup/test/test_mecanum_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ def test_bringup_startup_success():
node.start_publishing_fake_hardware()

node.start_node_thread()
msgs_received_flag = node.odom_msg_event.wait(timeout=10.0)
msgs_received_flag = node.odom_tf_event.wait(timeout=10.0)
assert (
msgs_received_flag
), "Expected Odom message but it was not received. Check robot_localization!"
), "Expected odom to base_link tf but it was not received. Check robot_localization!"

finally:
rclpy.shutdown()
9 changes: 9 additions & 0 deletions rosbot_controller/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Changelog for package rosbot_controller
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.9.0 (2023-10-16)
------------------

0.8.5 (2023-10-11)
------------------
* Merge remote-tracking branch 'origin/test-gazebo' into test-gazebo
* Merge branch 'humble' into test-gazebo
* Contributors: Jakub Delicat, rafal-gorecki

0.8.4 (2023-09-21)
------------------
* Merge pull request `#69 <https://github.com/husarion/rosbot_ros/issues/69>`_ from husarion/test-ekf
Expand Down
2 changes: 1 addition & 1 deletion rosbot_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbot_controller</name>
<version>0.8.4</version>
<version>0.9.0</version>

<description>Hardware configuration for ROSbot 2, 2R, PRO</description>
<license>Apache License 2.0</license>
Expand Down
11 changes: 11 additions & 0 deletions rosbot_description/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
Changelog for package rosbot_description
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.9.0 (2023-10-16)
------------------

0.8.5 (2023-10-11)
------------------
* Merge pull request `#70 <https://github.com/husarion/rosbot_ros/issues/70>`_ from husarion/test-gazebo
Test gazebo
* Merge remote-tracking branch 'origin/test-gazebo' into test-gazebo
* Merge branch 'humble' into test-gazebo
* Contributors: Jakub Delicat, rafal-gorecki

0.8.4 (2023-09-21)
------------------
* Merge branch 'humble' into test-ekf
Expand Down
2 changes: 1 addition & 1 deletion rosbot_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbot_description</name>
<version>0.8.4</version>
<version>0.9.0</version>

<description>ROSbot 2, 2R, PRO description package</description>
<license>Apache License 2.0</license>
Expand Down
2 changes: 1 addition & 1 deletion rosbot_description/urdf/wheel.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<child link="${prefix}_wheel_link" />
<origin xyz="${x} ${y} 0.0" rpy="0.0 0.0 0.0" />
<axis xyz="0.0 1.0 0.0" />
<limit effort="1.5" velocity="5.0" />
<limit effort="1.5" velocity="24.0" />
<dynamics damping="0.001" friction="0.001" />
</joint>

Expand Down
13 changes: 13 additions & 0 deletions rosbot_gazebo/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
Changelog for package rosbot_gazebo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.9.0 (2023-10-16)
------------------

0.8.5 (2023-10-11)
------------------
* Merge pull request `#70 <https://github.com/husarion/rosbot_ros/issues/70>`_ from husarion/test-gazebo
Test gazebo
* Merge pull request `#74 <https://github.com/husarion/rosbot_ros/issues/74>`_ from husarion/rafal-suggestions
rafal-sugestions
* Merge remote-tracking branch 'origin/test-gazebo' into test-gazebo
* Merge branch 'humble' into test-gazebo
* Contributors: Jakub Delicat, rafal-gorecki

0.8.4 (2023-09-21)
------------------
* Merge branch 'humble' into test-ekf
Expand Down
2 changes: 1 addition & 1 deletion rosbot_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbot_gazebo</name>
<version>0.8.4</version>
<version>0.9.0</version>

<description>Gazebo Ignition simulation for ROSbot 2, 2R, PRO</description>
<license>Apache License 2.0</license>
Expand Down
Loading

0 comments on commit f2cb857

Please sign in to comment.