-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
156 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
<<<<<<< HEAD | ||
======= | ||
*.gch | ||
>>>>>>> serial_fix | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<launch> | ||
|
||
<rosparam command="load" file="$(find crawler)/config/crawler_behaviors.yaml" /> | ||
<node pkg="state_controller" type="MainState" name="mainstate" output="screen"/> | ||
<include file="$(find state_controller)/launch/mainstate.launch" /> | ||
<node name="convert_to_ackermann" pkg="crawler" type="ConvertToAckermann.py"/> | ||
|
||
</launch> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
|
||
def mapPrecise(x, inMin, inMax, outMin, outMax): | ||
# Emulates Arduino map() function, but uses floats for precision | ||
return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; | ||
|
||
def cmd2msg(c_in, c_range, m_range): | ||
# Given command, command range, and msg range, returns corresponding msg | ||
m_out = 0 | ||
|
||
# Unpack range values for clarity | ||
c_low = c_range[0] | ||
c_mid = c_range[1] | ||
c_hi = c_range[2] | ||
m_low = m_range[0] | ||
m_mid = m_range[1] | ||
m_hi = m_range[2] | ||
|
||
# Convert from input command to output message | ||
if c_low < c_hi: # Ensure correct direction of comparison - is c_high < c_low? | ||
if c_in < c_mid: m_out = mapPrecise(c_in, c_low, c_mid, m_low, m_mid) | ||
elif c_in > c_mid: m_out = mapPrecise(c_in, c_mid, c_hi, m_mid, m_hi) | ||
else: m_out = m_mid | ||
elif c_low > c_hi: | ||
if c_in > c_mid: m_out = mapPrecise(c_in, c_low, c_mid, m_low, m_mid) | ||
elif c_in < c_mid: m_out = mapPrecise(c_in, c_mid, c_hi, m_mid, m_hi) | ||
else: m_out = m_mid | ||
|
||
return m_out | ||
|
||
def msg2cmd(m_in, m_range, c_range): | ||
pass |
Oops, something went wrong.