Skip to content

Commit

Permalink
added timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
missxa committed May 10, 2021
1 parent 3999224 commit 140a94a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/roboyPlexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ void RoboyPlexus::MotorStatePublisher() {
for(auto &bus:motorControl){
for(auto m:bus->motor_config->motor){
if(bus->MyMotor(m.first)){
msg.header.stamp = ros::Time::now();
msg.global_id.push_back(m.first);
switch(control_mode[m.first]){
case ENCODER0_POSITION: msg.setpoint.push_back(bus->GetSetPoint(m.first)*m.second->encoder0_conversion_factor); break;
Expand Down Expand Up @@ -315,6 +316,7 @@ void RoboyPlexus::MagneticJointPublisher() {
int i=0;
for(auto ball:balljoints){
roboy_middleware_msgs::MagneticSensor msg;
msg.header.stamp = ros::Time::now();
msg.id = i;
ball->readMagneticData(msg.sensor_id,msg.x,msg.y,msg.z);
magneticSensor.publish(msg);
Expand Down

0 comments on commit 140a94a

Please sign in to comment.