Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
172a470
Porting vesc meta-package to ROS2.
Dec 7, 2020
7a16e51
Porting all package.xml and CMakeList.txt files to ROS2.
Dec 8, 2020
af9c27d
[vesc_msgs] Ported to ROS2.
Dec 12, 2020
cff7f0c
[vesc_driver] Removing nodelet XML and renaming header files.
Dec 12, 2020
300419e
[vesc_driver] Removing unnecessary files and renaming header files.
Dec 12, 2020
da23406
[vesc_driver] Starting port of vesc_driver.
Dec 12, 2020
1e0a01f
[vesc_driver] Working on implementation of rclcpp::Node.
Dec 12, 2020
730e606
[vesc_driver] Finished port - applied uncrustify.
Dec 13, 2020
840351e
[vesc_driver] Fixing copyrights and finishing transition to boost::asio.
Dec 13, 2020
5533393
[vesc_driver] Node finally starts.
Dec 13, 2020
1e5c871
[vesc_ackermann] Starting port.
Dec 14, 2020
45d345a
[vesc_ackermann] Porting complete.
Dec 14, 2020
d52e16a
[CI] Adding ROS2 build jobs.
Dec 14, 2020
7dd2e5b
[CI] Only running on Foxy.
Dec 14, 2020
58ff367
[CI] Updating badge in README.
Dec 14, 2020
e2c00b6
[vesc_driver] Set launch file to typical device for F1TENTH.
Dec 16, 2020
9f364e7
[vesc_driver] Adding all optional params to launch.
Dec 17, 2020
9a50f63
[vesc_driver] Re-adding missing join() for thread.
Dec 17, 2020
a047acd
[vesc_ackermann] Adding some missing include headers and using statem…
Dec 17, 2020
929b9e5
Add mutex and wait in read thread.
Dec 23, 2020
7f49d43
[vesc_driver] Changing default port to F1TENTH symlink name.
Dec 23, 2020
69d6999
[vesc_driver] Optimizing mutex utilization.
Dec 23, 2020
a4dd716
working ros2 driver
HaoruXue May 17, 2021
255e0e7
resolved inbound serial comunication problems
anscipione May 22, 2021
2a00e4c
protocol update to FW 5.2
anscipione May 22, 2021
d9a8c9b
fix test results
anscipione May 24, 2021
c8a1c57
Merge branch 'Ros2_bug_fixing_serial_comunication' into protocol_upda…
anscipione May 24, 2021
01f6304
fixed test results
anscipione May 24, 2021
acd2bf4
removed old methods
anscipione Jun 3, 2021
21d75d3
removed commented-out code
anscipione Jun 3, 2021
e19e77f
Merge remote-tracking branch 'origin/Ros2_bug_fixing_serial_comunicat…
anscipione Jun 4, 2021
7e6d2ba
Merge pull request #11 from anscipione/Ros2_bug_fixing_serial_comunic…
Jun 11, 2021
3915a92
Merge branch 'ros2' into protocol_update_to_FW_5.2
anscipione Jun 11, 2021
faa2361
Merge pull request #12 from anscipione/protocol_update_to_FW_5.2
Jun 28, 2021
556abea
minor coding practice updates
HaoruXue Aug 5, 2021
996bda3
force c++17
HaoruXue Aug 5, 2021
5ea6c5f
std::optional -> std::experimental::optional
HaoruXue Aug 6, 2021
c2c9b8b
modified launch file
HaoruXue Aug 6, 2021
448675e
update readme
HaoruXue Aug 6, 2021
7fc6c0d
removed old error handler
HaoruXue Aug 6, 2021
c47fccb
resolved inbound serial comunication problems
anscipione May 22, 2021
6fa3789
protocol update to FW 5.2
anscipione May 22, 2021
4126b55
fix test results
anscipione May 24, 2021
654ba11
fixed test results
anscipione May 24, 2021
e4de5f7
removed old methods
anscipione Jun 3, 2021
039fcef
working ros2 driver
HaoruXue May 17, 2021
b9741d0
rebased to upstream
HaoruXue Aug 6, 2021
ab8e179
node naving convention; removed unused variable
HaoruXue Aug 10, 2021
8c41840
Merge branch 'ros2' of https://github.com/Triton-AI/vesc into ros2
HaoruXue Aug 10, 2021
84f8b63
update cmake
HaoruXue Aug 10, 2021
eb0ef55
update main branch changes
HaoruXue Aug 10, 2021
8c9bb0a
removed debug codes from 654ba11
HaoruXue Aug 10, 2021
9617c19
Merge branch 'ros2' of https://github.com/f1tenth/vesc into f1tenth-ros2
HaoruXue Aug 12, 2021
8e871a8
Merge branch 'f1tenth-ros2' into ros2
HaoruXue Aug 12, 2021
4854265
remove serial driver from cmake
HaoruXue Aug 12, 2021
1952e79
Merge pull request #14 from Triton-AI/ros2
Aug 12, 2021
2c9dd35
Fix linter errors
JWhitleyWork Nov 8, 2021
e680b30
change subscriber msg type to Float
Oct 28, 2021
3174e83
Merge pull request #18 from jacobjj/ros2_correction
Nov 8, 2021
8aadb17
added program to enumerate vesc serial ports based on their uuid
anscipione Jun 11, 2021
7146d28
added script for udev
anscipione Jun 21, 2021
59a27e2
fixed test for udev
anscipione Jun 21, 2021
4a9aafd
added imu polling
anscipione Jun 21, 2021
e500399
fixed timing wait for imu polling
anscipione Jun 22, 2021
a8dbe88
fix sensor
anscipione Jun 23, 2021
68c1664
replaced boost::bind with std::bind
anscipione Jul 3, 2021
6b18386
publish sensors_msgs::Imu
anscipione Sep 16, 2021
ea93496
fixed some test issues
anscipione Nov 12, 2021
114b780
Merge pull request #19 from anscipione/add_imu_support_rebase_v2
JWhitleyWork Nov 12, 2021
29c5038
use sync receive; add back error handler
HaoruXue Jan 13, 2022
c97d86f
reduce print severity to debug
HaoruXue Jan 13, 2022
43f67d4
update readme
HaoruXue Jan 13, 2022
da6d66d
Merge pull request #20 from Triton-AI/ros2
hzheng40 Feb 1, 2022
9adb37e
debug vesc_to_odom tf not publishing
HaoruXue Feb 16, 2022
8207943
Merge pull request #21 from Triton-AI/ros2
hzheng40 Feb 17, 2022
0242cd8
Fix issue with if statements.
Mar 4, 2023
1096648
Expose VESC config from VESC driver launch file.
Mar 4, 2023
0b6248e
Add ci for ros 2 Humble.
ValerioMagnago Mar 10, 2023
e8d9d5b
Merge pull request #30 from Mailamaca/fix_bug
JWhitleyWork Mar 17, 2023
44a716f
Merge pull request #32 from Mailamaca/humble_ci
JWhitleyWork Mar 17, 2023
be0b42c
Merge pull request #31 from Mailamaca/custom_driver_config
JWhitleyWork Mar 17, 2023
307f99d
Remove foxy workflow.
ValerioMagnago Mar 19, 2023
4af6bd7
Make cpplint happy of includes order.
ValerioMagnago Mar 19, 2023
b3c67ab
Make cppcheck happy fixing overflow.
ValerioMagnago Mar 19, 2023
ce260f8
Fix compilation on ros humble.
ValerioMagnago Mar 19, 2023
153998d
Merge pull request #33 from Mailamaca/ros2_humble
JWhitleyWork Mar 27, 2023
e4f3e87
Negate current speed variable for vesc_to_odom package (#1)
adamlm Mar 22, 2024
f642c78
Update README.md (#3)
SaikrishnaBairamoni Sep 24, 2024
e3d647f
Update README.md
Tanuj-D Oct 16, 2024
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
32 changes: 18 additions & 14 deletions .github/workflows/ros1-ci.yaml → .github/workflows/ros2-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
name: ROS1 CI Workflow
name: ROS2 CI Workflow

on:
pull_request:
branches:
- ros2
push:
branches:
- main
- ros2

jobs:

build-ros1:
runs-on: ubuntu-latest
build-ros2:
strategy:
fail-fast: false
matrix:
config:
- {
ros_distro: "humble"
}
runs-on: ubuntu-latest
container:
image: ros:melodic
image: ros:${{ matrix.config.ros_distro }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Create Workspace
run: |
mkdir -p src_tmp/vesc; \
mv `find -maxdepth 1 -not -name . -not -name src_tmp` src_tmp/vesc/; \
mv src_tmp/ src/; \
cd src; \
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
catkin_init_workspace'
mkdir -p src_tmp/vesc
mv `find -maxdepth 1 -not -name . -not -name src_tmp` src_tmp/vesc/
mv src_tmp/ src/
- name: Install Dependencies
run: |
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
Expand All @@ -33,9 +37,9 @@ jobs:
- name: Build Workspace
run: |
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
catkin_make'
colcon build --event-handlers console_cohesion+'
- name: Run Tests
run: |
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
catkin_make run_tests; \
catkin_test_results --verbose'
colcon test --event-handlers console_cohesion+; \
colcon test-result --verbose'
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Veddar VESC Interface

![ROS1 CI Workflow](https://github.com/f1tenth/vesc/workflows/ROS1%20CI%20Workflow/badge.svg)
Vesc is a new repository that was forked to provide a local instance for developing minor changes required for the C1T system. The only update included in this release is negating the speed value sent to the vesc due to the motors being installed in the opposite direction.

Packages to interface with Veddar VESC motor controllers. See https://vesc-project.com/ for details

This is a ROS2 implementation of the ROS1 driver using the new serial driver located in [transport drivers](https://github.com/ros-drivers/transport_drivers).

## How to test

1. Clone this repository and [transport drivers](https://github.com/ros-drivers/transport_drivers) into `src`.
2. `rosdep update && rosdep install --from-paths src -i -y`
3. Plug in the VESC with a USB cable.
4. Modify `vesc/vesc_driver/params/vesc_config.yaml` to reflect any changes.
5. Build the packages `colcon build`
6. `ros2 launch vesc_driver vesc_driver_node.launch.py`
7. If prompted "permission denied" on the serial port: `sudo chmod 777 /dev/ttyACM0`

## Contribution
Welcome to the CARMA contributing guide. Please read this guide to learn about our development process, how to propose pull requests and improvements, and how to build and test your changes to this project. [CARMA Contributing Guide](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)

## Code of Conduct
Please read our [CARMA Code of Conduct](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Code_of_Conduct.md) which outlines our expectations for participants within the CARMA community, as well as steps to reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored. Anyone who violates this code of conduct may be banned from the community.

## Attribution
The development team would like to acknowledge the people who have made direct contributions to the design and code in this repository. [CARMA Attribution](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/ATTRIBUTION.txt)

## License
By contributing to the Federal Highway Administration (FHWA) Connected Automated Research Mobility Applications (CARMA), you agree that your contributions will be licensed under its Apache License 2.0 license. [CARMA License](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/docs/License.md)

## Contact
Please click on the CARMA logo below to visit the Federal Highway Adminstration(FHWA) CARMA website. For technical support from the CARMA team, please contact the CARMA help desk at [email protected].

[![CARMA Image](https://raw.githubusercontent.com/usdot-fhwa-stol/carma-platform/develop/docs/image/CARMA_icon.png)](https://highways.dot.gov/research/research-programs/operations/CARMA)
6 changes: 3 additions & 3 deletions vesc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(vesc)
find_package(catkin REQUIRED)
catkin_metapackage()
find_package(ament_cmake_auto REQUIRED)
ament_auto_package()
5 changes: 3 additions & 2 deletions vesc/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
<url type="bugtracker">https://github.com/f1tenth/vesc/issues</url>
<author email="[email protected]">Michael T. Boulet</author>
<author email="[email protected]">Joshua Whitley</author>
<author email="[email protected]">Haoru Xue</author>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake_auto</buildtool_depend>

<exec_depend>vesc_driver</exec_depend>
<exec_depend>vesc_msgs</exec_depend>
<exec_depend>vesc_ackermann</exec_depend>

<export>
<metapackage/>
<build_type>ament_cmake</build_type>
</export>
</package>
111 changes: 29 additions & 82 deletions vesc_ackermann/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,101 +1,48 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(vesc_ackermann)

# Setting C++ standard to 11
if (NOT "${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}")
message(STATUS "Changing CXX_STANDARD from C++98 to C++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif ("${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}" STREQUAL "98")
message(STATUS "Changing CXX_STANDARD from C++98 to C++11")
set(CMAKE_CXX_STANDARD 11)
# Setting C++ standard to 14
if(NOT "${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}")
message(STATUS "Changing CXX_STANDARD from C++98 to C++14")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif("${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}" STREQUAL "98")
message(STATUS "Changing CXX_STANDARD from C++98 to C++14")
set(CMAKE_CXX_STANDARD 14)
endif()

find_package(catkin REQUIRED COMPONENTS
ackermann_msgs
geometry_msgs
nav_msgs
nodelet
pluginlib
roscpp
roslint
std_msgs
tf
vesc_msgs
)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
ackermann_msgs
geometry_msgs
nav_msgs
nodelet
pluginlib
std_msgs
tf
vesc_msgs
)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

###########
## Build ##
###########

include_directories(
include
${catkin_INCLUDE_DIRS}
# nodes library
ament_auto_add_library(${PROJECT_NAME} SHARED
src/ackermann_to_vesc.cpp
src/vesc_to_odom.cpp
)

# node executable
add_executable(vesc_to_odom_node src/vesc_to_odom_node.cpp
src/vesc_to_odom.cpp)
add_dependencies(vesc_to_odom_node ${catkin_EXPORTED_TARGETS})
target_link_libraries(vesc_to_odom_node
${catkin_LIBRARIES}
# register nodes as components
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN vesc_ackermann::AckermannToVesc
EXECUTABLE ackermann_to_vesc_node
)

add_executable(ackermann_to_vesc_node src/ackermann_to_vesc_node.cpp
src/ackermann_to_vesc.cpp)
add_dependencies(ackermann_to_vesc_node ${catkin_EXPORTED_TARGETS})
target_link_libraries(ackermann_to_vesc_node
${catkin_LIBRARIES}
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN vesc_ackermann::VescToOdom
EXECUTABLE vesc_to_odom_node
)

# nodelet library
add_library(vesc_ackermann_nodelet src/ackermann_to_vesc_nodelet.cpp
src/ackermann_to_vesc.cpp
src/vesc_to_odom_nodelet.cpp
src/vesc_to_odom.cpp)
add_dependencies(vesc_ackermann_nodelet ${catkin_EXPORTED_TARGETS})
target_link_libraries(vesc_ackermann_nodelet
${catkin_LIBRARIES}
)

set(ROSLINT_CPP_OPTS "--filter=-build/c++11")
roslint_cpp()

#############
## Install ##
#############

install(TARGETS vesc_to_odom_node ackermann_to_vesc_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(TARGETS vesc_ackermann_nodelet
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
install(FILES vesc_ackermann_nodelet.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)

#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING)
roslint_add_test()
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package(
INSTALL_TO_SHARE
launch
)
61 changes: 0 additions & 61 deletions vesc_ackermann/include/vesc_ackermann/ackermann_to_vesc.h

This file was deleted.

68 changes: 68 additions & 0 deletions vesc_ackermann/include/vesc_ackermann/ackermann_to_vesc.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright 2020 F1TENTH Foundation
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the {copyright_holder} nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// -*- mode:c++; fill-column: 100; -*-

#ifndef VESC_ACKERMANN__ACKERMANN_TO_VESC_HPP_
#define VESC_ACKERMANN__ACKERMANN_TO_VESC_HPP_

#include <ackermann_msgs/msg/ackermann_drive_stamped.hpp>
#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/float64.hpp>

namespace vesc_ackermann
{

using ackermann_msgs::msg::AckermannDriveStamped;
using std_msgs::msg::Float64;

class AckermannToVesc : public rclcpp::Node
{
public:
explicit AckermannToVesc(const rclcpp::NodeOptions & options);

private:
// ROS parameters
// conversion gain and offset
double speed_to_erpm_gain_, speed_to_erpm_offset_;
double steering_to_servo_gain_, steering_to_servo_offset_;

/** @todo consider also providing an interpolated look-up table conversion */

// ROS services
rclcpp::Publisher<Float64>::SharedPtr erpm_pub_;
rclcpp::Publisher<Float64>::SharedPtr servo_pub_;
rclcpp::Subscription<AckermannDriveStamped>::SharedPtr ackermann_sub_;

// ROS callbacks
void ackermannCmdCallback(const AckermannDriveStamped::SharedPtr cmd);
};

} // namespace vesc_ackermann

#endif // VESC_ACKERMANN__ACKERMANN_TO_VESC_HPP_
Loading