1
$\begingroup$

I am starting to attempt a new project about a mechanical arm using a pen to draw random things as I move the robot's arm.

so to do that Webots already has a node named "Pen" (Webots doc, and this is an example project by cyberbotics) which I think I can use for this project, But I don't know what is the proper way of attaching this node to my custom robot or whether it is possible even to get me started for my project. let alone about the procedures for doing so.

edit:

warning: if you happen to know a tutorial or a platform that includes all the procedures, if you share it, it would be more convenient and less time-consuming. if there isn't any continue to read the demanded details which are included below to solve the problem together, thanks for your patience.

what I have done so far

here's a scene of a trial error of mine to make this node work. found the pen node in the base nodes.

Although it seems to be fairly easily attached, it is not working.

these are the other attributes that might cause issues.

according to Webots doc:

"In order to be paintable, an object should be made up of a Solid node containing a Shape with a valid Geometry and an ImageTexture. The painted layer is applied over the texture without modifying it."

I added another node from Solid and added a plane Geometry to its Shape, as you can see in the image below,

so another thing that should be added to the project tree is the ImageTexture node which I tried adding from the appearance attribute just a basic Appearance value, and then adding the ImageTexture to the Texture.

enter image description here

but it doesn't seem to be working still.

if you see any issues with my procedure or you know how to add this Node to the project please share some screenshots so we can follow the steps.

thank you for your guidance!

$\endgroup$
5
  • $\begingroup$ what research have you done before you posted your question? $\endgroup$
    – jsotola
    Dec 1, 2021 at 1:00
  • $\begingroup$ Welcome to the Robotics Stack Exchange. It sounds like you have an idea of what you want to do. But without more details in your question it is going to be hard for anyone to help you. Please take a look at this guide to asking questions here and take some time to edit your question to be more specific so that people can effectively help you. $\endgroup$
    – Tully
    Dec 1, 2021 at 1:00
  • $\begingroup$ @jsotola, I think to include all my done researches until this moment on this subject, I'll have to edit my post since it would be inconvenient to include all in the comment section, also it is more relatable to the post. thank you for your concern. $\endgroup$ Dec 1, 2021 at 11:01
  • $\begingroup$ @Tully ,since this is a simple question of using a basic feature of this simulator, I would highly like to avoid including unnecessary details and my research has very little to do with my question's answer. but if requested I am willing to share every resource necessary to solve the problems. I hope the details aren't going to scare the readers off, since prolonged queries are rarely read. thanks for understanding and your concern. $\endgroup$ Dec 1, 2021 at 11:51
  • 1
    $\begingroup$ Thanks for editing it and I'm glad to see that you've solved it. Part of the motivation of asking for the more explicit question is exactly to motivate that. From you're original question there would have been no way for someone else to be able to determine that you'd attached the pen in the wrong orientation. With your refining the problem further you were even able to answer it yourself, for effective help here, the questino needs to contain all the information available to debug it that you used to find the solution yourself. I'm glad that it's resolved. $\endgroup$
    – Tully
    Dec 1, 2021 at 22:32

1 Answer 1

3
$\begingroup$

firstly I have to say I'll make a youtube tutorial video on how to do this complete procedure for future students wondering about this problem.

Answer

with more tweaking on the pen node and adjusting the parameters, I found the problem to be more related to the angle or rotation of the pen node. if you want to draw something on the ground or paper which you have prepared, you should have the green arrow (x-axis in my case) of the pen face upwards or against the paper in the opposite direction.

you can see the parameters changed in the following image:

enter image description here

the translation attribute has to have some distance even small from the paper to make the ink draw or have physical contact with the ImageTexture node.

Some other changes

here's a more unrelated attribute but necessary to mention, I created a white 256x256 picture in the paint app and saved as /project/worlds/textures/whitepaper.png and linked to the ImageTexture>url.

enter image description here

Final results

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.