func (c *Client) SoundModule() *sound.Sound {
	return c.soundModule
}
SoundModule returns a pointer to the associated Video module. Used for
detecting applause (clapping) sounds.
package sdk
import (
	"fmt"
	"io/ioutil"
	"net"
	"os"
	"github.com/brunoga/robomaster/sdk/modules/event"
	"github.com/brunoga/robomaster/sdk/modules/push"
	"github.com/brunoga/robomaster/sdk/modules/armor"
	"github.com/brunoga/robomaster/sdk/modules/blaster"
	"github.com/brunoga/robomaster/sdk/modules/chassis"
	"github.com/brunoga/robomaster/sdk/modules/control"
	"github.com/brunoga/robomaster/sdk/modules/finder"
	"github.com/brunoga/robomaster/sdk/modules/gimbal"
	"github.com/brunoga/robomaster/sdk/modules/robot"
	"github.com/brunoga/robomaster/sdk/modules/sound"
	"github.com/brunoga/robomaster/sdk/modules/video"
	"github.com/brunoga/robomaster/sdk/support/logger"
)
type Client struct {
	logger *logger.Logger
	finderModule  *finder.Finder
	controlModule *control.Control
	pushModule  *push.Push
	eventModule *event.Event
	robotModule   *robot.Robot
	gimbalModule  *gimbal.Gimbal
	chassisModule *chassis.Chassis
	videoModule   *video.Video
	armorModule   *armor.Armor
	blasterModule *blaster.Blaster
	soundModule   *sound.Sound
}
func NewClient(ip net.IP) (*Client, error) {
	l := logger.New(ioutil.Discard, os.Stdout, os.Stdout, os.Stderr)
	finderModule := finder.New(l)
	if ip != nil {
		finderModule.SetIP(ip)
	}
	controlModule, err := control.New(finderModule, l)
	if err != nil {
		return nil, fmt.Errorf("error creating control module: %w", err)
	}
	pushModule, err := push.NewPush(controlModule)
	if err != nil {
		return nil, fmt.Errorf("error creating push module: %w", err)
	}
	eventModule, err := event.NewEvent(controlModule)
	if err != nil {
		return nil, fmt.Errorf("error creating event module: %w", err)
	}
	robotModule := robot.New(controlModule)
	gimbalModule := gimbal.New(controlModule, pushModule)
	chassisModule := chassis.New(controlModule, pushModule)
	armorModule := armor.New(controlModule, eventModule)
	blasterModule := blaster.New(controlModule)
	soundModule := sound.New(eventModule)
	videoModule, err := video.New(controlModule)
	if err != nil {
		panic(err)
	}
	return &Client{
		l,
		finderModule,
		controlModule,
		pushModule,
		eventModule,
		robotModule,
		gimbalModule,
		chassisModule,
		videoModule,
		armorModule,
		blasterModule,
		soundModule,
	}, nil
}
func NewClientUSB() (*Client, error) {
	return NewClient(net.ParseIP("192.168.42.2"))
}
func NewClientWifiDirect() (*Client, error) {
	return NewClient(net.ParseIP("192.168.2.1"))
}
func (c *Client) Open() error {
	err := c.controlModule.Open()
	if err != nil {
		return fmt.Errorf("error starting control module: %w", err)
	}
	err = c.controlModule.SendDataExpectOk("command;")
	if err != nil {
		return fmt.Errorf("error entering to sdk mode: %w", err)
	}
	return nil
}
func (c *Client) Close() error {
	err := c.controlModule.SendDataExpectOk("quit;")
	if err != nil {
		return fmt.Errorf("error leaving sdk mode: %w", err)
	}
	err = c.controlModule.Close()
	if err != nil {
		return fmt.Errorf("error stopping control module")
	}
	return nil
}
func (c *Client) RobotModule() *robot.Robot {
	return c.robotModule
}
func (c *Client) GimbalModule() *gimbal.Gimbal {
	return c.gimbalModule
}
func (c *Client) ChassisModule() *chassis.Chassis {
	return c.chassisModule
}
func (c *Client) VideoModule() *video.Video {
	return c.videoModule
}
func (c *Client) ArmorModule() *armor.Armor {
	return c.armorModule
}
func (c *Client) BlasterModule() *blaster.Blaster {
	return c.blasterModule
}