Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay stamped cmd vel #282

Open
wants to merge 2 commits into
base: jazzy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions andino_bringup/config/joystick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ teleop_node:
enable_turbo_button: 5

require_enable_button: true
publish_stamped_twist: true
2 changes: 1 addition & 1 deletion andino_bringup/launch/teleop_joystick.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def generate_launch_description():

cmd_vel_topic_arg = DeclareLaunchArgument(
'cmd_vel_topic',
default_value='/cmd_vel',
default_value='/cmd_vel_stamped',
description='Indicates the cmd_vel topic.')
cmd_vel_topic = LaunchConfiguration('cmd_vel_topic')

Expand Down
4 changes: 4 additions & 0 deletions andino_bringup/launch/teleop_keyboard.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from launch import LaunchDescription

from launch_ros.actions import Node


def generate_launch_description():
teleop_node = Node(
package='teleop_twist_keyboard',
executable='teleop_twist_keyboard',
name='teleop_twist_keyboard_node',
output='screen',
prefix = 'xterm -e',
parameters=[{'stamped': True}],
remappings=[('/cmd_vel', 'cmd_vel_stamped')],
)

return LaunchDescription([
Expand Down
15 changes: 11 additions & 4 deletions andino_control/launch/andino_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ def generate_launch_description():
parameters=[{'robot_description': ParameterValue(robot_description, value_type=str)},
controller_params_file],
remappings=[
('/diff_controller/cmd_vel', '/cmd_vel'), # Used if use_stamped_vel param is true
('/diff_controller/cmd_vel_unstamped', '/cmd_vel'), # Used if use_stamped_vel param is false
('/diff_controller/cmd_vel_out', '/cmd_vel_out'), # Used if publish_limited_velocity param is true
('/diff_controller/odom', '/odom'),
('/diff_controller/cmd_vel', 'cmd_vel_stamped'),
('/diff_controller/cmd_vel_out', 'cmd_vel_out'),
('/diff_controller/odom', 'odom'),
],
output="both",
)
Expand All @@ -83,10 +82,18 @@ def generate_launch_description():
)
)

relay_node = Node(
package="topic_tools",
executable="relay_field",
name="cmd_vel_relay",
arguments=["cmd_vel", "cmd_vel_stamped", "geometry_msgs/TwistStamped", "{header: {stamp: {sec: 0, nanosec: 0}, frame_id: ''}, twist: m}", "--wait-for-start"],
)

nodes = [
control_node,
joint_state_broadcaster_spawner,
delay_diff_drive_controller_spawner_after_joint_state_broadcaster_spawner,
relay_node,
]

return LaunchDescription(nodes)
1 change: 1 addition & 0 deletions andino_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<exec_depend>diff_drive_controller</exec_depend>
<exec_depend>joint_state_broadcaster</exec_depend>
<exec_depend>ros2controlcli</exec_depend>
<exec_depend>topic_tools</exec_depend>

<test_depend>ament_cmake_clang_format</test_depend>

Expand Down