forked from ros-teleop/teleop_twist_joy
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an option to publish TwistStamped (#42)
Signed-off-by: Tamaki Nishino <[email protected]>
- Loading branch information
Showing
6 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import geometry_msgs.msg | ||
import launch | ||
import launch_ros.actions | ||
import launch_testing | ||
|
||
import pytest | ||
|
||
import test_joy_twist | ||
|
||
|
||
@pytest.mark.rostest | ||
def generate_test_description(): | ||
teleop_node = launch_ros.actions.Node( | ||
package='teleop_twist_joy', | ||
executable='teleop_node', | ||
parameters=[{ | ||
'publish_stamped_twist': True, | ||
'axis_linear.x': 1, | ||
'axis_angular.yaw': 0, | ||
'scale_linear.x': 2.0, | ||
'scale_angular.yaw': 3.0, | ||
'enable_button': 0, | ||
}], | ||
) | ||
|
||
return launch.LaunchDescription([ | ||
teleop_node, | ||
launch_testing.actions.ReadyToTest(), | ||
]), locals() | ||
|
||
|
||
class PublishTwistStamped(test_joy_twist.TestJoyTwist): | ||
|
||
def setUp(self): | ||
self.cmd_vel_msg_type = geometry_msgs.msg.TwistStamped | ||
super().setUp() | ||
self.joy_msg['axes'] = [0.3, 0.4] | ||
self.joy_msg['buttons'] = [1] | ||
self.expect_cmd_vel['linear']['x'] = 0.8 | ||
self.expect_cmd_vel['angular']['z'] = 0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters