morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
355 stars 156 forks source link

Morse telemeters output keep increasing #799

Open sybernatus opened 6 years ago

sybernatus commented 6 years ago

Hello,

I have an issue with telemeters (SICK & HOKUYO) in MORSE :

I have a TTRK with a telemeter in a scene, when I run it everythings ok but when I try to read the output from rostopic, my ranges keep increasing.

for example with the first range : 0.40021... becomes 0.48642... after some scan.

When I take those values and draw them to map my scene, its like the telemeter keep rotatin on itself.

image

Here is my python script below :

from morse.builder import *
from smartwater.builder.robots import TTRK2

robot = TTRK2()
robot.name = "TTRK2"

robot.configure_stream()
kb = Keyboard()
robot.append(kb)

env = Environment('smartwater/environments/pepiniere2.blend')
env.properties(longitude = 1.47604, latitude = 43.564903, altitude = 0)

env.set_camera_location([0, -18, 10.5])
env.set_camera_rotation({math.radians(60), 0.0, math.radians(0)])

and the robot :

from morse.builder import *
from math import pi

class TTRK2(GroundRobot):
    """
    A template robot model for TTRK2, with a motion controller and a pose sensor.
    """
    def __init__(self, name = None, debug = True, scale = 1.0):

        # TTRK2.blend is located in the data/robots directory
        GroundRobot.__init__(self, 'smartwater/robots/TTRK2.blend', name)
        self._bpy_object.scale = [scale, scale, scale]
        self.properties(classpath = "smartwater.robots.TTRK2.TTRK2")

        self.set_rigid_body()
        self.set_collision_bounds()

        self.motion = MotionVW()
        self.motion.name = "Motion_Controller"
        self.append(self.motion)

        self.gps = GPS()
        self.gps.name = "Pose"
        self.gps.translate(z = 0.18)
        self.append(self.gps)

        self.raw_gps = GPS()
        self.raw_gps.level("raw")
        self.raw_gps.translate(z = 0.18)
        self.append(self.raw_gps)

        self.odometry = Odometry()
        self.odometry.level("integrated")
        self.append(self.odometry)

        self.pose = Pose()
        self.append(self.pose)

        self.telem = Sick()
        self.telem.name = "Sick"
        self.telem.translate(x=0.12, z=0.3)
        self.telem.properties(resolution = 1)
        self.telem.properties(scan_window = 240)
        self.telem.properties(laser_range = 5.0)
        self.telem.frequency(20)
        self.append(self.telem)

    def profile(self):
        self.motion.profile()
        self.gps.profile()
        self.raw_gps.profile()
        self.odometry.profile()
        self.telem.profile()
        self.pose.profile()

    def configure_stream(self, mw = 'ros'):
        self.motion.add_stream(mw)
        self.gps.add_stream(mw)
        self.raw_gps.add_stream(mw)
        self.odometry.add_stream(mw)
        self.pose.add_stream(mw)
        self.telem.add_stream(mw)

pepiniere2.blend.zip

What I've done so far :

but I have the same issue with both Hikoyu and Sick telemeters. So if someone can help me or explain me what I'm doin wrong.

Thanks


EDIT 1 :

The only thing coming to my mind is that maybe the latency of the VM produce this... Any other idea ?

EDIT 2 : I tried on another computer, same thing, the scan from telemeter seems to turn around the robot I tried to remove and reinstall morse 1.4

Thanks again

sybernatus commented 6 years ago

I resolved my problem, I create another morse scene and place my robot inside again, I have now fixed value coming from telemeter. But I would like to investigate later to know why I encountered this problem.

EDIT : Finally it didn't resolve it, there's still the problem even with a new project after few tests ... With the new scene, values are stable if I don't move the robot. When I move it to another place, values becoming instables and start incrementing like above.