Skip to content

Commit

Permalink
Merge pull request #38 from clubcapra/bugfix/fix_teleop
Browse files Browse the repository at this point in the history
fix teleop path
  • Loading branch information
SimonR99 authored Apr 7, 2024
2 parents 18880f2 + 8274026 commit 933308c
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def generate_launch_description():
name='teleop_twist_joy_node',
parameters=[teleope_joy_params_file],
remappings=[
('/joy', '/rove/joy'),
('/joy', '/joy'),
# ('/cmd_vel', '/model/rove/cmd_vel')
],
),
Expand Down
2 changes: 1 addition & 1 deletion src/rove_bringup/launch/rove_controller_usb.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def generate_launch_description():
name='teleop_twist_joy_node',
parameters=[teleope_joy_params_file],
remappings=[
('/joy', '/rove/joy'),
('/joy', '/joy'),
# ('/cmd_vel', '/model/rove/cmd_vel')
],
),
Expand Down
16 changes: 0 additions & 16 deletions src/rove_description/config/robot_bridge.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions src/rove_description/launch/sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def generate_launch_description():
pkg_rove_nav = get_package_share_directory('rove_navigation')
slam_pkg_path = get_package_share_directory("slam_toolbox")
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim')
bringup_pkg_path = get_package_share_directory('rove_bringup')

# Get the URDF file
urdf_path = os.path.join(pkg_rove_description, 'urdf', 'rove.urdf.xacro')
Expand Down Expand Up @@ -118,6 +119,12 @@ def generate_launch_description():
{'use_sim_time': True}]
)

teleop = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(bringup_pkg_path, "launch", "rove_controller_usb.launch.py"),
),
)

return LaunchDescription([
gz_sim,
DeclareLaunchArgument('rviz', default_value='true',
Expand All @@ -130,4 +137,5 @@ def generate_launch_description():
#slam3d,
create,
nav,
teleop,
])
101 changes: 101 additions & 0 deletions src/rove_description/urdf/command.urdf.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">87</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: 1.0}, angular: {z: 0.0}
</output>
</plugin>

<!-- Moving Backward: X -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">88</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: -1.0}, angular: {z: 0.0}
</output>
</plugin>

<!-- Stop: S -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">83</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: 0.0}, angular: {z: 0.0}
</output>
</plugin>

<!-- Left: A -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">65</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: 0.0}, angular: {z: 1.0}
</output>
</plugin>

<!-- Right: D -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">68</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: 0.0}, angular: {z: -1.0}
</output>
</plugin>

<!-- Forward Left: Q -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">81</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: 1.0}, angular: {z: 1.0}
</output>
</plugin>

<!-- Forward Right: E -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">69</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: 1.0}, angular: {z: -1.0}
</output>
</plugin>

<!-- Back Left: Z -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">90</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: -1.0}, angular: {z: 1.0}
</output>
</plugin>

<!-- Back Right: C -->
<plugin filename="gz-sim-triggered-publisher-system"
name="gz::sim::systems::TriggeredPublisher">
<input type="gz.msgs.Int32" topic="/keyboard/keypress">
<match field="data">67</match>
</input>
<output type="gz.msgs.Twist" topic="cmd_vel">
linear: {x: -1.0}, angular: {z: -1.0}
</output>
</plugin>

</robot>
6 changes: 3 additions & 3 deletions src/rove_description/urdf/flipper.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dynamics damping="50.0" friction="50"/>
</joint>




<link name="flipper_${suffix}">
Expand All @@ -54,7 +54,7 @@
<mesh filename="file://$(find rove_description)/meshes/flipper.stl"/>
</geometry>
<surface>
<friction>
<friction>
<ode>
<mu>0.65</mu>
<mu2>0.85</mu2>
Expand All @@ -75,7 +75,7 @@
</inertial>
</link>
<gazebo>
<plugin name='ignition::gazebo::systems::TrackController' filename='libignition-gazebo-track-controller-system.so'>
<plugin name='gz::sim::systems::TrackController' filename='gz-sim-track-controller-system'>
<link>flipper_${suffix}</link>
<min_velocity>-3.0</min_velocity>
<max_velocity>3.0</max_velocity>
Expand Down
18 changes: 9 additions & 9 deletions src/rove_description/urdf/gazebo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

<gazebo>
<plugin
filename="ignition-gazebo-joint-state-publisher-system"
name="ignition::gazebo::systems::JointStatePublisher">
filename="gz-sim-joint-state-publisher-system"
name="gz::sim::systems::JointStatePublisher">
<topic>joint_states</topic>
</plugin>

<plugin
filename="ignition-gazebo-imu-system"
name="ignition::gazebo::systems::Imu">
filename="gz-sim-imu-system"
name="gz::sim::systems::Imu">
</plugin>


Expand All @@ -22,27 +22,27 @@
<right_track><link>flipper_fr</link></right_track>
<right_track><link>flipper_rr</link></right_track>

<!-- TODO PUT ACTUAL VALUES -->
<!-- TODO PUT ACTUAL VALUES -->
<tracks_separation>0.63</tracks_separation>
<tracks_height>0.18094</tracks_height>
<steering_efficiency>1</steering_efficiency>

<topic>cmd_vel</topic>
<topic>cmd_vel</topic>

<odom_topic>odom</odom_topic>
<frame_id>odom</frame_id>
<child_frame_id>base_footprint</child_frame_id>
<odom_publisher_frequency>30</odom_publisher_frequency>

<publish_odom_tf>false</publish_odom_tf>
<publish_wheel_tf>true</publish_wheel_tf>
<publish_wheel_tf>false</publish_wheel_tf>

<tf_topic>/tf</tf_topic>
</plugin>

<plugin
filename="ignition-gazebo-sensors-system"
name="ignition::gazebo::systems::Sensors">
filename="gz-sim-sensors-system"
name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
Expand Down
2 changes: 1 addition & 1 deletion src/rove_description/urdf/rove.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<xacro:include filename="$(find rove_description)/urdf/gazebo.urdf.xacro" />
<xacro:include filename="$(find rove_description)/urdf/lidar.urdf.xacro" />
<xacro:include filename="$(find rove_description)/urdf/imu.urdf.xacro" />

<xacro:include filename="$(find rove_description)/urdf/flipper.urdf.xacro" />
<xacro:include filename="$(find rove_description)/urdf/track.urdf.xacro" />

Expand Down
4 changes: 2 additions & 2 deletions src/rove_description/urdf/track.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<gazebo>
<plugin name='gz::sim::systems::TrackController' filename='libignition-gazebo-track-controller-system.so'>
<link>track_${suffix}</link>
<min_velocity>-1.0</min_velocity>
<max_velocity>1.0</max_velocity>
<min_velocity>-3.0</min_velocity>
<max_velocity>3.0</max_velocity>
<!--debug>1</debug-->
</plugin>
</gazebo>
Expand Down
2 changes: 1 addition & 1 deletion src/rove_slam/config/ekf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ekf_filter_node:

odom0: /odom
odom0_config: [true, true, true,
false, false, false,
false, false, true,
false, false, false,
false, false, true,
false, false, false]
Expand Down

0 comments on commit 933308c

Please sign in to comment.