File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
webots_ros2_core/webots_ros2_core/devices Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -87,10 +87,11 @@ def step(self):
8787 msg .angular_velocity .y = interpolate_lookup_table (raw_data [1 ], self .__gyro .getLookupTable ())
8888 msg .angular_velocity .z = interpolate_lookup_table (raw_data [2 ], self .__gyro .getLookupTable ())
8989 if self .__inertial_unit :
90- raw_data = self .__inertial_unit .getValues ()
91- msg .orientation .x = interpolate_lookup_table (raw_data [0 ], self .__inertial_unit .getLookupTable ())
92- msg .orientation .y = interpolate_lookup_table (raw_data [1 ], self .__inertial_unit .getLookupTable ())
93- msg .orientation .z = interpolate_lookup_table (raw_data [2 ], self .__inertial_unit .getLookupTable ())
90+ raw_data = self .__inertial_unit .getQuaternion ()
91+ msg .orientation .x = raw_data [0 ]
92+ msg .orientation .y = raw_data [1 ]
93+ msg .orientation .z = raw_data [2 ]
94+ msg .orientation .w = raw_data [3 ]
9495 self ._publisher .publish (msg )
9596 else :
9697 self .__disable_imu ()
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def __init__(self, args):
3434 self .start_device_manager ({
3535 'robot' : {'publish_base_footprint' : True },
3636 'LDS-01' : {'topic_name' : '/scan' },
37- 'accelerometer+gyro' : {'frame_id' : 'imu_link' , 'topic_name' : '/imu' }
37+ 'inertial_unit+ accelerometer+gyro' : {'frame_id' : 'imu_link' , 'topic_name' : '/imu' }
3838 })
3939
4040
Original file line number Diff line number Diff line change 1- #VRML_SIM R2020b utf8
1+ #VRML_SIM R2021a utf8
22WorldInfo {
33 info [
44 "Simple TurtleBot3 Burger simulation that can be controlled by a ROS."
55 ]
66 title "ROS2 simulation of the TurtleBot3 Burger robot"
77}
88Viewpoint {
9- orientation 0.10641236421720016 -0.25207787332085546 -0.9618384243331832 2.039170527287739
10- position -3.8306574674676366 4.499047968479621 23.02378266720472
9+ orientation -0.1500994671353544 -0.4810853207937876 -0.8637285824160397 3.5119475446104667
10+ position 9.974034902718383 6.242698326848728 4.5715004345304
1111 follow "TurtleBot3Burger:LDS-01"
1212}
1313TexturedBackground {
@@ -21,6 +21,14 @@ TurtleBot3Burger_enu {
2121 controllerArgs [
2222 ""
2323 ]
24+ extensionSlot [
25+ InertialUnit {
26+ rotation 0 1 0 3.14
27+ name "inertial_unit"
28+ }
29+ RobotisLds01 {
30+ }
31+ ]
2432}
2533PottedTree {
2634 translation 7 -4 0
You can’t perform that action at this time.
0 commit comments