RobustFieldAutonomyLab / spin_hokuyo

spinning Hokuyo form 3D point cloud
GNU General Public License v3.0
41 stars 27 forks source link

How to access time for reading each servo position while spinning? #1

Closed ahar closed 6 years ago

ahar commented 6 years ago

Hi,

I am interested about your package. I have a few queries to understand whether I can use it for my project.

  1. I am interested to know how to read or publish the time corresponding to each servo position during one sweep (e.g. -90 deg. to +90 deg.).

  2. Is your code applicable to RX-24F?

  3. If you can publish time of different servo position during a single spin, what is the latency? I mean, how much delay it causes from sending a command and publishing the position of the servo.

thanks,

baishibona commented 6 years ago

Hi @Angit16

Glad to hear you are interested in our package. I wish the following will help.

  1. You may subscribe to the /laser topic and grab the timestamp within the message.
  2. The code were using the driver for all kinds of Dynamixel Servo Motors, so it should, however we don't have RX-24F here and unfortunately can't double check.
  3. The latency should be very small, as we don't see much distortion from the 3D point cloud. I think it is mainly due to the latency of the motor itself, plus a few micro-seconds for ROS to pass the message.

Please let us know if there is further questions with the package, and hope it will be useful for your project.

ahar commented 6 years ago

Hi,

While launching the 'basic_motor.launch' , following errors occurred.

ERROR: cannot launch node of type [spin_hokuyo/controller_manager.py]: can't locate node [controller_manager.py] in package [spin_hokuyo] ERROR: cannot launch node of type [spin_hokuyo/controller_spawner.py]: can't locate node [controller_spawner.py] in package [spin_hokuyo]

I was wondering where the files are actually located. Can you please have a look?

thanks,

pszenher commented 6 years ago

I just took a look,

That launch file was never updated after we changed where we read the dynamixel files from. I've just pushed an updated launch file that has the proper package location of those files.
Those files are contained in the 'dynamixel_controllers' package, which is a dependency package of spin_hokuyo. If you wish to fix this issue locally, simply change the package definition line in the launch file from

pkg="spin_hokuyo" 

to

pkg="dynamixel_controllers"

for "dynamixel_manager" and "dynamixel_controller_spawner".

Let me know if this solves your issue.

ahar commented 6 years ago

Hi,

first of all thanks for your suggestions. I changed the package name and it does not show any error then after. Now, dynamixel_servos_tilting.yaml currently available in git, should be dynamixel_servos.yaml, otherwise it was unable to find out this file. Also, tilting_lidar_continuous.launch will be tilt_continuous.launch in the description of how to set up. Then, when I launched tilt_continuous.launch , although I was getting the laser scan, but somehow did not get servo to rotate.

I checked the baudrate and ID for the same.

Before, running this package I ran both the LIDAR and servo with their individual different packages and they work fine. Your suggestions are appreciated.

sbertussi commented 6 years ago

Hi @Angit16 ,

There are actually two .yaml files that we use, one for the tutorial and one for the full launch files. Which launch file were you trying to use when you had this issue?

For the servo issue, could you try three things for me?

  1. Are the nodes dynamixel_manager and tilt_motor running when you use the launch file?
  2. If both nodes are there, can you echo /tilt_controller/command and see if tilt_motor is publishing anything to the servo?
  3. If nothing is being published, can you trying publishing your own command to /tilt_controller/command and see if that works?

Could you also screen shot your ROS console when you have this error?

Also, thanks for catching the typo! We changed the file names and must have missed that one!

ahar commented 6 years ago

Hi,

As I mentioned above, I used tilt_continuous.launch , which is I hope the full launch file. The respective directory is catkin_ws/src/spin_hokuyo/launch/tilt_continuous.launch . Actually, there is no error that I find. It is just that the dynamixel RX-24F does not respond. Although two extreme positions between which it is supposed to spin is set as -90deg and +90deg respectively.

sbertussi commented 6 years ago

Hi,

If you aren't receiving any error messages, and the three things I mentioned before work, it could be that your servo is on a different setting then ours. If you use the RoboPlus application from Robotis and connect your servo using the Dynamixel Wizard, it should give you three options in the top right corner of the window. We have been using the Multi Turn option. Could you check that for us and let us know how it goes?

ahar commented 6 years ago

Hi, I used dynamixel wizard and this is what I find. I did not see multi turn option there. Please have a look. Also, while using basic_motors.launch the process finishes soon after start. It's snapshot is here thanks,

sbertussi commented 6 years ago

@Angit16 ,

I am not able to open your basic_motors.launch image. May you check the permissions?

For the Dynamixel Wizard, I think that because you are using a different servo that we did, the options are different. Let me look up our two servos to see what the differences are and I will get back to you.

ahar commented 6 years ago

just changed share settings, please have a look.

sbertussi commented 6 years ago

Hi, I just updated the code, it was missing a while loop that would prevent it from doing that.

To fix it locally, go to /spin_hokuyo/tutorials/node/commander.cpp and add a while(ros::ok()) loop around the if/else statement at the very end.

ahar commented 6 years ago

Thanks, BDW, tilt_continuous.launch works fine. I will work with with that. Just a formal question:

Did you try tilting your servo with only dynamixel_motor package or also tried with other available dynamixel packages?

ahar commented 6 years ago

Hi,

some more doubts regarding the topic assembled_cloud. Do you mean that this topic contains all the laser scan measurements as a cloud for one full sweep of the servo from -90 to +90 deg? When I record this topic for about 1 minute, I found very few data corresponding to x, y, z along with other fields. I suspect that it is working in timer mode, as because it gave me a set of 12 data. How should I make it work in a subscriber mode? So, I could not yet get to check the cloud generated by my set up.

baishibona commented 6 years ago

Yes it covers a full sweep in the assembled_cloud. If you open it up in RVIZ you might find how the cloud looks like. I guess for debug, first check if your /scan topic shows up, as well as your motor did rotate.

Sorry to hear all the troubles you are running to, please feel free to let us know if you have further questions.

ahar commented 6 years ago

Hi, thanks, previously I was not selecting the fixed frame ans "servo" and that's why was unable to observe the rotated laser scan in rviz. Further questions:

  1. Does this package anyway keep adding the measured ranges and keep on plotting or the user needs to do that on his own?
  2. Did you try urg_node package instead of hokuyo node? Just wondering.
baishibona commented 6 years ago

Glad to hear it's working on your side.

  1. The package will just publish every sweep as a point cloud, and you may want to increase "decay time" in rviz associated with the point cloud to keep the plot a bit longer.
  2. As we were using hokuyo lidar, we have been using hokuyo_node. If you were attaching a different lidar or having a alternative drive for the hokuyo lidar, feel free to try it and let us know, we will added it to the document.

Thanks!

baishibona commented 6 years ago

I am closing this as it seems solved.