Skip to content
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
10 changes: 8 additions & 2 deletions subt_ign/launch/cloudsim_sim.ign
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
else
$circuit = circuit
end

if !defined?(logPath) || logPath == nil || logPath.empty?
$logPath = '/tmp/ign/logs'
else
$logPath = logPath
end
%>

<%
Expand Down Expand Up @@ -340,7 +346,7 @@
<record>
<enabled>true</enabled>
<!-- This path is used by cloudsim, please do not change -->
<path>/tmp/ign/logs</path>
<path><%= $logPath %></path>
<overwrite>true</overwrite>
</record>
<%if defined?(seed) && seed != nil && !seed.empty?%>
Expand Down Expand Up @@ -401,7 +407,7 @@
<logging>
<!-- Use the <path> element to control where to record the log file.
The HOME path is used by default -->
<path>/tmp/ign/logs</path>
<path><%= $logPath %></path>
<filename_prefix>subt_<%= $circuit %></filename_prefix>
<elevation_step_size>5</elevation_step_size>
</logging>
Expand Down
3 changes: 2 additions & 1 deletion subt_ign/src/GameLogicPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ void GameLogicPlugin::Configure(const ignition::gazebo::Entity & /*_entity*/,
// Setup a ros bag recorder.
rosbag::RecorderOptions recorderOptions;
recorderOptions.append_date=false;
recorderOptions.prefix="/tmp/ign/logs/cloudsim";
recorderOptions.prefix = ignition::common::joinPaths(
this->dataPtr->logPath, "cloudsim");
recorderOptions.regex=true;
recorderOptions.topics.push_back("/subt/.*");

Expand Down
10 changes: 10 additions & 0 deletions subt_ros/src/SubtRosRelay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,17 @@ SubtRosRelay::SubtRosRelay()
// http://docs.ros.org/en/noetic/api/rosbag/html/c++/record_8cpp_source.html
recorderOptions.max_size=1048576 * 1000;

// Prefix the rosbag file(s) name with a prefix composed of robot_data, the
// IGN_PARTITION (if set), and the list of robots that generate this data.
// This allows running multiple simulations of multiple robots even on
// local catkin workspace.
std::string part;
ignition::common::env("IGN_PARTITION", part);
recorderOptions.prefix="robot_data";
if (!part.empty())
recorderOptions.prefix += "_" + part;
recorderOptions.prefix += "_" + stringNames;

recorderOptions.regex=true;
recorderOptions.topics.push_back("/robot_data(.*)");

Expand Down