Controlling a Mobile Robot from a Text File

Typically: "How do I... ", "How can I... " questions
Post Reply
Dragon
Posts: 7
Joined: 20 May 2020, 20:48

Controlling a Mobile Robot from a Text File

Post by Dragon »

Hello.
For my final year's project I have to program a mobile robot that is controlled using voice. Because of COVID, it is out of the question to program the real robot at my university. So I've resorted to voice commanding a simulated mobile robot.
The voice recognition part is done, I'm using an android app that I developed on my phone. After some struggle, I've got the command into my Desktop PC and into a text file that is continuously updated, only one command is present in it at a time.
Now that I reached the simulation part, I need help from you guys with using CoppeliaSim.
I need to periodically read from the text file a command that consists of 4 words such as:
"rotate base right 90" which should rotate the base platform by 90 degrees
"move base left 50" which should move the base platform on the X axis by -50 units
"rotate tool Z 20" which should rotate the tool by its Z axis by 20 degrees
It is clear that I need to use Inverse Kinematics methods as joint values are not of interest here.
I've added the Kuka Youbot to the scene and it seems to be perfect for what I need. Problem is that I dont know how to program it to do what I need it to do.

Can I get some guidance into how to proceed with this objective?
I've never used CoppeliaSim, only ABB RobotStudio if I'm allowed to mention it :), which doesnt have mobile robots

Thanks

fferri
Posts: 1229
Joined: 09 Sep 2013, 19:28

Re: Controlling a Mobile Robot from a Text File

Post by fferri »

Rotating the tool/tip would be very simple once you set up IK: simply rotate the target dummy.

Check out the Inverse kinematics tutorial.

fferri
Posts: 1229
Joined: 09 Sep 2013, 19:28

Re: Controlling a Mobile Robot from a Text File

Post by fferri »

About sending commands to the robot externally, you have plenty of options: Remote API, ROS, BlueZero.

Check out this extensive list: Means of communication.

But sure, also a text file could work.

Dragon
Posts: 7
Joined: 20 May 2020, 20:48

Re: Controlling a Mobile Robot from a Text File

Post by Dragon »

Thank you for the info.
Can someone tell me about how to rotate the base by a number of degrees or move it by a number of units?

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Controlling a Mobile Robot from a Text File

Post by coppelia »

Hello,

since your mobile base is probably dynamically enabled, you will have to act directly on the wheel joints, by setting their target velocities sim.setJointTargetVelocity. Then your mobile base will perform a specific movement. It is your responsability to check what joint velocities are required to reach a specific positional/orientational target (e.g. have some kind of simple p-controller link the wheel velocities to the distance between robot and target position).

Cheers

Post Reply