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

ROS2 drive and arm motor bridges #65

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Conversation

alisonryckman
Copy link
Contributor

Summary

Closes #32 #57

What features did you add, bugs did you fix, etc?
Refactored drive and arm code to remove arm translator and implement the motors groups as individual hardware bridges instead of loaded from esw.yaml

Did you add documentation to the wiki?

No

How was this code tested?

Tested on the moteus test rig with fdcanusb, tested with the jetson and drive dev board. Still need to test brushed code

Did you test this in sim?

No

Did you test this on the rover?

No

Did you add unit tests?

No, tested on hardware

@owenpark8
Copy link
Contributor

Other than any further architecture changes, seems good to go after tested on arm test rig (simulated joint C + joint B)

Copy link
Contributor

@jbrhm jbrhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was very fun to read!

"--ros-args",
"--params-file",
"~/ros2_ws/src/mrover/config/esw.yaml"
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this config intended to be in this PR?

# if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
# add_compile_definitions(DEBUG_BUILD)
# endif()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended to be commented?

@@ -159,16 +163,14 @@ message(STATUS "Found service files: ${MROVER_SERVICE_FILE_PATHS}")
# Starter Project
message(STATUS "PROJ NAME: ${PROJECT_NAME}")

set(MROVER_CMAKE_INCLUDES
set(MROVER_CMAKE_INCLUDE
starter_project/autonomy/AutonomyStarterProject.cmake
)

foreach (MROVER_CMAKE_INCLUDE ${MROVER_CMAKE_INCLUDES})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are intending to change this variable to include just one item, do we need the foreach? additionally if it is just one item, why use the variable?

ament_target_dependencies(starter_project_perception rclcpp std_msgs sensor_msgs)
# mrover_add_node(starter_project_perception ${CMAKE_CURRENT_LIST_DIR}/starter_project/autonomy/src/*.cpp)
# target_link_libraries(starter_project_perception ${OpenCV_LIBS})
# ament_target_dependencies(starter_project_perception rclcpp std_msgs sensor_msgs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the starter project perception code does not build if this is commented out. Looking above I believe the intent is to do it in the AutonomyStarterProject.cmake file, but it is currently commented out. Also not sure if these changes are intended for this PR.

@@ -6,6 +6,6 @@

superstructure:
ros__parameters:
input_topics: [ 'sim_cmd_vel', 'nav_cmd_vel' ]
input_topics: [ 'sim_cmd_vel', 'nav_cmd_vel', 'joystick_cmd_vel', 'controller_cmd_vel']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is controller_cmd_vel, I don't see any other references to it in the repo

// Need to await configuration. Can NOT directly set mIsConfigured to true.
}

auto BrushedController::adjust(Radians position) -> void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this function do?

}

// TODO:(owen) ROS1 returned bool and now we don't anymore? idk
auto BrushedController::calibrateServiceCallback([[maybe_unused]] std_srvs::srv::Trigger::Request::SharedPtr const req, std_srvs::srv::Trigger::Response::SharedPtr res) -> void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this function used?


launch_include_can = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory("mrover"), "launch/jetson_can.launch.py")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pathlib

def generate_launch_description():

launch_include_base = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(get_package_share_directory("mrover"), "launch/base.launch.py"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pathlib

@@ -44,6 +44,7 @@ def __init__(self) -> None:
self.create_timer(1 / self.get_parameter("rate").value, self.timer_callback)

def velocity_callback(self, topic: str, msg: Twist) -> None:
print("vel callback called")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intended to be here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move brushed/brushless motor ROS drivers + motors_group to ROS2
3 participants