Skip to content

Commit

Permalink
Merge pull request #12 from tlk-emb/revert_workspace
Browse files Browse the repository at this point in the history
Revert workspace
  • Loading branch information
takasehideki authored Jul 29, 2019
2 parents 772d8f0 + ad3a040 commit 221da21
Show file tree
Hide file tree
Showing 59 changed files with 121 additions and 227 deletions.
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
*.bin
*.history

# for ROS catkin_ws
ros_catkin_ws/.catkin_workspace
ros_catkin_ws/build
ros_catkin_ws/devel
ros_catkin_ws/src/CMakeLists.txt

# for TrueSTUDIO
workspace/.metadata/
workspace/*/.metadata/
workspace/*/.settings/language.settings.xml
mros_ws/.metadata/
mros_ws/*/.metadata/
mros_ws/*/.settings/language.settings.xml

# for ASP
asp
Expand Down
2 changes: 1 addition & 1 deletion workspace/Makefile.asp → mros_ws/Makefile.asp
Original file line number Diff line number Diff line change
Expand Up @@ -654,4 +654,4 @@ $(APPL_ASMOBJS:.o=.d): %.d: %.S
genmsg:
ifeq ($(GEN_MSG),true)
$(PYTHON) $(MROS_DIR)/../mros_msg-gen/mros_msg-gen.py $(MSG_SETTING_JSON)
endif
endif
File renamed without changes.
File renamed without changes.
12 changes: 5 additions & 7 deletions workspace/Makefile.mros → mros_ws/Makefile.mros
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ MROS_LIB = libmros
ALL_MROS_OBJ = $(MROS_C_OBJ) $(MROS_CXX_OBJ)


.PHONY: all clean genmsg
.PHONY: all clean

all: $(MROS_LIB).a
all: genmsg $(MROS_LIB).a
#clean:
# rm -f $(MROS_LIB).lib $(ALL_MROS_OBJ) $(DEPS)

Expand All @@ -17,7 +17,7 @@ $(MROS_CXX_OBJ:.o=.s): %.s: %.cpp
$(CPP) -S $(CFLAGS) $(APPL_CXXFLAGS) $(MROS_INCLUDE_PATHS) -o $@ $<
endif

$(MROS_LIB).a: genmsg $(ALL_MROS_OBJ)
$(MROS_LIB).a: $(ALL_MROS_OBJ)
rm -f $(MROS_LIB).a
$(AR) -rcs $(MROS_LIB).a $(ALL_MROS_OBJ)
$(RANLIB) $(MROS_LIB).a
Expand All @@ -28,14 +28,12 @@ DEPS += $(ALL_MROS_OBJ:.o=.d)
APPL_LIBS = $(MROS_LIB).a libmbed.a

INCLUDES += $(MROS_INCLUDE_PATHS) # MROSライブラリのヘッダファイルをアプリで使う
INCLUDES += -I$(MROS_DIR)/../workspace/$(APPNAME)/include
INCLUDES += -I$(MROS_DIR)/../mros_ws/$(APPNAME)/include
INCLUDES += -I$(MROS_DIR)/mros-msgs
# INCLUDES += -I/opt/ros/kinetic/include -I/usr/include -I/usr/include/x86_64-linux-gnu -I/usr/include/i386-linux-gnu

genmsg:
ifneq ($(USE_TRUESTUDIO),true)
genmsg: $(MSG_SETTING_JSON)
ifeq ($(GEN_MSG),true)
$(PYTHON) $(MROS_DIR)/../mros_msg-gen/mros_msg-gen.py $(MSG_SETTING_JSON)
echo "message generated"
endif
endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions workspace/msg_app/Makefile → mros_ws/custom_pubsub/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ all:
#
# アプリケーションファイル
#
APPNAME = msg_app
APPLDIR = msg_app
APPNAME = custom_pubsub
APPLDIR = custom_pubsub
APPLNAME = app
USE_CXX = true
APPL_CFG = $(APPLNAME).cfg
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions workspace/msg_app/app.cpp → mros_ws/custom_pubsub/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "mbed.h"
#include "EthernetInterface.h"
#include "SoftPWM.h"
#include "mros_test/UserTypeTest.h"
#include "custom_pubsub/UserTypeTest.h"

//pin assign
static DigitalOut ledu(P6_12); // LED-User
Expand Down Expand Up @@ -50,7 +50,7 @@ void init(void){
}

/*****mROS user task code*******/
static mros_test::UserTypeTest pubMsg;
static custom_pubsub::UserTypeTest pubMsg;
void usr_task1(){
#ifndef _USR_TASK_1_
#define _USR_TASK_1_
Expand All @@ -61,7 +61,7 @@ void usr_task1(){
ros::init(argc,argv,"mros_node");
ros::NodeHandle n;
//ros::Publisher chatter_pub = n.advertise<std_msgs::String>("mros_msg",1);
ros::Publisher chatter_pub = n.advertise<mros_test::UserTypeTest>("mros_msg",1);
ros::Publisher chatter_pub = n.advertise<custom_pubsub::UserTypeTest>("mros_msg",1);
ros::Rate loop_rate(5);
pubMsg.nameVal.firstName="Charlie";
pubMsg.nameVal.lastName="Parker";
Expand Down Expand Up @@ -118,7 +118,7 @@ void LED_switch(string *msg){
}
*/
/******* callback **********/
void Callback(mros_test::UserTypeTest *msg){
void Callback(custom_pubsub::UserTypeTest *msg){
//LED_switch(msg);
ROS_INFO("I hear msgs from ros host");
string name = msg->nameVal.firstName + " " + msg->nameVal.lastName;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef _MROS_TEST_LEDVALUES_H
#define _MROS_TEST_LEDVALUES_H
#ifndef _CUSTOM_PUBSUB_LEDVALUES_H
#define _CUSTOM_PUBSUB_LEDVALUES_H




static const int LEDVALUES_MSG_ID = 101;

namespace mros_test{
namespace custom_pubsub{
class LEDValues{
public:
float red;
Expand Down Expand Up @@ -61,17 +61,17 @@ struct MD5Sum<LEDVALUES_MSG_ID>
};

template<>
struct DataType<mros_test::LEDValues*>
struct DataType<custom_pubsub::LEDValues*>
{
static const char* value()
{
return "mros_test/LEDValues";
return "custom_pubsub/LEDValues";
}

};

template<>
struct DataTypeId<mros_test::LEDValues*>
struct DataTypeId<custom_pubsub::LEDValues*>
{
static const int value()
{
Expand All @@ -81,7 +81,7 @@ struct DataTypeId<mros_test::LEDValues*>
};

template<>
struct Definition<mros_test::LEDValues*>
struct Definition<custom_pubsub::LEDValues*>
{
static const char* value()
{
Expand All @@ -99,7 +99,7 @@ namespace subtask_methods
struct CallCallbackFuncs<LEDVALUES_MSG_ID>{
static void call(void (*fp)(intptr_t), char *rbuf)
{
mros_test::LEDValues msg;
custom_pubsub::LEDValues msg;
rbuf += 4;
msg.deserialize(rbuf);
fp(&msg);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef _MROS_TEST_PERSONNAME_H
#define _MROS_TEST_PERSONNAME_H
#ifndef _CUSTOM_PUBSUB_PERSONNAME_H
#define _CUSTOM_PUBSUB_PERSONNAME_H




static const int PERSONNAME_MSG_ID = 102;

namespace mros_test{
namespace custom_pubsub{
class PersonName{
public:
string firstName;
Expand Down Expand Up @@ -74,17 +74,17 @@ struct MD5Sum<PERSONNAME_MSG_ID>
};

template<>
struct DataType<mros_test::PersonName*>
struct DataType<custom_pubsub::PersonName*>
{
static const char* value()
{
return "mros_test/PersonName";
return "custom_pubsub/PersonName";
}

};

template<>
struct DataTypeId<mros_test::PersonName*>
struct DataTypeId<custom_pubsub::PersonName*>
{
static const int value()
{
Expand All @@ -94,7 +94,7 @@ struct DataTypeId<mros_test::PersonName*>
};

template<>
struct Definition<mros_test::PersonName*>
struct Definition<custom_pubsub::PersonName*>
{
static const char* value()
{
Expand All @@ -111,7 +111,7 @@ namespace subtask_methods
struct CallCallbackFuncs<PERSONNAME_MSG_ID>{
static void call(void (*fp)(intptr_t), char *rbuf)
{
mros_test::PersonName msg;
custom_pubsub::PersonName msg;
rbuf += 4;
msg.deserialize(rbuf);
fp(&msg);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#ifndef _MROS_TEST_USERTYPETEST_H
#define _MROS_TEST_USERTYPETEST_H
#ifndef _CUSTOM_PUBSUB_USERTYPETEST_H
#define _CUSTOM_PUBSUB_USERTYPETEST_H

#include "mros_test/LEDValues.h"
#include "mros_test/PersonName.h"
#include "custom_pubsub/LEDValues.h"
#include "custom_pubsub/PersonName.h"



static const int USERTYPETEST_MSG_ID = 103;

namespace mros_test{
namespace custom_pubsub{
class UserTypeTest{
public:
mros_test::LEDValues ledVal;
mros_test::PersonName nameVal;
custom_pubsub::LEDValues ledVal;
custom_pubsub::PersonName nameVal;

int dataSize(){
return ledVal.dataSize() + nameVal.dataSize() + 4*2;
Expand Down Expand Up @@ -54,17 +54,17 @@ struct MD5Sum<USERTYPETEST_MSG_ID>
};

template<>
struct DataType<mros_test::UserTypeTest*>
struct DataType<custom_pubsub::UserTypeTest*>
{
static const char* value()
{
return "mros_test/UserTypeTest";
return "custom_pubsub/UserTypeTest";
}

};

template<>
struct DataTypeId<mros_test::UserTypeTest*>
struct DataTypeId<custom_pubsub::UserTypeTest*>
{
static const int value()
{
Expand All @@ -74,7 +74,7 @@ struct DataTypeId<mros_test::UserTypeTest*>
};

template<>
struct Definition<mros_test::UserTypeTest*>
struct Definition<custom_pubsub::UserTypeTest*>
{
static const char* value()
{
Expand All @@ -91,7 +91,7 @@ namespace subtask_methods
struct CallCallbackFuncs<USERTYPETEST_MSG_ID>{
static void call(void (*fp)(intptr_t), char *rbuf)
{
mros_test::UserTypeTest msg;
custom_pubsub::UserTypeTest msg;
rbuf += 4;
msg.deserialize(rbuf);
fp(&msg);
Expand Down
10 changes: 10 additions & 0 deletions mros_ws/custom_pubsub/include/message_class_specialization.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "ros.h"


#include "custom_pubsub/UserTypeTest.h"



template ros::Subscriber ros::NodeHandle::subscribe(std::string,int,void (*fp)(custom_pubsub::UserTypeTest*));
template ros::Publisher ros::NodeHandle::advertise<custom_pubsub::UserTypeTest>(string, int);
template void ros::Publisher::publish(custom_pubsub::UserTypeTest&);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


#include "mros_test/UserTypeTest.h"
#include "custom_pubsub/UserTypeTest.h"


void callCallback(int id, void (*fp)(intptr_t), char *rbuf){
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"catkin_ws_dir": "../../../catkin_ws/",
"catkin_ws_dir": "../../ros_catkin_ws/",
"ros_include_dir": "/opt/ros/kinetic/include",
"including_msgs": [
"mros_test/UserTypeTest.h"
"custom_pubsub/UserTypeTest.h"
],
"depending_packages": [
"std_msgs",
"mros_test"
"custom_pubsub"
],
"depending_build_in_packages": [
]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ all:
#
# アプリケーションファイル
#
APPNAME = camera_app
APPLDIR = camera_app
APPNAME = image_publisher
APPLDIR = image_publisher
APPLNAME = app
USE_CXX = true
APPL_CFG = $(APPLNAME).cfg
USE_TRUESTUDIO = false
USE_TRUESTUDIO = true
GEN_MSG = true
MSG_SETTING_JSON = camera_app.json
PYTHON = /usr/bin/python
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"catkin_ws_dir": "../../../catkin_ws/",
"catkin_ws_dir": "../../ros_catkin_ws/",
"ros_include_dir": "/opt/ros/kinetic/include",
"including_msgs": [
"sensor_msgs/Image.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions workspace/app/Makefile → mros_ws/string_pubsub/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ all:
#
# アプリケーションファイル
#
APPNAME = app
APPLDIR = app
APPNAME = string_pubsub
APPLDIR = string_pubsub
APPLNAME = app
USE_CXX = true
APPL_CFG = $(APPLNAME).cfg
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion workspace/app/app.json → mros_ws/string_pubsub/app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"catkin_ws_dir": "../../../catkin_ws/",
"catkin_ws_dir": "../../ros_catkin_ws/",
"ros_include_dir": "/opt/ros/kinetic/include",
"including_msgs": [
"std_msgs/String.h"
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 221da21

Please sign in to comment.