Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
winterhalderp | 41d1ea87ad | |
Christopher Herr | 7b55f1e325 | |
Christopher Herr | 3d0fb1ef73 | |
Christopher Herr | f36c5f5424 |
|
@ -4,22 +4,43 @@
|
||||||
# Only the password was changed after first boot
|
# Only the password was changed after first boot
|
||||||
# Everything else is stock
|
# Everything else is stock
|
||||||
|
|
||||||
# First Update
|
## Reference / Source:
|
||||||
|
# https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html
|
||||||
|
|
||||||
|
## First Update
|
||||||
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
|
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
|
||||||
|
|
||||||
# Install ROS2 Foxy Fitzroy Desktop
|
### Install ROS2 Foxy Fitzroy for Raspberry Pi
|
||||||
sudo apt update && sudo apt install locales
|
|
||||||
|
## Check for UTF-8
|
||||||
|
locale # check for UTF-8
|
||||||
|
sudo apt install locales
|
||||||
sudo locale-gen en_US en_US.UTF-8
|
sudo locale-gen en_US en_US.UTF-8
|
||||||
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
|
||||||
sudo apt update && sudo apt install -y curl gnupg2 lsb-release
|
export LANG=en_US.UTF-8
|
||||||
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
|
locale # verify settings
|
||||||
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
|
|
||||||
sudo apt update && sudo apt install -y ros-foxy-ros-base
|
## Setup Sources
|
||||||
|
sudo apt install software-properties-common
|
||||||
|
sudo add-apt-repository universe
|
||||||
|
|
||||||
|
sudo apt update && sudo apt install curl
|
||||||
|
sudo apt install -y curl gnupg2 lsb-release
|
||||||
|
|
||||||
|
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
|
||||||
|
# OLD: curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
|
||||||
|
# OLD: sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
|
||||||
|
|
||||||
|
|
||||||
|
## Install ROS2
|
||||||
|
sudo apt-get update && sudo apt-get upgrade -y
|
||||||
|
sudo apt install -y ros-foxy-ros-base
|
||||||
source /opt/ros/foxy/setup.bash
|
source /opt/ros/foxy/setup.bash
|
||||||
# Check to see if installed correctly
|
# Check to see if installed correctly
|
||||||
echo "ROS_VERSION: "$ROS_VERSION
|
echo "ROS_VERSION: "$ROS_VERSION
|
||||||
|
|
||||||
|
## Install other Tools
|
||||||
# Install rosdep
|
# Install rosdep
|
||||||
sudo apt install -y python3-rosdep2
|
sudo apt install -y python3-rosdep2
|
||||||
rosdep update
|
rosdep update
|
||||||
|
@ -44,7 +65,6 @@ cd colcon_ws
|
||||||
colcon build
|
colcon build
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Install network tools
|
# Install network tools
|
||||||
sudo apt install -y wireless-tools
|
sudo apt install -y wireless-tools
|
||||||
|
|
||||||
|
@ -52,16 +72,16 @@ sudo apt install -y wireless-tools
|
||||||
# Install Git
|
# Install Git
|
||||||
sudo apt install -y git
|
sudo apt install -y git
|
||||||
|
|
||||||
|
|
||||||
# Setup remote git from inside workspace
|
# Setup remote git from inside workspace
|
||||||
cd ~/colcon_ws
|
cd ~/colcon_ws
|
||||||
git init
|
git init
|
||||||
|
|
||||||
|
|
||||||
# Change the URL to your Git repository
|
# Change the URL to your Git repository
|
||||||
git remote add origin https://egit.irs.uni-stuttgart.de/RoverLehre/ROS2_pubsub.git
|
git remote add origin https://egit.irs.uni-stuttgart.de/RoverLehre/ROS2_pubsub.git
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git reset --hard origin/master
|
git reset --hard origin/master
|
||||||
|
|
||||||
|
|
||||||
# Install your project specific python packages
|
# Install your project specific python packages
|
||||||
# You can use pip3 as the install tool, eg:
|
# You can use pip3 as the install tool, eg:
|
||||||
pip3 install python-can
|
pip3 install python-can
|
||||||
|
|
|
@ -37,6 +37,12 @@ rosidl_generate_interfaces(${PROJECT_NAME}
|
||||||
"msg/CustomMsg2.msg"
|
"msg/CustomMsg2.msg"
|
||||||
"srv/CustomSrv1.srv"
|
"srv/CustomSrv1.srv"
|
||||||
"srv/StateMachineSrv.srv"
|
"srv/StateMachineSrv.srv"
|
||||||
|
"srv/InclineControlSRV.srv"
|
||||||
|
"srv/MosfetControlSRV.srv"
|
||||||
|
"srv/PitchControlSRV.srv"
|
||||||
|
"srv/RotationControlSRV.srv"
|
||||||
|
"srv/SensorSRV.srv"
|
||||||
|
"srv/WatchdogSRV.srv"
|
||||||
DEPENDENCIES builtin_interfaces
|
DEPENDENCIES builtin_interfaces
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
int32 incline
|
||||||
|
bool store
|
||||||
|
bool elevate
|
||||||
|
bool upright
|
||||||
|
---
|
||||||
|
bool success
|
|
@ -0,0 +1,3 @@
|
||||||
|
bool command
|
||||||
|
---
|
||||||
|
bool success
|
|
@ -0,0 +1,11 @@
|
||||||
|
int32 degree
|
||||||
|
uint32 speed
|
||||||
|
bool status
|
||||||
|
---
|
||||||
|
bool success
|
||||||
|
string error
|
||||||
|
int32 present_position
|
||||||
|
int32 present_load
|
||||||
|
int32 present_temp
|
||||||
|
uint32 present_v
|
||||||
|
int32 up_cali
|
|
@ -0,0 +1,7 @@
|
||||||
|
bool abs
|
||||||
|
int32 degree
|
||||||
|
int32 local_degree
|
||||||
|
string center
|
||||||
|
---
|
||||||
|
bool success
|
||||||
|
int32 present_pos
|
|
@ -0,0 +1,3 @@
|
||||||
|
bool triggered
|
||||||
|
---
|
||||||
|
bool success
|
|
@ -0,0 +1,3 @@
|
||||||
|
string node_name
|
||||||
|
---
|
||||||
|
string node_name
|
Binary file not shown.
|
@ -246,7 +246,7 @@ class MinimalActionServer(Node):
|
||||||
* act_callback_input: action callback function
|
* act_callback_input: action callback function
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
*
|
*
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, NODE_NAME, ACT_NAME, ACT_TYPE, act_callback_input=None):
|
def __init__(self, NODE_NAME, ACT_NAME, ACT_TYPE, act_callback_input=None):
|
||||||
|
@ -258,19 +258,19 @@ class MinimalActionServer(Node):
|
||||||
self.execute_callback= self.std_act_callback
|
self.execute_callback= self.std_act_callback
|
||||||
else:
|
else:
|
||||||
self.execute_callback = act_callback_input
|
self.execute_callback = act_callback_input
|
||||||
|
|
||||||
# Init above laying class "Node" (super class)
|
# Init above laying class "Node" (super class)
|
||||||
super().__init__(self.NODE_NAME)
|
super().__init__(self.NODE_NAME)
|
||||||
print("\tStarting Action Server:\t%s"%(self.ACT_NAME))
|
print("\tStarting Action Server:\t%s"%(self.ACT_NAME))
|
||||||
self._action_server = ActionServer(self, self.ACT_TYPE, self.ACT_NAME, self.execute_callback)
|
self._action_server = ActionServer(self, self.ACT_TYPE, self.ACT_NAME, self.execute_callback)
|
||||||
|
|
||||||
|
|
||||||
# standard action callback
|
# standard action callback
|
||||||
def std_act_callback(self, goal_handle):
|
def std_act_callback(self, goal_handle):
|
||||||
""" Standard Action Callback Method
|
""" Standard Action Callback Method
|
||||||
|
|
||||||
Replace this method by inputting a custom callback method using 'act_callback_input'.
|
Replace this method by inputting a custom callback method using 'act_callback_input'.
|
||||||
This method MUST return a variable of the type 'action result',
|
This method MUST return a variable of the type 'action result',
|
||||||
eg. result = ACTION_TYPE.Result()
|
eg. result = ACTION_TYPE.Result()
|
||||||
"""
|
"""
|
||||||
self.get_logger().info('Executing goal...')
|
self.get_logger().info('Executing goal...')
|
||||||
|
@ -280,7 +280,7 @@ class MinimalActionServer(Node):
|
||||||
#################
|
#################
|
||||||
result = self.ACT_TYPE.Result()
|
result = self.ACT_TYPE.Result()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
#******************************************************************************#
|
#******************************************************************************#
|
||||||
|
|
||||||
class MinimalActionClient(Node):
|
class MinimalActionClient(Node):
|
||||||
|
@ -292,21 +292,21 @@ class MinimalActionClient(Node):
|
||||||
* act_callback_input: action callback function
|
* act_callback_input: action callback function
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
*
|
*
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, NODE_NAME, ACT_NAME, ACT_TYPE, act_callback_input=None):
|
def __init__(self, NODE_NAME, ACT_NAME, ACT_TYPE, act_callback_input=None):
|
||||||
self.NODE_NAME = NODE_NAME
|
self.NODE_NAME = NODE_NAME
|
||||||
self.ACT_NAME = ACT_NAME
|
self.ACT_NAME = ACT_NAME
|
||||||
self.ACT_TYPE = ACT_TYPE
|
self.ACT_TYPE = ACT_TYPE
|
||||||
|
|
||||||
# Init above laying class "Node" (super class)
|
# Init above laying class "Node" (super class)
|
||||||
super().__init__(self.NODE_NAME)
|
super().__init__(self.NODE_NAME)
|
||||||
print("\tStarting Action Client for:\t%s"%(self.ACT_NAME))
|
print("\tStarting Action Client for:\t%s"%(self.ACT_NAME))
|
||||||
self._action_client = ActionClient(self, self.ACT_TYPE, self.ACT_NAME)
|
self._action_client = ActionClient(self, self.ACT_TYPE, self.ACT_NAME)
|
||||||
|
|
||||||
def send_goal(self, input):
|
def send_goal(self, input):
|
||||||
return
|
return
|
||||||
|
|
||||||
def abort_goal(self):
|
def abort_goal(self):
|
||||||
return
|
return
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue