Skip to content

Commit

Permalink
Merge pull request #18 from ROBOTIS-GIT/master
Browse files Browse the repository at this point in the history
merge for sync kinetic-devel and master branch
  • Loading branch information
robotpilot authored Apr 19, 2018
2 parents 21980c5 + bed48d0 commit e101b4d
Show file tree
Hide file tree
Showing 35 changed files with 493 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ROBOTIS OP3
# ROBOTIS OP3
<img src="https://github.com/ROBOTIS-GIT/emanual/blob/master/assets/images/platform/op3/default_op3.jpg" width="40%" />

## ROS Packages for ROBOTIS OP3 Demo
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(ball_detector)
project(op3_ball_detector)

################################################################################
# Find catkin packages and libraries for catkin and system dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
PACKAGE='ball_detector'
PACKAGE='op3_ball_detector'

from dynamic_reconfigure.parameter_generator_catkin import *

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
PACKAGE='ball_detector'
PACKAGE='op3_ball_detector'

from dynamic_reconfigure.parameter_generator_catkin import *

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
PACKAGE='ball_detector'
PACKAGE='op3_ball_detector'

from dynamic_reconfigure.parameter_generator_catkin import *

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@
#include <boost/thread.hpp>
#include <yaml-cpp/yaml.h>

#include "ball_detector/DetectorParamsConfig.h"
#include "op3_ball_detector/ball_detector_config.h"

#include "ball_detector/ball_detector_config.h"

#include "ball_detector/CircleSetStamped.h"
#include "ball_detector/GetParameters.h"
#include "ball_detector/SetParameters.h"
#include "op3_ball_detector/DetectorParamsConfig.h"
#include "op3_ball_detector/CircleSetStamped.h"
#include "op3_ball_detector/GetParameters.h"
#include "op3_ball_detector/SetParameters.h"

namespace robotis_op
{
Expand Down Expand Up @@ -74,12 +73,12 @@ class BallDetector
//callbacks to camera info subscription
void cameraInfoCallback(const sensor_msgs::CameraInfo & msg);

void dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level);
void dynParamCallback(op3_ball_detector::DetectorParamsConfig &config, uint32_t level);
void enableCallback(const std_msgs::Bool::ConstPtr &msg);

void paramCommandCallback(const std_msgs::String::ConstPtr &msg);
bool setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res);
bool getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res);
bool setParamCallback(op3_ball_detector::SetParameters::Request &req, op3_ball_detector::SetParameters::Response &res);
bool getParamCallback(op3_ball_detector::GetParameters::Request &req, op3_ball_detector::GetParameters::Response &res);
void resetParameter();
void publishParam();

Expand Down Expand Up @@ -115,7 +114,7 @@ class BallDetector
int not_found_count_;

//circle set publisher
ball_detector::CircleSetStamped circles_msg_;
op3_ball_detector::CircleSetStamped circles_msg_;
ros::Publisher circles_pub_;

//camera info subscriber
Expand Down Expand Up @@ -157,8 +156,8 @@ class BallDetector
cv::Mat in_image_;
cv::Mat out_image_;

dynamic_reconfigure::Server<ball_detector::DetectorParamsConfig> param_server_;
dynamic_reconfigure::Server<ball_detector::DetectorParamsConfig>::CallbackType callback_fnc_;
dynamic_reconfigure::Server<op3_ball_detector::DetectorParamsConfig> param_server_;
dynamic_reconfigure::Server<op3_ball_detector::DetectorParamsConfig>::CallbackType callback_fnc_;
};

} // namespace robotis_op
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<launch>
<arg name="config_path" default="$(find ball_detector)/config/ball_detector_params.yaml"/>
<arg name="config_path" default="$(find op3_ball_detector)/config/ball_detector_params.yaml"/>

<!-- ball detector -->
<node pkg="ball_detector" type="ball_detector_node" name="ball_detector_node" args="" output="screen">
<node pkg="op3_ball_detector" type="ball_detector_node" name="ball_detector_node" args="" output="screen">
<rosparam command="load" file="$(arg config_path)"/>
<param name="yaml_path" type="string" value="$(arg config_path)"/>
<remap from="/ball_detector_node/image_in" to="/usb_cam_node/image_raw" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
</node>

<!-- ball detector -->
<include file="$(find ball_detector)/launch/ball_detector.launch" />
<include file="$(find op3_ball_detector)/launch/ball_detector.launch" />
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
<!-- <param name="white_balance_temperature" value="2800" /> -->

<!-- ball detector -->
<include file="$(find ball_detector)/launch/ball_detector.launch" />
<include file="$(find op3_ball_detector)/launch/ball_detector.launch" />
</launch>

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<package format="2">
<name>ball_detector</name>
<name>op3_ball_detector</name>
<version>0.1.0</version>
<description>
This package implements a circle-like shape detector of the input image.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <fstream>

#include "ball_detector/ball_detector.h"
#include "op3_ball_detector/ball_detector.h"

namespace robotis_op
{
Expand Down Expand Up @@ -71,7 +71,7 @@ BallDetector::BallDetector()

//sets publishers
image_pub_ = it_.advertise("image_out", 100);
circles_pub_ = nh_.advertise<ball_detector::CircleSetStamped>("circle_set", 100);
circles_pub_ = nh_.advertise<op3_ball_detector::CircleSetStamped>("circle_set", 100);
camera_info_pub_ = nh_.advertise<sensor_msgs::CameraInfo>("camera_info", 100);

//sets subscribers
Expand All @@ -87,7 +87,7 @@ BallDetector::BallDetector()
param_server_.setCallback(callback_fnc_);

// web setting
param_pub_ = nh_.advertise<ball_detector::BallDetectorParams>("current_params", 1);
param_pub_ = nh_.advertise<op3_ball_detector::BallDetectorParams>("current_params", 1);
param_command_sub_ = nh_.subscribe("param_command", 1, &BallDetector::paramCommandCallback, this);
set_param_client_ = nh_.advertiseService("set_param", &BallDetector::setParamCallback, this);
get_param_client_ = nh_.advertiseService("get_param", &BallDetector::getParamCallback, this);
Expand Down Expand Up @@ -233,7 +233,7 @@ void BallDetector::imageCallback(const sensor_msgs::ImageConstPtr & msg)
return;
}

void BallDetector::dynParamCallback(ball_detector::DetectorParamsConfig &config, uint32_t level)
void BallDetector::dynParamCallback(op3_ball_detector::DetectorParamsConfig &config, uint32_t level)
{
params_config_.gaussian_blur_size = config.gaussian_blur_size;
params_config_.gaussian_blur_sigma = config.gaussian_blur_sigma;
Expand Down Expand Up @@ -296,7 +296,7 @@ void BallDetector::paramCommandCallback(const std_msgs::String::ConstPtr &msg)
}
}

bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req, ball_detector::SetParameters::Response &res)
bool BallDetector::setParamCallback(op3_ball_detector::SetParameters::Request &req, op3_ball_detector::SetParameters::Response &res)
{
params_config_.gaussian_blur_size = req.params.gaussian_blur_size;
params_config_.gaussian_blur_sigma = req.params.gaussian_blur_sigma;
Expand All @@ -321,7 +321,7 @@ bool BallDetector::setParamCallback(ball_detector::SetParameters::Request &req,
return true;
}

bool BallDetector:: getParamCallback(ball_detector::GetParameters::Request &req, ball_detector::GetParameters::Response &res)
bool BallDetector:: getParamCallback(op3_ball_detector::GetParameters::Request &req, op3_ball_detector::GetParameters::Response &res)
{
res.returns.gaussian_blur_size = params_config_.gaussian_blur_size;
res.returns.gaussian_blur_sigma = params_config_.gaussian_blur_sigma;
Expand Down Expand Up @@ -396,7 +396,7 @@ void BallDetector::resetParameter()

void BallDetector::publishParam()
{
ball_detector::BallDetectorParams params;
op3_ball_detector::BallDetectorParams params;

params.gaussian_blur_size = params_config_.gaussian_blur_size;
params.gaussian_blur_sigma = params_config_.gaussian_blur_sigma;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* Author: Kayman Jung */

#include "ball_detector/ball_detector.h"
#include "op3_ball_detector/ball_detector.h"

//node main
int main(int argc, char **argv)
Expand Down
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions op3_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
################################################################################
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(op3_bringup)

################################################################################
# Find catkin packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED)

################################################################################
# Setup for python modules and scripts
################################################################################

################################################################################
# Declare ROS messages, services and actions
################################################################################

################################################################################
# Declare ROS dynamic reconfigure parameters
################################################################################

################################################################################
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package()

################################################################################
# Build
################################################################################

################################################################################
# Install
################################################################################
install(DIRECTORY launch rviz
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

################################################################################
# Test
################################################################################
15 changes: 15 additions & 0 deletions op3_bringup/launch/op3_bringup.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" ?>
<launch>
<!-- OP3 Manager -->
<include file="$(find op3_manager)/launch/op3_manager.launch" />

<!-- UVC camera -->
<node pkg="usb_cam" type="usb_cam_node" name="usb_cam_node" output="screen">
<param name="video_device" type="string" value="/dev/video0" />
<param name="image_width" type="int" value="1280" />
<param name="image_height" type="int" value="720" />
<param name="framerate " type="int" value="30" />
<param name="camera_frame_id" type="string" value="cam_link" />
<param name="camera_name" type="string" value="camera" />
</node>
</launch>
18 changes: 18 additions & 0 deletions op3_bringup/launch/op3_bringup_visualization.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" ?>
<launch>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find op3_description)/urdf/robotis_op3.urdf.xacro'"/>

<!-- Send fake joint values and monitoring present joint angle -->
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
<param name="use_gui" value="TRUE"/>
<rosparam param="/source_list">[/robotis/present_joint_states]</rosparam>
</node>

<!-- Combine joint values -->
<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
<remap from="/joint_states" to="/robotis/present_joint_states" />
</node>

<!-- Show in Rviz -->
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find op3_bringup)/rviz/op3_bringup.rviz"/>
</launch>
22 changes: 22 additions & 0 deletions op3_bringup/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package format="2">
<name>op3_bringup</name>
<version>0.0.1</version>
<description>
This package is a demo for first time users.
There is an example in the demo where you can run and visualize the robot.
</description>
<license>Apache 2.0</license>
<author email="kmjung@robotis.com">Kayman</author>
<maintainer email="pyo@robotis.com">Pyo</maintainer>
<url type="website">http://wiki.ros.org/op3_bringup</url>
<url type="emanual">http://emanual.robotis.com/docs/en/platform/op3/introduction/</url>
<url type="repository">https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo</url>
<url type="bugtracker">https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo/issues</url>
<buildtool_depend>catkin</buildtool_depend>
<exec_depend>op3_manager</exec_depend>
<exec_depend>usb_cam</exec_depend>
<exec_depend>joint_state_publisher</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>rviz</exec_depend>
</package>
Loading

0 comments on commit e101b4d

Please sign in to comment.