Skip to content

Commit 988664b

Browse files
committed
use simple scalar logging instead of taking ownership
1 parent cd0d234 commit 988664b

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

rerun_bridge/src/rerun_bridge/rerun_ros_interface.cpp

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ void log_imu(
9696
"timestamp",
9797
rclcpp::Time(msg->header.stamp.sec, msg->header.stamp.nanosec).seconds()
9898
);
99+
99100
rec.log(entity_path + "/x", rerun::Scalars(msg->linear_acceleration.x));
100101
rec.log(entity_path + "/y", rerun::Scalars(msg->linear_acceleration.y));
101102
rec.log(entity_path + "/z", rerun::Scalars(msg->linear_acceleration.z));
102-
103103
}
104104

105105
void log_image(
@@ -427,14 +427,7 @@ void log_joint_state(
427427
// Entity path format: /joint_angles/joint_name
428428
std::string joint_entity_path = entity_path + "/joint_angles/" + joint_name;
429429

430-
rec.log(
431-
joint_entity_path,
432-
rerun::Scalars(
433-
rerun::Collection<rerun::components::Scalar>::take_ownership(
434-
{rerun::components::Scalar(joint_position)}
435-
)
436-
)
437-
);
430+
rec.log(joint_entity_path, rerun::Scalars(joint_position));
438431
}
439432

440433
// Also log joint velocities if available
@@ -444,14 +437,7 @@ void log_joint_state(
444437
double joint_velocity = msg->velocity[i];
445438

446439
std::string velocity_entity_path = entity_path + "/joint_velocities/" + joint_name;
447-
rec.log(
448-
velocity_entity_path,
449-
rerun::Scalars(
450-
rerun::Collection<rerun::components::Scalar>::take_ownership(
451-
{rerun::components::Scalar(joint_velocity)}
452-
)
453-
)
454-
);
440+
rec.log(velocity_entity_path, rerun::Scalars(joint_velocity));
455441
}
456442
}
457443

@@ -462,14 +448,7 @@ void log_joint_state(
462448
double joint_effort = msg->effort[i];
463449

464450
std::string effort_entity_path = entity_path + "/joint_efforts/" + joint_name;
465-
rec.log(
466-
effort_entity_path,
467-
rerun::Scalars(
468-
rerun::Collection<rerun::components::Scalar>::take_ownership(
469-
{rerun::components::Scalar(joint_effort)}
470-
)
471-
)
472-
);
451+
rec.log(effort_entity_path, rerun::Scalars(joint_effort));
473452
}
474453
}
475454
}

0 commit comments

Comments
 (0)