Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logger proc #544

Merged
merged 5 commits into from
Apr 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
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 launch/samplerobot.launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<arg name="GUI" default="true" />
<arg name="CONTROLLER_PERIOD" default="500" />
<arg name="CONF_FILE" default="$(find hrpsys)/samples/SampleRobot/SampleRobot.$(arg CONTROLLER_PERIOD).conf" />
<arg name="LOG_CONF_FILE" default="$(find hrpsys)/samples/SampleRobot/SampleRobot.$(arg CONTROLLER_PERIOD).log.conf" />
<arg name="TORQUE_CONTROL" default="false"/>
<arg unless="$(arg TORQUE_CONTROL)" name="PROJECT_FILE" default="$(find hrpsys)/samples/SampleRobot/SampleRobot.$(arg CONTROLLER_PERIOD).xml"/>
<arg if="$(arg TORQUE_CONTROL)" name="PROJECT_FILE" default="$(find hrpsys)/samples/SampleRobot/SampleRobot.$(arg CONTROLLER_PERIOD).torque.xml"/>
Expand All @@ -40,6 +41,7 @@
-o "example.ImpedanceController.config_file:$(arg CONF_FILE)"
-o "example.AutoBalancer.config_file:$(arg CONF_FILE)"
-o "example.StateHolder.config_file:$(arg CONF_FILE)"
-o "example.DataLogger.config_file:$(arg LOG_CONF_FILE)"
-o "example.TorqueFilter.config_file:$(arg CONF_FILE)"
-o "example.TorqueController.config_file:$(arg CONF_FILE)"
-o "example.ThermoEstimator.config_file:$(arg CONF_FILE)"
Expand Down
6 changes: 6 additions & 0 deletions python/hrpsys_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class HrpsysConfigurator:
log = None
log_svc = None
log_version = None
log_use_owned_ec = False

# rtm manager
ms = None
Expand Down Expand Up @@ -776,6 +777,11 @@ def setupLogger(self):
for sen in filter(lambda x: x.type == "Force", self.sensors):
self.connectLoggerPort(self.rmfo, "off_"+sen.name)
self.log_svc.clear()
## parallel running log process (outside from rtcd) for saving logs by emergency signal
if self.log and (self.log_use_owned_ec or not isinstance(self.log.owned_ecs[0], OpenRTM._objref_ExtTrigExecutionContextService)):
print self.configurator_name, "\033[32mruning DataLogger with own Execution Context\033[0m"
self.log.owned_ecs[0].start()
self.log.start(self.log.owned_ecs[0])

def waitForRTCManager(self, managerhost=nshost):
'''!@brief
Expand Down
5 changes: 5 additions & 0 deletions sample/SampleRobot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ foreach(_idx 0 1)
configure_file(SampleRobot.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.${_tmp_controller_period}.xml)
configure_file(SampleRobot.torque.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.${_tmp_controller_period}.torque.xml)
configure_file(SampleRobot.conf.in ${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.${_tmp_controller_period}.conf)
configure_file(SampleRobot.conf.in ${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.${_tmp_controller_period}.log.conf)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.${_tmp_controller_period}.log.conf "exec_cxt.periodic.type: PeriodicExecutionContext\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.${_tmp_controller_period}.log.conf "exec_cxt.periodic.rate: ${_tmp_controller_period}\n")
endforeach()

# for virtual force sensor testing
Expand Down Expand Up @@ -64,11 +67,13 @@ install(PROGRAMS
install(FILES
# files for 500[Hz] = 0.002[s]
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.500.conf
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.500.log.conf
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.500.xml
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.500.torque.xml
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.RobotHardware.500.conf
# files for 200[Hz] = 0.005[s]
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.200.conf
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.200.log.conf
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.200.xml
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.200.torque.xml
${CMAKE_CURRENT_BINARY_DIR}/SampleRobot.RobotHardware.200.conf
Expand Down
1 change: 1 addition & 0 deletions sample/SampleRobot/samplerobot_data_logger.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def init ():
global hcf
hcf = HrpsysConfigurator()
hcf.getRTCList = hcf.getRTCListUnstable
hcf.log_use_own_ec = True ### use own ec for simulation
hcf.init ("SampleRobot(Robot)0", "@OPENHRP_DIR@/share/OpenHRP-3.1/sample/model/sample1.wrl")

def demo ():
Expand Down