Ask Your Question
0

controlling two models separately

asked 2020-03-06 09:54:56 -0600

lxg gravatar image

hi all, I found this simulation tutorial at: VehicleSimulator Am using ROS melodic. Unfortunately only one of the worlds worked for me (world_test.launch). Anyway, what am really interested in is creating another identical car model but control it separately from the one already spawned. After following this tutorial, I managed to get the second model. but i can not control it (velocity and, if possible later on. pid values). So any advice on steps to follow so as to achieve this will be greatly appreciated. Thanks in advance.

edit retag flag offensive close merge delete

Comments

How did you control the first robot? How are you trying to control the second one? Are you making sure that the controllers have different names or namespaces?

fvd gravatar image fvd  ( 2020-03-07 08:30:57 -0600 )edit

hello. the first one is launched using the world_test.launch file from the repository provided in the VehicleSimulator link in the question. Am kind of lost as to which ones am supposed to give different names since its written in c++ and more familiar with python. So, all i need to do is give the controllers different names or namespaces? Or is there something else? Thanks by the way.

lxg gravatar image lxg  ( 2020-03-09 02:21:01 -0600 )edit

Looking at rostopic list after you start up the first robot, where do the topics for the controller action (often of type follow_joint_trajectory) appear? If you start up the second one, do they use a different topic? You can use either a different name or namespace the controller. The latter is usually simpler, but you need to connect whatever uses the controller's action to that topic, so you end up writing it out either way.

fvd gravatar image fvd  ( 2020-03-09 03:15:12 -0600 )edit

thank you very much. indeed this was the issue. after making sure that they have different names and connected it all worked. can you convert this to an answer so that i can accept it?

lxg gravatar image lxg  ( 2020-03-13 09:27:19 -0600 )edit
1

so now i can easily control their velocities (linear and angular separately). Does this apply to other controllers such as the PID, btw? or do i have to write different config.yaml, robot description files etc. ? thanks.

lxg gravatar image lxg  ( 2020-03-13 09:36:49 -0600 )edit

I'm not sure I understand the question. It would be best if you could post a separate thread and link it here. Comments aren't meant for new questions.

fvd gravatar image fvd  ( 2020-03-16 08:23:23 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-13 09:39:29 -0600

fvd gravatar image

Summarizing the comments: You need to make sure that the controllers run in different namespaces (or have different names), so that they can be addressed separately.

Looking at rostopic list after you start up the first robot, you can check where the topics for the controller action (often of type follow_joint_trajectory) appear. If you start up the second one, do they use a different topic? You can use either a different name or namespace the controller. The latter is usually simpler, but you need to connect whatever uses the controller's action to that topic, so you end up writing it out either way.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-03-06 09:54:56 -0600

Seen: 65 times

Last updated: Mar 13 '20