-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added skeleton for label image drawer * WIP Added a labels_manager * Added label navigation to frontend * Added sync between labels stored by label_manager and frontend * Added label addition and move to frontend * Added label editing to frontend * Remove unrequired rependency * Updated dependency
- Loading branch information
1 parent
1661561
commit 6e3e758
Showing
28 changed files
with
804 additions
and
189 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 |
---|---|---|
|
@@ -2,73 +2,70 @@ name: pull-request-audit | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
|
||
pull_request: | ||
branches: [ main ] | ||
branches: [main] | ||
|
||
workflow_dispatch: | ||
branches: [ main ] | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
path: catkin_ws/src/opentera-webrtc-ros | ||
- uses: ros-tooling/[email protected] | ||
with: | ||
required-ros-distributions: noetic | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install nodejs ros-noetic-turtlebot3 ros-noetic-turtlebot3-gazebo ros-noetic-dwa-local-planner ros-noetic-rtabmap-ros | ||
sudo apt-get install libglib2.0-dev libgtk-3-dev libpulse-dev libasound2-dev | ||
sudo apt-get install python3-pip portaudio19-dev | ||
sudo apt-get install nodejs npm | ||
sudo apt-get install build-essential gfortran texinfo libasound2-dev | ||
- name: Clone audio_utils in ROS workspace | ||
working-directory: catkin_ws/src | ||
run: | | ||
source /opt/ros/noetic/setup.bash | ||
git clone https://github.com/introlab/audio_utils.git --recurse-submodules | ||
ls -l | ||
- name: Install Python requirements for OpenTera client | ||
working-directory: catkin_ws/src/opentera-webrtc-ros/opentera_client_ros | ||
run: | | ||
ls -l | ||
python3 -m pip install -r requirements.txt | ||
- name: Install Python requirements for Signaling server | ||
working-directory: catkin_ws/src/opentera-webrtc-ros/opentera_webrtc_ros/opentera-webrtc/signaling-server | ||
run: | | ||
ls -l | ||
python3 -m pip install -r requirements.txt | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
path: catkin_ws/src/opentera-webrtc-ros | ||
- uses: ros-tooling/[email protected] | ||
with: | ||
required-ros-distributions: noetic | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14" | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install nodejs ros-noetic-turtlebot3 ros-noetic-turtlebot3-gazebo ros-noetic-dwa-local-planner ros-noetic-rtabmap-ros | ||
sudo apt-get install libglib2.0-dev libgtk-3-dev libpulse-dev libasound2-dev | ||
sudo apt-get install python3-pip portaudio19-dev | ||
sudo apt-get install nodejs npm | ||
sudo apt-get install build-essential gfortran texinfo libasound2-dev | ||
- name: Clone audio_utils in ROS workspace | ||
working-directory: catkin_ws/src | ||
run: | | ||
source /opt/ros/noetic/setup.bash | ||
git clone https://github.com/introlab/audio_utils.git --recurse-submodules | ||
ls -l | ||
- name: Install Python requirements for OpenTera client | ||
working-directory: catkin_ws/src/opentera-webrtc-ros/opentera_client_ros | ||
run: | | ||
ls -l | ||
python3 -m pip install -r requirements.txt | ||
- name: Install the VUE.js frontend | ||
working-directory: catkin_ws/src/opentera-webrtc-ros/opentera_webrtc_demos/opentera-webrtc-teleop-frontend/teleop-vue | ||
run: | | ||
ls -l | ||
npm --version | ||
node --version | ||
npm install | ||
npm run build | ||
- name: Compile packages in ROS workspace | ||
working-directory: catkin_ws | ||
run: | | ||
source /opt/ros/noetic/setup.bash | ||
catkin_make -j1 | ||
- name: Install Python requirements for Signaling server | ||
working-directory: catkin_ws/src/opentera-webrtc-ros/opentera_webrtc_ros/opentera-webrtc/signaling-server | ||
run: | | ||
ls -l | ||
python3 -m pip install -r requirements.txt | ||
- name: Install the VUE.js frontend | ||
working-directory: catkin_ws/src/opentera-webrtc-ros/opentera_webrtc_demos/opentera-webrtc-teleop-frontend/teleop-vue | ||
run: | | ||
ls -l | ||
npm --version | ||
node --version | ||
npm install | ||
npm run build | ||
- name: Compile packages in ROS workspace | ||
working-directory: catkin_ws | ||
run: | | ||
source /opt/ros/noetic/setup.bash | ||
catkin_make -j1 |
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 |
---|---|---|
|
@@ -30,3 +30,7 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# Compiled Python | ||
__pycache__ | ||
*.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
32 changes: 32 additions & 0 deletions
32
map_image_generator/include/map_image_generator/drawers/LabelImageDrawer.h
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 @@ | ||
#ifndef LABEL_IMAGE_DRAWER_H | ||
#define LABEL_IMAGE_DRAWER_H | ||
|
||
#include "map_image_generator/drawers/ImageDrawer.h" | ||
|
||
#include <opentera_webrtc_ros_msgs/Label.h> | ||
#include <opentera_webrtc_ros_msgs/LabelArray.h> | ||
#include <ros/ros.h> | ||
|
||
namespace map_image_generator | ||
{ | ||
class LabelImageDrawer : public ImageDrawer | ||
{ | ||
ros::Subscriber m_labelArraySubscriber; | ||
opentera_webrtc_ros_msgs::LabelArray::ConstPtr m_lastLabelArray; | ||
|
||
public: | ||
LabelImageDrawer(const Parameters& parameters, ros::NodeHandle& nodeHandle, | ||
tf::TransformListener& tfListener); | ||
~LabelImageDrawer() override; | ||
|
||
void draw(cv::Mat& image) override; | ||
|
||
private: | ||
void drawLabel(const opentera_webrtc_ros_msgs::Label& label, cv::Mat& image, | ||
tf::Transform& transform); | ||
|
||
void labelArrayCallback( | ||
const opentera_webrtc_ros_msgs::LabelArray::ConstPtr& labelArray); | ||
}; | ||
} | ||
#endif |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include "map_image_generator/drawers/LabelImageDrawer.h" | ||
|
||
#include <opencv2/imgproc.hpp> | ||
|
||
using namespace map_image_generator; | ||
|
||
LabelImageDrawer::LabelImageDrawer(const Parameters& parameters, | ||
ros::NodeHandle& nodeHandle, | ||
tf::TransformListener& tfListener) | ||
: ImageDrawer(parameters, nodeHandle, tfListener), | ||
m_labelArraySubscriber{m_nodeHandle.subscribe( | ||
"stored_labels", 1, &LabelImageDrawer::labelArrayCallback, this)} | ||
{ | ||
} | ||
|
||
LabelImageDrawer::~LabelImageDrawer() = default; | ||
|
||
void LabelImageDrawer::labelArrayCallback( | ||
const opentera_webrtc_ros_msgs::LabelArray::ConstPtr& labelArray) | ||
{ | ||
m_lastLabelArray = labelArray; | ||
} | ||
|
||
|
||
void LabelImageDrawer::draw(cv::Mat& image) | ||
{ | ||
if (!m_lastLabelArray) | ||
{ | ||
return; | ||
} | ||
|
||
for (const auto& label : m_lastLabelArray->labels) | ||
{ | ||
auto tf = getTransformInRef(label.pose.header.frame_id); | ||
if (tf) | ||
{ | ||
drawLabel(label, image, *tf); | ||
} | ||
} | ||
} | ||
|
||
void LabelImageDrawer::drawLabel(const opentera_webrtc_ros_msgs::Label& label, | ||
cv::Mat& image, tf::Transform& transform) | ||
{ | ||
const cv::Scalar& color = m_parameters.labelColor(); | ||
int size = m_parameters.labelSize(); | ||
|
||
tf::Pose labelPose; | ||
tf::poseMsgToTF(label.pose.pose, labelPose); | ||
labelPose = transform * labelPose; | ||
adjustTransformForRobotRef(labelPose); | ||
double yaw = tf::getYaw(labelPose.getRotation()); | ||
|
||
int startX, startY; | ||
convertTransformToMapCoordinates(labelPose, startX, startY); | ||
|
||
int endX = static_cast<int>(startX + size * cos(yaw)); | ||
int endY = static_cast<int>(startY + size * sin(yaw)); | ||
|
||
cv::drawMarker(image, cv::Point(startX, startY), color, cv::MARKER_DIAMOND, | ||
static_cast<int>(ceil(size / 4.0)), | ||
static_cast<int>(ceil(size / 12.0)), cv::FILLED); | ||
cv::putText(image, label.name, cv::Point(startX, startY), cv::FONT_HERSHEY_DUPLEX, | ||
0.5, m_parameters.textColor(), 1); | ||
} |
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
Submodule opentera-webrtc-teleop-frontend
updated
18 files
Oops, something went wrong.