ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

MohamedAkaarir's profile - activity

2020-08-21 05:26:05 -0500 received badge  Famous Question (source)
2020-04-06 02:41:59 -0500 received badge  Notable Question (source)
2020-04-06 02:41:59 -0500 received badge  Popular Question (source)
2020-02-25 10:29:25 -0500 marked best answer I have an error "AttributeError: 'module' object has no attribute 'ApproximateTimeSynchronizer'" even if i already used TimeSynchronizer

System information

OS: Ubuntu 12.07 ROS version: Hydro

this the code i just create to be able to use two topics at the same time:


import numpy as np
import  message_filters
import rospy
from gps_common.msg import GPSFix
from personalpackage.msg import imu
from personalpackage.msg import GNSS

message = ""

def callback(GNSS,GPS): f=open("the_times.csv","a+") print("inside callback") time_ros= GNSS.header.stamp.secs+GNSS.header.stamp.nsecs0.000000001 time_gps= GNSS.time.secs+GNSS.time.nsecs0.000000001 time_gps_pps= GNSS.time_clock.secs+GNSS.time_clock.nsecs*0.000000001 tsmp = time_gps_pps - time_ros message="time_ros time_gps time_gps_pps difference between timeGPS & timeGPSPPS\n" message=message+str(time_ros)+"\t"+str(time_gps)+"\t"+str(time_gps_pps)+"\t"+str(tsmp)+"\n" print(message) rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)

def the_times(): rospy.init_node('the_times', anonymous=True) GnssData=message_filters.Subscriber("GPS",GPSFix) ImuData=message_filters.Subscriber("GNSS",GNSS) print("after filtering") ApproSynchron=message_filters.ApproximateTimeSynchronizer([GnssData,ImuData], 10, 0.1,allow_headerless=True) print("after Synchro") ApproSynchron.registerCallback(callback) print("after Callback") rospy.spin()

if __name__ == '__main__': the_times()

When i execute it i get this error message :

Traceback (most recent call last): File "the_times.py", line 51, in <module> the_times() File "the_times.py", line 41, in the_times ApproSynchron=message_filters.ApproximateTimeSynchronizer([GnssData,ImuData], 10, 0.1,allow_headerless=True) AttributeError: 'module' object has no attribute 'ApproximateTimeSynchronizer'

I already tried the same code using "TimeSynchronizer" and i didn't get any error message.

2020-02-25 10:15:35 -0500 answered a question I have an error "AttributeError: 'module' object has no attribute 'ApproximateTimeSynchronizer'" even if i already used TimeSynchronizer

The problem was simply that i don't have the good version of message_filters library that contains "ApproximateTimeSynch

2020-02-25 10:15:35 -0500 received badge  Rapid Responder (source)
2020-02-25 09:38:36 -0500 asked a question I have an error "AttributeError: 'module' object has no attribute 'ApproximateTimeSynchronizer'" even if i already used TimeSynchronizer

I have an error "AttributeError: 'module' object has no attribute 'ApproximateTimeSynchronizer'" even if i already used