Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode/c_cpp_properties.json
.vscode/settings.json
92 changes: 33 additions & 59 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,62 +1,36 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.8)

project(tasker)

# Get the information about this package's buildtime dependencies
find_package(catkin REQUIRED
COMPONENTS tasker_msgs message_generation std_msgs geometry_msgs rospy)

catkin_python_setup()
if(USE_PDDL)
execute_process(COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/compile-pddl-planner.sh

WORKIN_DIRECTORY ${CATKIN_PACKAGE_SOURCE_DIR}
)
endif()

#message( ${CMAKE_CURRENT_SOURCE_DIR} )
#add_custom_command(TARGET VAL
# PRE_BUILD
# COMMAND make clean
# COMMAND make
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../VAL
# )
#add_custom_command(TARGET universal-pddl-parser
# PRE_BUILD
# COMMAND scons
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../universal-pddl-parser
# )
#add_custom_command(TARGET temporal-planning
# PRE_BUILD
# COMMAND python fd_copy/build.py release64
# COMMAND scons
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../temporal-planning
# )


# Actually generate the language-specific message and service files
# Catkin package
catkin_package(
INCLUDE_DIRS
CATKIN_DEPENDS rospy
DEPENDS )



# define executable using MyMessage1 etc.
#add_executable(message_program src/main.cpp)
#add_dependencies(message_program ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

# define executable not using any messages/services provided by this package
#add_executable(does_not_use_local_messages_program src/main.cpp)
#add_dependencies(does_not_use_local_messages_program ${catkin_EXPORTED_TARGETS})

catkin_install_python(PROGRAMS
bin/exampleState
bin/exemplary_susp_task
bin/txt_guideHuman
bin/txt_hazardDetection
bin/txt_human_fell
bin/harmonization_table_generator
bin/txt_test
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
# Find packages in ROS 2
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(tasker_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

# Generate Python modules from message files
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/CMD.msg"
"msg/RobotResource.msg"
"msg/ScheduleParams.msg"
"msg/ShdlData.msg"
"msg/ShdlDataStamped.msg"
"msg/Status.msg"
"msg/TaskState.msg"
"srv/CostConditions.srv"
"srv/HoldConditions.srv"
"srv/LaunchConditions.srv"
"srv/SchedulingConditions.srv"
"srv/StartTask.srv"
"srv/SuspendConditions.srv"
"srv/TaskRequest.srv"
DEPENDENCIES std_msgs geometry_msgs
)

# Install Python modules
# ament_python_install_package(${PROJECT_NAME})

# Build the ROS 2 package
ament_package()
4 changes: 2 additions & 2 deletions bin/control_human.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import roslib
import rospy
import rospkg
Expand Down Expand Up @@ -138,7 +138,7 @@ def handle_actor_vel(msg):
marker_pub.publish(marker)
marker_pub.publish(marker_name)
task_reqested = False
while not rospy.is_shutdown():
while rclpy.ok():
actor_posture = rospy.get_param(actor_name+"/actor_posture")
marker_pub.publish(marker)
if actor_posture == "fell":
Expand Down
4 changes: 2 additions & 2 deletions bin/control_human_real.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import roslib
import rospy
import rospkg
Expand Down Expand Up @@ -125,7 +125,7 @@ def handle_ionis_msg(msg):
marker_pub.publish(marker)
marker_pub.publish(marker_name)
task_reqested = False
while not rospy.is_shutdown():
while rclpy.ok():
actor_posture = rospy.get_param(actor_name+"/actor_posture")
marker_pub.publish(marker)
if actor_posture == "fell":
Expand Down
2 changes: 1 addition & 1 deletion bin/exampleState
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from task_machine.StateMachine import * #StateMachine
import rospy
Expand Down
2 changes: 1 addition & 1 deletion bin/exemplary_susp_task
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf8

import tkinter as tk
Expand Down
2 changes: 1 addition & 1 deletion bin/harmonization_table_generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import rospy
import time
Expand Down
10 changes: 5 additions & 5 deletions bin/taskHarmonizer
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import rospy
from multitasker.srv import *
Expand Down Expand Up @@ -59,7 +59,7 @@ def handleNewTaskRequest(req):
da_name = req.da_name
cmd = "rosrun "+ package + " "+executable+ " "+da_name+ " "+str(req.task_priority)+ " "+str(req.task_deadline)
subprocess.Popen(['rosrun', package, executable, da_name, str(req.task_priority), str(req.task_deadline)])
isInterrupting = False
is_interrupting = False
set_new_task = False
status = False
global current_state
Expand Down Expand Up @@ -105,11 +105,11 @@ def handleNewTaskRequest(req):
# time.sleep(1)
# rospy.spinOnce()
if current_state.status == 1:
isInterrupting = True
is_interrupting = True
else:
isInterrupting = False
is_interrupting = False
start_task_srv = rospy.ServiceProxy(requested_task_namespace+'/startTask', StartTask)
start_task_srv(isInterrupting)
start_task_srv(is_interrupting)

# node = roslaunch.core.Node(package, executable)

Expand Down
Loading