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

Click ik #673

Open
wants to merge 75 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
9d5c131
Add initial click ik node
qhdwight Feb 13, 2024
b81546f
Add action
qhdwight Feb 13, 2024
c65b102
Save point cloud, create IK publisher
Depicar Feb 14, 2024
1771f20
Add plugin files so the nodelet can get loaded
qhdwight Feb 14, 2024
b63073f
Initialize action server
Depicar Feb 15, 2024
1278bcf
Add action client script
Depicar Feb 16, 2024
be76d77
working on limits
Crypt1cG Feb 18, 2024
c5abcbe
Merge branch 'click-ik' of github.com:umrover/mrover-ros into click-ik
Crypt1cG Feb 18, 2024
f04aebc
added arm_targeet to tf tree
Crypt1cG Feb 18, 2024
43e7d2b
worked on stuff
Crypt1cG Feb 18, 2024
92495b7
Start work on click ik action server
RobbieGM Feb 16, 2024
70f22ba
Fix some limits and rename stuff in arm_controller.cpp
RobbieGM Feb 20, 2024
659318d
server client
Depicar Feb 22, 2024
24cea9e
fixed compile bug
Depicar Feb 22, 2024
16aece7
click ik action server
RobbieGM Feb 23, 2024
1f12603
fixed ik
Crypt1cG Feb 23, 2024
2ad8859
Merge branch 'click-ik' of github.com:umrover/mrover-ros into click-ik
Crypt1cG Feb 23, 2024
0053863
Merge remote-tracking branch 'origin/integration' into click-ik
qhdwight Feb 23, 2024
aa9c2f3
Minor updateS
qhdwight Feb 23, 2024
831f547
updated comment
MarshallVielmetti Mar 6, 2024
ad58d09
added spiral search
MarshallVielmetti Mar 6, 2024
e2a4bb8
fixing poitncloud callback
MarshallVielmetti Mar 6, 2024
61448fa
cleaned up arm controller a bit
Crypt1cG Mar 6, 2024
46476c5
Merge branch 'click-ik' of github.com:umrover/mrover-ros into click-ik
Crypt1cG Mar 6, 2024
450c73d
worked on click ik transformations
Crypt1cG Mar 6, 2024
2acf605
Added action server client
Depicar Mar 7, 2024
f784620
Published IK from action client
Depicar Mar 8, 2024
28b409e
Merge remote-tracking branch 'origin/integration' into click-ik
qhdwight Mar 8, 2024
1f2a4a2
More stable so3d creation
qhdwight Mar 8, 2024
d54d366
Actually more stable
qhdwight Mar 8, 2024
912260a
Sensible default
qhdwight Mar 8, 2024
111ce92
merge
Crypt1cG Mar 10, 2024
786ae17
removed ros param
MarshallVielmetti Mar 10, 2024
0e57d8f
changed ik to use stamped pose
MarshallVielmetti Mar 10, 2024
7424cca
added static transforms
MarshallVielmetti Mar 10, 2024
726bac7
fixed broadcast rate
MarshallVielmetti Mar 10, 2024
88bb2e7
refactored arm ik to use less magic numbers
Crypt1cG Mar 10, 2024
09a3cf6
worked on click_ik
Crypt1cG Mar 13, 2024
1cfad33
Add event handler for clicking within a camera stream, implementation…
jnnanni Mar 17, 2024
c20aec9
added motor timeout to sim
Crypt1cG Mar 17, 2024
0b71a1e
Click IK periodic publishing to arm IK, update consumers.py for click IK
RobbieGM Mar 17, 2024
8e62a1d
fixed click_ik issues
Crypt1cG Mar 19, 2024
895873a
publish feedback
Depicar Mar 19, 2024
fa5e543
Merge branch 'click-ik' of github.com:umrover/mrover-ros into jnn/cli…
jnnanni Mar 19, 2024
c98f2df
Add frontend handlers for click ik, remove capacity and set to always…
jnnanni Mar 20, 2024
1ef02ff
Merge branch 'click-ik' into jnn/click-ik
alisonryckman Mar 21, 2024
44529c4
Merge branch 'jnn/click-ik' of github.com:umrover/mrover-ros into jnn…
alisonryckman Mar 21, 2024
1d6a9e6
Fix consumers.py click ik
RobbieGM Mar 21, 2024
02eb0ad
frontend video fixes
alisonryckman Mar 22, 2024
ed5c6a2
switch arm base frame and static transform error debugging
alisonryckman Mar 22, 2024
15fa58e
Merge branch 'jnn/click-ik' into click-ik
alisonryckman Mar 22, 2024
94e141b
modify simulator ik base link
alisonryckman Mar 22, 2024
30e1da8
add click ik feedback in consumers.py
RobbieGM Mar 24, 2024
b9eda52
Set up different camera feed types for each GUI
jnnanni Mar 24, 2024
91f0283
Merge branch 'integration' of github.com:umrover/mrover-ros into jnn/…
jnnanni Mar 24, 2024
99987cb
Merge branch 'integration' of github.com:umrover/mrover-ros into jnn/…
jnnanni Mar 24, 2024
1b39363
Set up camera feed types with new camera code
jnnanni Mar 24, 2024
8dee4a8
Merge branch 'jnn/click-ik' of github.com:umrover/mrover-ros into jnn…
jnnanni Mar 24, 2024
c3b98c9
Moved a lot of CameraInfo stuff to Cameras and CameraDisplay
sshapin Mar 27, 2024
1d688a2
added arm controller status publishing
Crypt1cG Mar 28, 2024
f8d3827
merge integration
alisonryckman Apr 2, 2024
fc60c93
fix arm controller limits
alisonryckman Apr 2, 2024
c7a277c
womp womp
alisonryckman Apr 2, 2024
2a6126b
Auton cameras working, CameraInfo now fully unnecessary
sshapin Apr 3, 2024
4e03cdd
fixed camera stream and click_ik
Crypt1cG Apr 9, 2024
670075e
click ik error handling
RobbieGM Apr 14, 2024
51f27be
merged integration
neuenfeldttj Apr 18, 2024
f261b3f
merged jnn/click-ik
neuenfeldttj Apr 18, 2024
c9accdc
format
neuenfeldttj Apr 18, 2024
b024fda
fixed integration merge
neuenfeldttj Apr 19, 2024
a294c1e
Merge remote-tracking branch 'origin/integration' into click-ik
qhdwight Apr 19, 2024
ee5b60b
Merge remote-tracking branch 'origin/integration' into click-ik
qhdwight Apr 19, 2024
5d02939
Make simulator achieve 120hz instead of dropping frames to be more de…
qhdwight Apr 19, 2024
822230e
Merge remote-tracking branch 'origin/integration' into click-ik
qhdwight Apr 19, 2024
5db85b6
Merge remote-tracking branch 'origin/integration' into click-ik
qhdwight Apr 19, 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
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ set(MROVER_ROS_DEPENDENCIES
tf2
tf2_ros
tf2_geometry_msgs
actionlib_msgs
)

extract_filenames(msg/*.msg MROVER_MESSAGE_FILES)

extract_filenames(srv/*.srv MROVER_SERVICE_FILES)

extract_filenames(action/*.action MROVER_ACTION_FILES)

set(MROVER_MESSAGE_DEPENDENCIES
std_msgs
sensor_msgs
actionlib_msgs
)

set(MROVER_PARAMETERS
Expand Down Expand Up @@ -115,14 +119,16 @@ endforeach ()

set(BUILD_SHARED_LIBS ON)

### ======== ###
### Messages ###
### ======== ###
### ================================ ###
### Messages & Actions & Reconfigure ###
### ================================ ###

add_message_files(FILES ${MROVER_MESSAGE_FILES})

add_service_files(FILES ${MROVER_SERVICE_FILES})

add_action_files(DIRECTORY action FILES ${MROVER_ACTION_FILES})

generate_messages(DEPENDENCIES ${MROVER_MESSAGE_DEPENDENCIES})

generate_dynamic_reconfigure_options(${MROVER_PARAMETERS})
Expand Down Expand Up @@ -191,6 +197,9 @@ mrover_nodelet_link_libraries(long_range_tag_detector opencv_core opencv_objdete
mrover_add_nodelet(usb_camera src/perception/usb_camera/*.cpp src/perception/usb_camera src/perception/usb_camera/pch.hpp)
mrover_nodelet_link_libraries(usb_camera opencv_core opencv_objdetect opencv_aruco opencv_imgproc opencv_highgui)

mrover_add_nodelet(click_ik src/perception/click_ik/*.cpp src/perception/click_ik src/perception/click_ik/pch.hpp)
mrover_nodelet_link_libraries(click_ik lie)

if (CUDA_FOUND)
# mrover_add_node(nv_vid_codec_h265_enc src/esw/nv_vid_codec_h265_enc/*.c*)
# target_link_libraries(nv_vid_codec_h265_enc PUBLIC cuda nvidia-encode opencv_core opencv_imgproc streaming)
Expand Down
6 changes: 6 additions & 0 deletions action/ClickIk.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
uint32 pointInImageX
uint32 pointInImageY
---
bool success
---
float32 distance
31 changes: 19 additions & 12 deletions launch/simulator.launch
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<launch>
<arg name="headless" default="false"/>
<arg name="run_rviz" default="true"/>
<arg name="headless" default="false" />
<arg name="run_rviz" default="true" />

<rosparam command="load" file="$(find mrover)/config/simulator/simulator.yaml"/>
<rosparam command="load" file="$(find mrover)/config/simulator/simulator.yaml" />

<include file="$(find mrover)/launch/autonomy.launch">
<arg name="sim" value="true"/>
<arg name="ekf_start_delay" value="1"/>
<arg name="sim" value="true" />
<arg name="ekf_start_delay" value="1" />
</include>

<node pkg="nodelet" type="nodelet" name="perception_nodelet_manager" required="true"
args="manager" output="screen"/>
args="manager" output="screen" />

<node pkg="nodelet" type="nodelet" name="simulator_nodelet"
args="load mrover/SimulatorNodelet perception_nodelet_manager" output="screen">
<param name="headless" value="$(arg headless)"/>
args="load mrover/SimulatorNodelet perception_nodelet_manager" output="screen">
<param name="headless" value="$(arg headless)" />
</node>

<node name="arm_controller" pkg="mrover" type="arm_controller" output="screen"/>

<!-- Transform Values Taken from URDF 3/10/24-->
<!-- <node pkg="tf" type="static_transform_publisher" name="joint_a_static_broadcaster"
args="0.164882 0.200235 0.491172 0 0 0 base_link joint_a_static 10" />
<node pkg="tf" type="static_transform_publisher" name="joint_b_static_broadcaster"
args="0.034346 0.0 0.049024 0 0 0 joint_a_static joint_b_static 10" /> -->

<node name="arm_controller" pkg="mrover" type="arm_controller" output="screen" />

<group if="$(arg run_rviz)">
<arg name="rvizconfig" default="$(find mrover)/config/rviz/auton_sim.rviz"/>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)"/>
<arg name="rvizconfig" default="$(find mrover)/config/rviz/auton_sim.rviz" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
</group>
</launch>
</launch>
1 change: 1 addition & 0 deletions msg/ArmStatus.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bool status
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@
<nodelet plugin="${prefix}/plugins/can.xml"/>
<nodelet plugin="${prefix}/plugins/simulator.xml"/>
<nodelet plugin="${prefix}/plugins/gst_websocket_streamer.xml"/>
<nodelet plugin="${prefix}/plugins/click_ik.xml" />
</export>
</package>
6 changes: 6 additions & 0 deletions plugins/click_ik.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<library path="lib/libclick_ik_nodelet">
<class name="mrover/ClickIkNodelet"
type="mrover::ClickIkNodelet"
base_class_type="nodelet::Nodelet">
</class>
</library>
40 changes: 40 additions & 0 deletions scripts/debug_click_ik.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3

import rospy
from mrover.msg import ClickIkAction, ClickIkGoal
import actionlib
import sys


def click_ik_client():
# Creates the SimpleActionClient, passing the type of the action
client = actionlib.SimpleActionClient("do_click_ik", ClickIkAction)
print("created click ik client")
# Waits until the action server has started up and started
# listening for goals.
client.wait_for_server()
print("Found server")
# Creates a goal to send to the action server.
goal = ClickIkGoal()
# Sends the goal to the action server.
goal.pointInImageX = 320
goal.pointInImageY = 240
client.send_goal(goal, feedback_cb=feedback)
client.wait_for_result()
result = client.get_result()
return result


def feedback(msg):
print(msg)


if __name__ == "__main__":
try:
# Initializes a rospy node so that the SimpleActionClient can
# publish and subscribe over ROS.
rospy.init_node("debug_click_ik")
result = click_ik_client()
print("result: ", result)
except rospy.ROSInterruptException:
print("program interrupted before completion", file=sys.stderr)
8 changes: 4 additions & 4 deletions scripts/debug_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

from typing import Any
import rospy
from std_srvs.srv import SetBool, SetBoolResponse
from mrover.srv import ChangeCameras, ChangeCamerasResponse

# Change these values for the service name and type definition to test different values
SERVICE_NAME = "science_enable_heater_b1"
SERVICE_TYPE = SetBool
SERVICE_NAME = "change_cameras"
SERVICE_TYPE = ChangeCameras


def print_service_request(service_request: Any):
rospy.loginfo(service_request)
return SetBoolResponse(success=True)
return ChangeCamerasResponse(success=True)


def main():
Expand Down
73 changes: 73 additions & 0 deletions src/esw/fw/pdlb_bare/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
cmake_minimum_required(VERSION 3.28)

# specify cross-compilers and tools
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_AR arm-none-eabi-ar)
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

# project settings
project(pdlb_bare C CXX ASM)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)

#Uncomment for hardware floating point
#add_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING)
#add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
#add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)

#Uncomment for software floating point
#add_compile_options(-mfloat-abi=soft)

add_compile_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork)
add_compile_options(-ffunction-sections -fdata-sections -fno-common -fmessage-length=0)

# uncomment to mitigate c++17 absolute addresses warnings
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-register")

# Enable assembler files preprocessing
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-x$<SEMICOLON>assembler-with-cpp>)

if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
message(STATUS "Maximum optimization for speed")
add_compile_options(-Ofast)
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
message(STATUS "Maximum optimization for speed, debug info included")
add_compile_options(-Ofast -g)
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
message(STATUS "Maximum optimization for size")
add_compile_options(-Os)
else ()
message(STATUS "Minimal optimization, debug info included")
add_compile_options(-Og -g)
endif ()

include_directories(Core/Inc Drivers/STM32G4xx_HAL_Driver/Inc Drivers/STM32G4xx_HAL_Driver/Inc/Legacy Drivers/CMSIS/Device/ST/STM32G4xx/Include Drivers/CMSIS/Include)

add_definitions(-DDEBUG -DUSE_HAL_DRIVER -DSTM32G431xx)

file(GLOB_RECURSE SOURCES "Core/*.*" "Drivers/*.*")

set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/)

add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map)
add_link_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork)
add_link_options(-T ${LINKER_SCRIPT})

add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT})

set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex)
set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin)

add_custom_command(TARGET ${PROJECT_NAME}.elf POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${PROJECT_NAME}.elf> ${HEX_FILE}
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${PROJECT_NAME}.elf> ${BIN_FILE}
COMMENT "Building ${HEX_FILE}
Building ${BIN_FILE}")
72 changes: 72 additions & 0 deletions src/esw/fw/pdlb_bare/CMakeLists_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#${templateWarning}
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
${cmakeRequiredVersion}
# specify cross-compilers and tools
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_AR arm-none-eabi-ar)
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
set(SIZE arm-none-eabi-size)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

# project settings
project(${projectName} C CXX ASM)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)

#Uncomment for hardware floating point
#add_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING)
#add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
#add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)

#Uncomment for software floating point
#add_compile_options(-mfloat-abi=soft)

add_compile_options(-mcpu=${mcpu} -mthumb -mthumb-interwork)
add_compile_options(-ffunction-sections -fdata-sections -fno-common -fmessage-length=0)

# uncomment to mitigate c++17 absolute addresses warnings
#set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} -Wno-register")

# Enable assembler files preprocessing
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-x$<SEMICOLON>assembler-with-cpp>)

if ("$${CMAKE_BUILD_TYPE}" STREQUAL "Release")
message(STATUS "Maximum optimization for speed")
add_compile_options(-Ofast)
elseif ("$${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
message(STATUS "Maximum optimization for speed, debug info included")
add_compile_options(-Ofast -g)
elseif ("$${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
message(STATUS "Maximum optimization for size")
add_compile_options(-Os)
else ()
message(STATUS "Minimal optimization, debug info included")
add_compile_options(-Og -g)
endif ()

include_directories(${includes})

add_definitions(${defines})

file(GLOB_RECURSE SOURCES ${sources})

set(LINKER_SCRIPT $${CMAKE_SOURCE_DIR}/${linkerScript})

add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=$${PROJECT_BINARY_DIR}/$${PROJECT_NAME}.map)
add_link_options(-mcpu=${mcpu} -mthumb -mthumb-interwork)
add_link_options(-T $${LINKER_SCRIPT})

add_executable($${PROJECT_NAME}.elf $${SOURCES} $${LINKER_SCRIPT})

set(HEX_FILE $${PROJECT_BINARY_DIR}/$${PROJECT_NAME}.hex)
set(BIN_FILE $${PROJECT_BINARY_DIR}/$${PROJECT_NAME}.bin)

add_custom_command(TARGET $${PROJECT_NAME}.elf POST_BUILD
COMMAND $${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:$${PROJECT_NAME}.elf> $${HEX_FILE}
COMMAND $${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:$${PROJECT_NAME}.elf> $${BIN_FILE}
COMMENT "Building $${HEX_FILE}
Building $${BIN_FILE}")
19 changes: 19 additions & 0 deletions src/esw/fw/pdlb_bare/st_nucleo_g4.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: GPL-2.0-or-later

# This is for all ST NUCLEO with any STM32G4. Known boards at the moment:
# NUCLEO-G431KB
# https://www.st.com/en/evaluation-tools/nucleo-g431kb.html
# NUCLEO-G431RB
# https://www.st.com/en/evaluation-tools/nucleo-g431rb.html
# NUCLEO-G474RE
# https://www.st.com/en/evaluation-tools/nucleo-g474re.html
# NUCLEO-G491RE
# https://www.st.com/en/evaluation-tools/nucleo-g491re.html

source [find interface/stlink.cfg]

transport select hla_swd

source [find target/stm32g4x.cfg]

reset_config srst_only
Loading
Loading