Please select Into the mobile phone version | Continue to access the computer ver.
Distance sensors, update
882 21 4-1 11:39
Uploading and Loding Picture ...(0/1)
o(^-^)o
thomasnemo.com
lvl.2
Offline

I was looking for distance sensors in my new RoboMaster. I see block (diy programming) - gray color - not available? Finally I have used infrared to get this facebook post

Update: Here you can download the code, v1.0 - Txt, dsp file
Variables:
variable_headMinAngle = -30 // head angle in left position
    variable_headMaxAngle = 30 // head angle in right position
    variable_headStep = 10 // for how much head change rotation angle (scan environment)
    variable_defaultHeadPitch = -5 // pitch in 0 position (looking straight)
    variable_headUpX = 0 // determine optionally pitch angle for different head position
    variable_normalSpeed = 0.2 // speed
    variable_lazyLevel = 0 // 0-10 value (Octo is waiting after he finds an obstacle)
    variable_senseSightAnimal = 0 // not supported - will try to recognize animal

-

Update:
You can download 1.1 here Download

Code v1.1
- higher iq
- hearingSense - 3 claps to sleep/go, 2 claps to scary
- sightSense - oposite V to scary

Working on version 2.0 now with advanced AI part.

More info: Dji Discussion new thread

4-1 11:39
Use props
gpvillamil
Second Officer
Flight distance : 210226 ft
United States
Offline

That's really clever! Using the IR blaster and hit detector as a proximity sensor? Can you share the code?
4-1 12:25
Use props
Bitmizu
lvl.1

Singapore
Offline

Awesome! Share your code, pls.
4-1 17:09
Use props
thomasnemo.com
lvl.2
Offline

gpvillamil Posted at 4-1 12:25
That's really clever! Using the IR blaster and hit detector as a proximity sensor? Can you share the code?

Sure, Now the code is a little bit more advanced - will put the code below, Thanks
4-1 20:24
Use props
thomasnemo.com
lvl.2
Offline

I'm not hardware guy but I love inventions related to software, AI/VR and robots. I developed 4 technologies (software) which now I'm implementing in tek projects. I 'm software developer since I was 9 but 10 years ago I forced to care on business side (Bali helped me).  I found 15 people and together we are working on implementation of the projects.   Maybe you could help me and share the info about Smellv.com (http://fb.com/smellvr)? A great VR device - a Kickstarter compaign starts in 1 month.   Btw. It would be great for us to work with Dji on Smell'v (I even asked for help 1 month ago at Dji shop). we will see.

4-2 00:25
Use props
thomasnemo.com
lvl.2
Offline

same video here on Youtube: https://youtu.be/aRc3e4t4iuk
4-2 00:39
Use props
robertotr
lvl.1
Flight distance : 7530 ft
Guatemala
Offline

that's a great idea, got really  disappointed realizing that RoboMaster s1 can't avoid obstacles, but your idea can in part solve that. Could you share the code?

4-3 12:34
Use props
thomasnemo.com
lvl.2
Offline

robertotr Posted at 4-3 12:34
that's a great idea, got really  disappointed realizing that RoboMaster s1 can't avoid obstacles, but your idea can in part solve that. Could you share the code?

Yes
Sorry for the delay (Working on Coronavirus app k-virus.com).

Tomorrow morning I will put the code - much better than the from the video. You can play with different variables values.
4-3 15:15
Use props
wqiu
lvl.3

China
Offline

Great, maybe we can build up a simple map indoors by IR. Could you please share your code?  
4-5 07:37
Use props
thomasnemo.com
lvl.2
Offline

Hi, finally I'm ready. You can download the code from my website Smell'v - http://smellv.com/#interested.
4-5 09:11
Use props
thomasnemo.com
lvl.2
Offline

----------
4-5 09:17
Use props
thomasnemo.com
lvl.2
Offline

Code link - code
4-5 09:39
Use props
thomasnemo.com
lvl.2
Offline

OMG! now - code link
4-5 09:40
Use props
thomasnemo.com
lvl.2
Offline

ok, finally I have created a new thread, links not working
4-5 10:05
Use props
thomasnemo.com
lvl.2
Offline

wqiu Posted at 4-5 07:37
Great, maybe we can build up a simple map indoors by IR. Could you please share your code?

Yes, I have this almost ready. Robomaster slow down near visited places with obstacles. I’m not sure if he can share information about obstacles...
You can download the code as file from my website http://Smellv.com
4-5 14:24
Use props
thomasnemo.com
lvl.2
Offline

robertotr Posted at 4-3 12:34
that's a great idea, got really  disappointed realizing that RoboMaster s1 can't avoid obstacles, but your idea can in part solve that. Could you share the code?

You can download the code as file from my website http://Smellv.com - link
4-5 14:26
Use props
thomasnemo.com
lvl.2
Offline

Bitmizu Posted at 4-1 17:09
Awesome! Share your code, pls.

Code
4-5 14:28
Use props
thomasnemo.com
lvl.2
Offline

gpvillamil Posted at 4-1 12:25
That's really clever! Using the IR blaster and hit detector as a proximity sensor? Can you share the code?

Link
4-5 14:29
Use props
thomasnemo.com
lvl.2
Offline

variable_headMinAngle = -30 // head angle in left position
    variable_headMaxAngle = 30 // head angle in right position
    variable_headStep = 10 // for how much head change rotation angle (scan environment)
    variable_defaultHeadPitch = -5 // pitch in 0 position (looking straight)
    variable_headUpX = 0 // determine optionally pitch angle for different head position
    variable_normalSpeed = 0.2 // speed
    variable_lazyLevel = 0 // 0-10 value (Octo is waiting after he finds an obstacle)
    variable_senseSightAnimal = 0 // not supported - will try to recognize animal
Code v1.1
- hearingSense
- sightSense
Link

Code v1.0

import random  list_Cx = RmList() list_Cy = RmList() list_Cd = RmList() list_collision = RmList() list_senseTouch = RmList() list_senseSight = RmList() list_senseHearing = RmList() pid_Ii = PIDCtrl() variable_scanX = 0 variable_scanDir = 0 variable_isAlive = 0 variable_headMinAngle = 0 variable_headMaxAngle = 0 variable_headStep = 0 variable_headUpX = 0 variable_lookUp = 0 variable_lookUpStep = 0 variable_defaultHeadPitch = 0 variable_dX1 = 0 variable_dY1 = 0 variable_dX2 = 0 variable_dY2 = 0 variable_dV = 0 variable_normalSpeed = 0 variable_lazyLevel = 0 variable_i = 0 variable_isMoving = 0 variable_senseSightAnimal = 0 variable_senseHearingVoice = 0 def user_defined_saveCoord():     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     list_Cx.append(chassis_ctrl.get_position_based_power_on(rm_define.chassis_forward))     list_Cy.append(chassis_ctrl.get_position_based_power_on(rm_define.chassis_translation))     list_Cd.append(chassis_ctrl.get_position_based_power_on(rm_define.chassis_rotate)) def user_defined_checkSenses():     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     if list_senseTouch[1] == 1:         list_senseTouch[1] = 0         user_defined_collision()     else:         if list_senseSight[1] == 1:             list_senseSight[1] = 0             if list_senseSight[2] != 3:                 user_defined_collision()             else:                 pass         else:             pass def user_defined_brain():     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     user_defined_checkSenses()      if variable_isMoving == 1:         if variable_scanDir == 1:             variable_scanX = variable_scanX + variable_headStep             if variable_scanX > 0:                 if variable_headUpX != 0:                     gimbal_ctrl.angle_ctrl(variable_scanX, variable_scanX / variable_headUpX)                 else:                     gimbal_ctrl.angle_ctrl(variable_scanX, 0)             else:                 if variable_scanX < 0:                     if variable_headUpX != 0:                         gimbal_ctrl.angle_ctrl(variable_scanX, abs(variable_scanX) / variable_headUpX)                     else:                         gimbal_ctrl.angle_ctrl(variable_scanX, 0)                 else:                     gimbal_ctrl.angle_ctrl(0, variable_defaultHeadPitch)         else:             variable_scanX = variable_scanX + 0 - variable_headStep             if variable_scanX < 0:                 if variable_headUpX != 0:                     gimbal_ctrl.angle_ctrl(variable_scanX, abs(variable_scanX) / variable_headUpX)                 else:                     gimbal_ctrl.angle_ctrl(variable_scanX, 0)             else:                 if variable_scanX > 0:                     if variable_headUpX != 0:                         gimbal_ctrl.angle_ctrl(variable_scanX, variable_scanX / variable_headUpX)                     else:                         gimbal_ctrl.angle_ctrl(variable_scanX, 0)                 else:                     gimbal_ctrl.angle_ctrl(0, variable_defaultHeadPitch)         ir_blaster_ctrl.fire_once()         ir_blaster_ctrl.fire_once()         if variable_scanX == variable_headMaxAngle:             variable_scanDir = 2         else:             if variable_scanX == variable_headMinAngle:                 variable_scanDir = 1 def user_defined_life():     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     variable_scanX = 0     variable_scanDir = 1     variable_isMoving = 1     variable_isAlive = 1     chassis_ctrl.move_degree_with_speed(variable_normalSpeed,0)     while not variable_isAlive == 0:         user_defined_brain()  def user_defined_collision():     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     chassis_ctrl.stop()     led_ctrl.set_bottom_led(rm_define.armor_bottom_all, 255, 0, 0, rm_define.effect_always_on)     user_defined_saveCoord()      chassis_ctrl.move_with_distance(180,random.randint(4, 6) / 10)     if random.randint(1, 10) <= 9:         chassis_ctrl.rotate_with_degree(rm_define.clockwise,random.randint(30, 60))     else:         chassis_ctrl.rotate_with_degree(rm_define.anticlockwise,random.randint(30, 60))     led_ctrl.set_bottom_led(rm_define.armor_bottom_all, 255, 255, 255, rm_define.effect_always_on)     list_collision.append(armor_ctrl.get_last_hit_index())     gimbal_ctrl.angle_ctrl(variable_scanX, variable_defaultHeadPitch)     if random.randint(1, 10) <= variable_lazyLevel:         time.sleep(random.randint(5, 20))     chassis_ctrl.move_degree_with_speed(variable_normalSpeed,0) def start():     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     media_ctrl.play_sound(rm_define.media_sound_solmization_1C)     led_ctrl.set_bottom_led(rm_define.armor_bottom_all, 255, 255, 255, rm_define.effect_always_on)     armor_ctrl.set_hit_sensitivity(10)     robot_ctrl.set_mode(rm_define.robot_mode_free)     variable_headMinAngle = -30     variable_headMaxAngle = 30     variable_headStep = 10     variable_defaultHeadPitch = -5     variable_headUpX = 0     variable_normalSpeed = 0.2     variable_lazyLevel = 0     list_senseHearing=RmList()     list_senseHearing.append(0)     list_senseHearing.append(0)     list_senseSight=RmList()     list_senseSight.append(0)     list_senseSight.append(0)     variable_senseSightAnimal = 0     list_senseTouch=RmList()     list_senseTouch.append(0)     list_senseTouch.append(0)     chassis_ctrl.enable_stick_overlay()     gimbal_ctrl.enable_stick_overlay()     gimbal_ctrl.set_rotate_speed(150)     gimbal_ctrl.angle_ctrl(0, variable_defaultHeadPitch)     user_defined_life()  def chassis_impact_detection(msg):     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     list_senseTouch[2] = 1     list_senseTouch[1] = 1 def ir_hit_detection_event(msg):     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     list_senseSight[2] = 1     list_senseSight[1] = 1 def armor_hit_detection_all(msg):     global variable_scanX     global variable_scanDir     global variable_isAlive     global variable_headMinAngle     global variable_headMaxAngle     global variable_headStep     global variable_headUpX     global variable_lookUp     global variable_lookUpStep     global variable_defaultHeadPitch     global variable_dX1     global variable_dY1     global variable_dX2     global variable_dY2     global variable_dV     global variable_normalSpeed     global variable_lazyLevel     global variable_i     global variable_isMoving     global variable_senseSightAnimal     global variable_senseHearingVoice     global list_Cx     global list_Cy     global list_Cd     global list_collision     global list_senseTouch     global list_senseSight     global list_senseHearing     global pid_Ii     list_senseTouch[2] = 2     list_senseTouch[1] = 1
4-5 20:43
Use props
Bitmizu
lvl.1

Singapore
Offline

Thanks. Awesome.
4-5 23:46
Use props
robertotr
lvl.1
Flight distance : 7530 ft
Guatemala
Offline

thanks man.
4-7 08:43
Use props
thomasnemo.com
lvl.2
Offline

Version 1.1 is ready. Sorry for the delay, working on Covid app
4-15 08:53
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules