Skip to content

Commit

Permalink
Add ROS 2 packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinker-Twins committed Dec 16, 2023
1 parent e8ae01e commit 68598b1
Show file tree
Hide file tree
Showing 591 changed files with 52,509 additions and 0 deletions.
121 changes: 121 additions & 0 deletions ROS 2 Packages/f1tenth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# f1tenth_system

Drivers onboard f1tenth race cars. This branch is under development for migration to ROS2. See the [documentation of F1TENTH](https://f1tenth.readthedocs.io/en/foxy_test/getting_started/firmware/index.html) on how to get started.

## Deadman's switch
On Logitech F-710 joysticks, the LB button is the deadman's switch for teleop, and the RB button is the deadman's switch for navigation. You can also remap buttons. See how on the readthedocs documentation.

## Topics

### Topics that the driver stack subscribe to
- `/drive`: Topic for autonomous navigation, uses `AckermannDriveStamped` messages.

### Sensor topics published by the driver stack
- `/scan`: Topic for `LaserScan` messages.
- `/ego_racecar/odom`: Topic for `Odometry` messages.
- `/sensors/imu/raw`: Topic for `Imu` messages.
- `/sensors/core`: Topic for telemetry data from the VESC

## External Dependencies

1. ackermann_msgs [https://index.ros.org/r/ackermann_msgs/#foxy](https://index.ros.org/r/ackermann_msgs/#foxy).
2. urg_node [https://index.ros.org/p/urg_node/#foxy](https://index.ros.org/p/urg_node/#foxy). This is the driver for Hokuyo LiDARs.
3. joy [https://index.ros.org/p/joy/#foxy](https://index.ros.org/p/joy/#foxy). This is the driver for joysticks in ROS 2.
4. teleop_tools [https://index.ros.org/p/teleop_tools/#foxy](https://index.ros.org/p/teleop_tools/#foxy). This is the package for teleop with joysticks in ROS 2.
5. vesc [GitHub - f1tenth/vesc at ros2](https://github.com/f1tenth/vesc/tree/ros2). This is the driver for VESCs in ROS 2.
6. ackermann_mux [GitHub - f1tenth/ackermann_mux: Twist multiplexer](https://github.com/f1tenth/ackermann_mux). This is a package for multiplexing ackermann messages in ROS 2.
<!-- 7. rosbridge_suite [https://index.ros.org/p/rosbridge_suite/#foxy-overview](https://index.ros.org/p/rosbridge_suite/#foxy-overview) This is a package that allows for websocket connection in ROS 2. -->

## Package in this repo

1. f1tenth_stack: maintains the bringup launch and all parameter files

## Nodes launched in bringup

1. joy
2. joy_teleop
3. ackermann_to_vesc_node
4. vesc_to_odom_node
5. vesc_driver_node
6. urg_node
7. ackermann_mux

## Parameters and topics for dependencies

### vesc_driver

1. Parameters:
- duty_cycle_min, duty_cycle_max
- current_min, current_max
- brake_min, brake_max
- speed_min, speed_max
- position_min, position_max
- servo_min, servo_max
2. Publishes to:
- sensors/core
- sensors/servo_position_command
- sensors/imu
- sensors/imu/raw
3. Subscribes to:
- commands/motor/duty_cycle
- commands/motor/current
- commands/motor/brake
- commands/motor/speed
- commands/motor/position
- commands/servo/position

### ackermann_to_vesc

1. Parameters:
- speed_to_erpm_gain
- speed_to_erpm_offset
- steering_angle_to_servo_gain
- steering_angle_to_servo_offset
2. Publishes to:
- ackermann_cmd
3. Subscribes to:
- commands/motor/speed
- commands/servo/position

### vesc_to_odom

1. Parameters:
- odom_frame
- base_frame
- use_servo_cmd_to_calc_angular_velocity
- speed_to_erpm_gain
- speed_to_erpm_offset
- steering_angle_to_servo_gain
- steering_angle_to_servo_offset
- wheelbase
- publish_tf
2. Publishes to:
- odom
3. Subscribes to:
- sensors/core
- sensors/servo_position_command

### throttle_interpolator

1. Parameters:
- rpm_input_topic
- rpm_output_topic
- servo_input_topic
- servo_output_topic
- max_acceleration
- speed_max
- speed_min
- throttle_smoother_rate
- speed_to_erpm_gain
- max_servo_speed
- steering_angle_to_servo_gain
- servo_smoother_rate
- servo_max
- servo_min
- steering_angle_to_servo_offset
2. Publishes to:
- topic described in rpm_output_topic
- topic described in servo_output_topic
3. Subscribes to:
- topic described in rpm_input_topic
- topic described in servo_input_topic
1 change: 1 addition & 0 deletions ROS 2 Packages/f1tenth/ackermann_mux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
50 changes: 50 additions & 0 deletions ROS 2 Packages/f1tenth/ackermann_mux/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package ackermann mux
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.0.1 (2021-09-21)
------------------
* moving from twist mux to ackermann mux
* Contributors: Hongrui Zheng

4.0.0 (2021-06-16)
------------------
* Foxy migration (`#25 <https://github.com/ros-teleop/twist_mux/issues/25>`_)
* Contributors: Victor Lopez

3.1.0 (2018-06-25)
------------------

3.0.0 (2016-07-12)
------------------
* Merge pull request `#8 <https://github.com/ros-teleop/twist_mux/issues/8>`_ from ros-teleop/update_jade_from_indigo_devel
fix queue_size SyntaxWarning
* fix queue_size SyntaxWarning
* Update README.md
Add documentation link and build status.
* Contributors: Enrique Fernández Perdomo, Jeremie Deray

2.0.0 (2015-05-22)
------------------
* Add rosindex tags
http://rosindex.github.io/contribute/metadata/#metadata-elements
* Add missed test dependencies on rospy, rostopic
* Add .gitignore for *.pyc in test
* Fix rostest dependency
* Contributors: Enrique Fernandez
1.0.3 (2015-04-04)
------------------
* Update maintainer email
* Contributors: Enrique Fernandez

1.0.2 (2014-11-14)
------------------
* Increase version to 1.0.1 for indigo release
* Add diagnostic_updater dependency
* Contributors: Enrique Fernández

0.0.1 (2014-11-13)
------------------
* Add twist multiplexer
* Contributors: Enrique Fernandez, Siegfried Gevatter, Paul Mathieu
71 changes: 71 additions & 0 deletions ROS 2 Packages/f1tenth/ackermann_mux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
cmake_minimum_required(VERSION 3.5)

project(ackermann_mux)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(ackermann_msgs REQUIRED)
find_package(diagnostic_updater REQUIRED)

include_directories(include)

set(
DEPENDENCIES
"rclcpp"
"std_msgs"
"ackermann_msgs"
"diagnostic_updater"
)

add_executable(ackermann_mux
src/ackermann_mux.cpp
src/ackermann_mux_node.cpp
src/ackermann_mux_diagnostics.cpp
)
ament_target_dependencies(ackermann_mux ${DEPENDENCIES})

install(
TARGETS ackermann_mux
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

# Pending to test ROS2 migration
#install(
# PROGRAMS scripts/joystick_relay.py
# DESTINATION lib/${PROJECT_NAME}
#)

foreach(dir launch config)
install(DIRECTORY ${dir}/
DESTINATION share/${PROJECT_NAME}/${dir})
endforeach()

install(
DIRECTORY include/
DESTINATION include
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

# find_package(launch_testing_ament_cmake)
# add_launch_test(test/system.test.py)
endif()

ament_export_include_directories(include)

ament_export_dependencies(${DEPENDENCIES})

ament_package()
57 changes: 57 additions & 0 deletions ROS 2 Packages/f1tenth/ackermann_mux/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing Guidelines
Thank you for your interest in contributing to this project
Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Reporting Bugs/Feature Requests
We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check existing open issues, or recently closed, issues to make sure
somebody else hasn't already reported the issue.
Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment


## Contributing via Pull Requests
Contributions via pull requests are much appreciated.
Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *master* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing.
If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass. (`colcon test`)
4. Commit to your fork using clear commit messages.
5. Send a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional documentation on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).


## Licensing
Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html):

~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~

Loading

0 comments on commit 68598b1

Please sign in to comment.