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

Lander align #658

Draft
wants to merge 102 commits into
base: integration
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
8371197
Start lander align
umroverPerception Jan 17, 2024
a1e9bc1
Setup nodelet arch
qhdwight Jan 17, 2024
a6ded2d
Add more boilerplate
qhdwight Jan 17, 2024
b25c1b5
Merge remote-tracking branch 'origin/integration' into lander-align
qhdwight Jan 18, 2024
522f03a
Merge remote-tracking branch 'origin/integration' into lander-align
qhdwight Jan 18, 2024
016a24d
Make compile
qhdwight Jan 18, 2024
54a0b70
Redefine filtering/ransac problem
johuang50 Jan 25, 2024
4ca2905
Implement RANSAC plane fitting vec math
johuang50 Jan 26, 2024
6fbcf43
Remove ground normals
MyCabbages4 Feb 2, 2024
ff6bc8a
Added TODO
MyCabbages4 Feb 2, 2024
a470589
Implement RANSAC with inlier count as metric
johuang50 Feb 2, 2024
275c4c1
Add retry zero-vector case
johuang50 Feb 3, 2024
d992ec7
Fix some semantics
johuang50 Feb 3, 2024
8c8a0e3
it builds :)
jaskifstad Feb 4, 2024
ba0a8c7
Updates
jbrhm Feb 6, 2024
fd76219
calculating center point of plane UNTESTED
MyCabbages4 Feb 7, 2024
e2b4676
Merged
jbrhm Feb 7, 2024
0fe7f6d
Merged with Integration
jbrhm Feb 7, 2024
756a5f7
Real Merge with Integration
jbrhm Feb 7, 2024
fc22a35
Removed stuff
jbrhm Feb 7, 2024
addf9cf
Fix everything
johuang50 Feb 8, 2024
00082d6
Add twist write function WIP
kushalsodum Feb 8, 2024
4b2429c
Added commented code for detecting center
MyCabbages4 Feb 9, 2024
d042f55
Twist Send Updates(WIP)
kushalsodum Feb 9, 2024
9891483
commented angle error function
MyCabbages4 Feb 9, 2024
a4dc439
incomplete PID implementation
jaskifstad Feb 9, 2024
f3b9f2f
finished basic drive control, added pidf.hpp
jaskifstad Feb 10, 2024
ccc9249
please work
jaskifstad Feb 10, 2024
ef1041f
finished initial control loop + ransac
jaskifstad Feb 11, 2024
c5084ae
Merge remote-tracking branch 'origin/integration' into lander-align
jbrhm Feb 11, 2024
692ed6f
Fixing launch
jbrhm Feb 11, 2024
a9e3f1d
opt issue fix
jaskifstad Feb 13, 2024
a4a82fd
Sim not publishing
jbrhm Feb 13, 2024
83864c7
Merged
jbrhm Feb 13, 2024
80cd9ed
ransac plane normals don't make sense, randomly started freezing
jaskifstad Feb 14, 2024
9713e9d
Fixed a couple of bugs with ransac, but added a bunch of issues tryin…
jaskifstad Feb 16, 2024
e233c08
Merge
jbrhm Feb 18, 2024
197f3df
Why is the location weird
jbrhm Feb 18, 2024
3c5c956
Update cmake for action files
johuang50 Feb 21, 2024
affc915
normals work ransac dpeosnt;sd;dofhifoasdf
jaskifstad Feb 21, 2024
08fb736
pc vizualized
jbrhm Feb 22, 2024
3ace1d6
Fix action build
johuang50 Feb 22, 2024
7b4e884
Uncomment action configs in CMakeLists.txt
johuang50 Feb 23, 2024
6dc9bf7
Merge remote-tracking branch 'origin/integration' into lander-align
jaskifstad Feb 23, 2024
d87c50f
Merge remote-tracking branch 'origin/lander-align' into lander-align
jaskifstad Feb 23, 2024
60f3747
qrcooking
jaskifstad Feb 23, 2024
ed769dd
Merge remote-tracking branch 'origin/integration' into lander-align
qhdwight Mar 3, 2024
0ac0792
Clean up and fix build errors
jbrhm Mar 5, 2024
30eb844
WHYYY
jbrhm Mar 5, 2024
eb7f6b2
bad optional access
jaskifstad Mar 5, 2024
2d965e9
bad optional fixed
MyCabbages4 Mar 6, 2024
f21a226
plane good offset work
alisonryckman Mar 6, 2024
111bf1d
stuff
alisonryckman Mar 6, 2024
eb03a90
Fixed some stuff
jbrhm Mar 6, 2024
a5fcd3f
Cooked
jbrhm Mar 6, 2024
ace3eca
Not as cooked
jbrhm Mar 7, 2024
2596de1
Not finished
jbrhm Mar 7, 2024
6f3446d
Make No Sense -YoungBoy Never Broke again
jbrhm Mar 7, 2024
1b6f700
Maybe?
jbrhm Mar 7, 2024
9a7c0c6
Switch Cooked
jbrhm Mar 7, 2024
6fd4ed5
refactoring sendTwist
jbrhm Mar 7, 2024
3cdc0c0
pushed
jbrhm Mar 7, 2024
c04a088
Working Lande Align Rough
jbrhm Mar 8, 2024
e04ac35
lander respurces
jbrhm Mar 10, 2024
f9bb85e
need better path planning
jbrhm Mar 10, 2024
6ab3af4
Pre Reframing
jbrhm Mar 14, 2024
1ae4ada
Refactoring
jbrhm Mar 14, 2024
e0367be
WIP
jbrhm Mar 14, 2024
4ef4d17
Working Align
jbrhm Mar 14, 2024
075f071
Boilerplate teleop lander align state
johuang50 Mar 17, 2024
7194f89
Bet
jbrhm Mar 15, 2024
0feb0b5
Action Server stuff
jbrhm Mar 17, 2024
de073a0
COOOKED
jbrhm Mar 17, 2024
64e5cf3
Building
qhdwight Mar 17, 2024
fe74915
No topics
jbrhm Mar 17, 2024
a754273
Working coutn to 10
jbrhm Mar 17, 2024
062a6fa
Working in teleop backend
jbrhm Mar 21, 2024
39d9cb0
working action server
jbrhm Mar 21, 2024
95735a7
flooring + tuning
jbrhm Mar 21, 2024
17353f1
Added Smarter Movement
jbrhm Mar 21, 2024
c679411
Dummy Server Script
jbrhm Mar 22, 2024
1e1d80f
Updated Consumers.py
jbrhm Mar 24, 2024
eead32a
removed callback
jbrhm Mar 24, 2024
b6fffc5
added toggle
neuenfeldttj Mar 24, 2024
44d202f
Merge branch 'lander-align' of github.com:umrover/mrover-ros into lan…
neuenfeldttj Mar 24, 2024
915f2b0
Some refactoring
jbrhm Mar 24, 2024
72e887b
Merge branch 'lander-align' of github.com:umrover/mrover-ros into lan…
jbrhm Mar 24, 2024
00b569f
Fixed Backend Error
jbrhm Mar 24, 2024
e89cad8
Removed PID
jbrhm Mar 24, 2024
0ef3a04
more refactoring
jbrhm Mar 24, 2024
1193b2a
Organizing
jbrhm Mar 26, 2024
5c80fd9
stuff
jbrhm Mar 26, 2024
ac3025c
build action files
alisonryckman Mar 26, 2024
01496b6
stuff
jaskifstad Mar 28, 2024
449447e
Co-authored-by: jbrhm <[email protected]>
jaskifstad Mar 28, 2024
d463b7b
nothing works :)
jaskifstad Mar 29, 2024
888241c
Keeps going past; Not inline with normal
jbrhm Mar 30, 2024
8d19aa6
:(
jbrhm Mar 30, 2024
95c91f4
IDK changes or smthn
jbrhm Mar 31, 2024
6658f4b
Not sure if its supposed to be line tracking
jbrhm Mar 31, 2024
6648e44
Beginning some things
jaskifstad Mar 31, 2024
6e99fad
continued to start stuff
MyCabbages4 Mar 31, 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
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,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 @@ -97,13 +101,15 @@ 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 @@ -214,7 +220,9 @@ endif ()

## Teleoperation

mrover_add_nodelet(lander_align src/teleoperation/lander_align/*.cpp src/teleoperation/lander_align src/teleoperation/lander_align/pch.hpp)
mrover_add_node(arm_controller src/teleoperation/arm_controller/*.cpp)
mrover_nodelet_link_libraries(lander_align lie)

## Simulator

Expand Down Expand Up @@ -251,4 +259,4 @@ catkin_add_nosetests(test/util/SO3_test.py)

install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)
)
8 changes: 8 additions & 0 deletions action/LanderAlign.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Define the goal
uint32 num # Specify which dishwasher we want to use
---
# Define the result
uint32 num
---
# Define a feedback message
string curr_state
4 changes: 4 additions & 0 deletions config/simulator/simulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ objects:
name: rock4
uri: package://mrover/urdf/world/rock.urdf.xacro
translation: [9, -2, 0.2]
- type: urdf
name: lander
uri: package://mrover/urdf/world/lander.urdf.xacro
translation: [8, 6, 2]
2 changes: 1 addition & 1 deletion launch/autonomy.launch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<arg name="run_object_detector" value="$(arg run_object_detector)" />
</include>

<include file="$(find mrover)/launch/navigation.launch" />
<!-- <include file="$(find mrover)/launch/navigation.launch" /> -->

<include file="$(find mrover)/launch/localization.launch">
<arg name="sim" value="$(arg sim)" />
Expand Down
1 change: 1 addition & 0 deletions launch/simulator.launch
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<arg name="run_rviz" default="true"/>

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

<include file="$(find mrover)/launch/autonomy.launch">
<arg name="sim" value="true"/>
Expand Down
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/nv_gst_h265_enc.xml" />
<nodelet plugin="${prefix}/plugins/lander_align_plugin.xml" />
</export>
</package>
6 changes: 6 additions & 0 deletions plugins/lander_align_plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<library path="lib/liblander_align_nodelet">
<class name="mrover/LanderAlignNodelet"
type="mrover::LanderAlignNodelet"
base_class_type="nodelet::Nodelet">
</class>
</library>
1 change: 1 addition & 0 deletions src/simulator/shaders/shaders.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct OutFragment {
let specular = specularStrength * spec * su.lightColor;
// Combination
out.color = vec4(((ambient + diffuse + specular) * baseColor).rgb, 1);
// out.color = vec4(in.normalInWorld.x, in.normalInWorld.y, in.normalInWorld.z, 1);
return out;
}

Expand Down
25 changes: 23 additions & 2 deletions src/teleoperation/backend/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import rospy
import tf2_ros
import cv2
import actionlib
from cv_bridge import CvBridge
from geometry_msgs.msg import Twist
from mrover.msg import (
Expand All @@ -25,8 +26,10 @@
Velocity,
Position,
IK,
LanderAlignAction,
LanderAlignGoal
)
from mrover.srv import EnableAuton, ChangeCameras, CapturePanorama
from mrover.srv import EnableAuton, ChangeCameras
from sensor_msgs.msg import NavSatFix, Temperature, RelativeHumidity, Image
from mrover.srv import EnableAuton
from sensor_msgs.msg import NavSatFix, Temperature, RelativeHumidity
Expand Down Expand Up @@ -100,7 +103,7 @@ def connect(self):
self.cache_enable_limit = rospy.ServiceProxy("cache_enable_limit_switches", SetBool)
self.calibrate_service = rospy.ServiceProxy("arm_calibrate", Trigger)
self.change_cameras_srv = rospy.ServiceProxy("change_cameras", ChangeCameras)
self.capture_panorama_srv: Any = rospy.ServiceProxy("capture_panorama", CapturePanorama)
# self.capture_panorama_srv = rospy.ServiceProxy("capture_panorama", CapturePanorama)

# ROS Parameters
self.mappings = rospy.get_param("teleop/joystick_mappings")
Expand All @@ -121,6 +124,9 @@ def connect(self):
self.flight_thread = threading.Thread(target=self.flight_attitude_listener)
self.flight_thread.start()

#Actions Servers
self.landerClient = actionlib.SimpleActionClient('LanderAlignAction', LanderAlignAction)

except rospy.ROSException as e:
rospy.logerr(e)

Expand Down Expand Up @@ -180,6 +186,10 @@ def receive(self, text_data):
self.save_basic_waypoint_list(message)
elif message["type"] == "get_basic_waypoint_list":
self.get_basic_waypoint_list(message)
elif message["type"] == "start_lander_align":
self.start_lander_align()
elif message["type"] == "stop_lander_align":
self.stop_lander_align()
except Exception as e:
rospy.logerr(e)

Expand Down Expand Up @@ -711,3 +721,14 @@ def flight_attitude_listener(self):
self.send(text_data=json.dumps({"type": "flight_attitude", "pitch": pitch, "roll": roll}))

rate.sleep()

def start_lander_align(self) -> None:
goal = LanderAlignGoal()
self.landerClient.send_goal(goal)
pass

def stop_lander_align(self) -> None:
if(self.landerClient.get_state() != 3):
self.landerClient.cancel_goal()
pass

22 changes: 19 additions & 3 deletions src/teleoperation/frontend/src/components/AutonTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
<p style="margin-top: 6px">Joystick Values</p>
<JoystickValues />
</div>
<div class="my-5">
<ToggleButton :labelEnableText="'Lander Align Enabled'"
:labelDisableText="'Lander Align Disabled'"
:currentState="landerAlignEnabled"
@change="toggleLander()"></ToggleButton>
</div>
<OdometryReading :odom="odom" />
</div>
<div class="shadow p-3 rounded map">
Expand Down Expand Up @@ -68,6 +74,7 @@ import OdometryReading from './OdometryReading.vue'
import JoystickValues from './JoystickValues.vue'
import DriveControls from './DriveControls.vue'
import MastGimbalControls from './MastGimbalControls.vue'
import ToggleButton from './ToggleButton.vue'
import { quaternionToMapAngle } from '../utils.js'
import { defineComponent } from 'vue'

Expand All @@ -84,7 +91,8 @@ export default defineComponent({
OdometryReading,
JoystickValues,
DriveControls,
MastGimbalControls
MastGimbalControls,
ToggleButton
},

// add prop where map has the center property and autontask sends it once it gets it
Expand Down Expand Up @@ -121,7 +129,9 @@ export default defineComponent({
effort: [] as number[],
state: [] as string[],
error: [] as string[]
}
},

landerAlignEnabled: false,
}
},

Expand Down Expand Up @@ -168,7 +178,13 @@ export default defineComponent({
},

methods: {
...mapActions('websocket', ['sendMessage'])
...mapActions('websocket', ['sendMessage']),

toggleLander() {
this.landerAlignEnabled = !this.landerAlignEnabled;
if(this.landerAlignEnabled) this.sendMessage({"type": "start_lander_align"});
else this.sendMessage({"type": "stop_lander_align"});
}
},

beforeUnmount: function () {
Expand Down
53 changes: 53 additions & 0 deletions src/teleoperation/lander_align/ClientDummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
import rospkg
import actionlib

import os

# python linear algebra library
import numpy as np

# library for interacting with ROS and TF tree
import rospy
import mrover

from mrover.msg import LanderAlignAction
from mrover.msg import LanderAlignGoal


class ClientDummy:
def __init__(self):
self.landerClient = actionlib.SimpleActionClient('LanderAlignAction', LanderAlignAction)
self.landerClient.wait_for_server()
print("finished init")


def start_lander_align(self) -> None:
print("start")
goal = LanderAlignGoal()
self.landerClient.send_goal(goal)
print("finished start")
pass

def stop_lander_align(self) -> None:
print("stop")
self.landerClient.cancel_goal()
pass



def main():
# initialize the node
rospy.init_node("ClientDummy")
dummy = ClientDummy()

dummy.start_lander_align()
rospy.sleep(4)
dummy.stop_lander_align()

# let the callback functions run asynchronously in the background
rospy.spin()


if __name__ == "__main__":
main()
Loading